My additionalConditions on createRow not Working!?!?!

Pat VachonPat Vachon Member 💎💎💎
edited June 25 in Problems
What's wrong with this? Having issues setting the values using additionalConditions property. All the fields are triple checked to be included in all models. Values are showing on this.Id and children.data[0].Id when setting breakpoints.

Rows get created without fields placed in additionalConditions property.
var params = arguments[0],      parents = skuid.$M('parents'),      children = skuid.$M('children'),      grandchildren = skuid.$M('grandchildren'),      $ = skuid.$;        $.each(parents.getRows(), function (){      children.createRow({          additionalConditions:[              {parent: this.Id}          ]      });      grandchildren.createRow({          additionalConditions:[              {parent: children.data[0].Id}          ]      });  });

Comments

  • Pat VachonPat Vachon Member 💎💎💎
    edited June 25
    Skuid Version 10.0.10

    Setting Conditions prior to createRow works without issue.
  • Zach McElrathZach McElrath Skuad
    edited June 25
    Your syntax for additionalConditions is wrong. Your Conditions need to be formatted like this:

    { field: "Parent", value: this.Id }

    or like this:

    { field: "Parent", value: children.data[0].Id }

    assuming that "Parent" is the name of the field.
  • Pat VachonPat Vachon Member 💎💎💎
    edited November 2017
    Oh my ... been in too many Skuid pages this week. Oiy!

  • Pat VachonPat Vachon Member 💎💎💎
    edited November 2017
    Wait one sec... I accidentally deleted some parts to the snippet in making it generic. This is the snippet in it's entirety.
    var params = arguments[0],     PSRPackagesSelected = skuid.$M('PSRPackagesSelected'),     NewTrackers = skuid.$M('NewTrackers'),     NewPSRTrackerTasks = skuid.$M('NewPSRTrackerTasks'),     TrackerSettings = skuid.$M('TrackerSettings'),     $ = skuid.$;  $.each(PSRPackagesSelected.getRows(), function (){     NewTrackers.createRow({         additionalConditions:[             { field: "PSR_Tracker__c", value: this.Id }         ]     });     NewPSRTrackerTasks.createRow({         additionalConditions:[             {field: "WhatId", value: NewTrackers.data[0].Id},             {field: "Subject", value: 'Confirmation of distribution of portfolio summary reports<https://abacusplanninggroup--skuid.na88.visual.force.com/00T1Y00003mjjiKUAQ>'},             {field: "ActivityDate", value: TrackerSettings.getFirstRow().PSR_Date__c + '-01'},             {field: "Type", value: 'To-Do'},             {field: "OwnerId", value: '005i0000006RUE5AAO'}         ]     }); });
  • MubeenaMubeena Member
    edited December 2017
    HI ,
    use this syntax  
    var myModelAccount = new skuid.model.Model({
               dataSourceName: "Ui-Only"
           });
    myModelAccount.createRow({ additionalConditions: [{field:'Name',value:'Test'},{field:'Type',value:'Prospect'},{field:'Description',value:'Something'} ],
                        doAppend: true
                    });
    myModelAccount.save();
  • Zach McElrathZach McElrath Skuad
    edited December 2017
    @Pat is there a particular condition that's not getting applied? Or are all of them not getting applied?
  • Pat VachonPat Vachon Member 💎💎💎
    edited December 2017
    Here's the working snippet. Old snippet seemingly didn't like "thid.Id". 

    var params = arguments[0],     pSRPackagesSelected = skuid.$M('PSRPackagesSelected'),     newTrackers = skuid.$M('NewTrackers'),     newPSRTrackerTasks = skuid.$M('NewPSRTrackerTasks'),     trackerSettings = skuid.$M('TrackerSettings'),     $ = skuid.$;  $.each(pSRPackagesSelected.getRows(), function (r,row){     newTrackers.createRow({         additionalConditions:[             {field: "PSR_Package__c", value: row.Id},             {field: "PSR_Date__c", value: trackerSettings.getFirstRow().PSR_Date__c}                      ]     });     newPSRTrackerTasks.createRow({         additionalConditions:[             {field: "WhatId", value: row.Unit__c},             {field: "PSR_Tracker__c", value: newTrackers.data[0].Id},             {field: "Subject", value: 'Confirmation of distribution of portfolio summary reports - ' + newTrackers.data[0].PSR_Package__r.PSR_Letter_Name__c},             {field: "ActivityDate", value: trackerSettings.getFirstRow().Date_Sent__c},             {field: "Type", value: 'To-Do'},             {field: "OwnerId", value: '005i0000006RUE5AAO'}         ]     }); });
Sign In or Register to comment.