How to call save method in Recordlist Js ?

Hi There,

I am looking to trigger alert box confirmation box on onchange and update one of the dropdown field while record edit and save inline (in record list view)

I tried 'handleSave: function() of record js in recordlist js but it't not working.  Please suggest me any way to achive this. 

If we can not use save method in recordlist js then please suggest a way to use onchange event for relate field in recordlist js as onchange event also not working for relate field.

'

  • Custom validation is not working in recordlist js . although i am able to show the alert box on save button click but default save method is triggering before alert box show , How can we disable default save method in record js ?

  • You need to override method addActions in the js controller of RecordListView in order to set a custom field type for button inline-save. After that you need to create that custom field type extending from EditablelistbuttonField and, at last, override method saveClicked in that js controller.

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Maybe you could work with the field itself to add the validation to the field. See if this helps:

    sugarclub.sugarcrm.com/.../7699

  • Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    ({
    extendsFrom: 'RecordlistView',
    initialize: function(options){
    console.log('This is Quotes RecordlistView');
    this._super('initialize', [options]);
    },
    events: {
    'mousedown [name=inline-save]': 'saveClicked',
    'mousedown [name=inline-cancel]': 'cancelClicked'
    },
    saveClicked: function(evt) {
    var model = App.controller.context.get('model');
    var rowid = model.get('id');
    var allocated_work_product_c = model.get('allocated_work_product_c');
    var TS_API = "rest/v10/ANML_Animals/" + rowid + "?fields=allocated_work_product_c";
    App.api.call("get", TS_API, null, {
    success: function(TSData) {
    var old_allocated_WP_value = TSData.allocated_work_product_c;
    console.log('TS_API data : ', TSData);
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I am using the same , Alert box is working but the issue is that default save method called before the aler box populate. I want to use the save option only on onconfirm click , How can we disable auto save for this function ?

  • Yes, I tried that but it's not working for recordlist js .

  • This approach will not work. Did you ever try my suggestion?

    André Lopes
    Lampada Global
    Skype: andre.lampada
  • Yes, It's working for me. Thanks a lot for your help!