Skip to main content
Nintex Community Menu Bar
Question

My additionalConditions on createRow not Working!?!?!

  • July 11, 2024
  • 7 replies
  • 23 views

Forum|alt.badge.img+20

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} ] }); });<br>

7 replies

Forum|alt.badge.img+20

Skuid Version 10.0.10

Setting Conditions prior to createRow works without issue.


Forum|alt.badge.img+13

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.


Forum|alt.badge.img+20

Oh my … been in too many Skuid pages this week. Oiy!


Forum|alt.badge.img+20

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'} ] }); });


Forum|alt.badge.img+2
  • July 11, 2024

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();


Forum|alt.badge.img+13

@Pat is there a particular condition that’s not getting applied? Or are all of them not getting applied?


Forum|alt.badge.img+20

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'} ] }); });<br>