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.
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} ] }); });
Pat Vachon, Champion
-
45,236 Points
Posted 2 years ago
Pat Vachon, Champion
-
45,236 Points
Skuid Version 10.0.10
Setting Conditions prior to createRow works without issue.
Setting Conditions prior to createRow works without issue.
Zach McElrath, Employee
-
54,256 Points
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.
{ 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 Vachon, Champion
-
45,236 Points
Oh my ... been in too many Skuid pages this week. Oiy!
Pat Vachon, Champion
-
45,236 Points
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'} ] }); });
-
278 Points
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();
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 McElrath, Employee
-
54,256 Points
@Pat is there a particular condition that's not getting applied? Or are all of them not getting applied?
Pat Vachon, Champion
-
45,236 Points
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'} ] }); });
Related Categories
-
Skuid Platform
- 430 Conversations
- 120 Followers