can't set a check box in createRow

  • 2
  • Problem
  • Updated 3 years ago
  • Not a Problem
i'm trying to populate a row with createRow.
I can add values to other fields, but I can't add a value to the
is_True__c field, which is a checkbox

skip_day = function (args_obj){ var year = args_obj.year;
 var month = args_obj.month;
 var day = args_obj.day;
 var skip_date = year + '-' + month + '-' + day;
 var new_row = skip_day_model.createRow({ additionalConditions: [ {field:'is_Test__c',value:true} ], doAppend: true });
console.log(new_row);
 skip_day_model.save();
 return new_row; }
skip_day({year:2017,month:1,day:1});
Object {Id: "16", Id15: "16"}
Object {Id: "16", Id15: "16"}
Photo of ktyler

ktyler

  • 9,244 Points 5k badge 2x thumb

Posted 4 years ago

  • 2
Photo of Moshe Karmel

Moshe Karmel, Champion

  • 8,646 Points 5k badge 2x thumb
You might want to try putting the true in quotes, like so:

var new_row = skip_day_model.createRow({ additionalConditions: [ {field:'is_Test__c',value:'true'} ], 
Photo of ktyler

ktyler

  • 9,244 Points 5k badge 2x thumb
Moshe, for me, at least, that does not work
Mock = function(){           this.skip_day = function (args_obj){
                var year = args_obj.year;
                var month = args_obj.month;
                var day = args_obj.day;
                var skip_date = year + '-' + month + '-' + day;
               var skip_days = skuid.model.getModel('Cal_Skip_Day');console.log(skip_days);
               var new_row = skip_days.createRow({ additionalConditions: [
                        {field: 'Skip_Day_Date__c', value:skip_date},
                        {field:'is_Test__c',value:'true'}
                    ],
                    doAppend: true
                });
               
                console.log(new_row);
                skip_days.save();
                 return new_row;
            };
this code creates a row, but the field 'is_Test__c' is not given a value

Mock = function(){           this.skip_day = function (args_obj){
                var year = args_obj.year;
                var month = args_obj.month;
                var day = args_obj.day;
                var skip_date = year + '-' + month + '-' + day;
               var skip_days = skuid.model.getModel('Cal_Skip_Day');console.log(skip_days);
               var new_row = skip_days.createRow({ additionalConditions: [
                        {field: 'Skip_Day_Date__c', value:skip_date},
                        {field:'is_Test__c',value:true}
                    ],
                    doAppend: true
                });
                skip_days.updateRow(new_row,{is_Test__c:true});
                console.log(new_row);
                skip_days.save();
                 return new_row;
            };

this code creates a row, and the is_Test__c field is created and has the value true

Photo of Zachery Tapp

Zachery Tapp

  • 72 Points
I'm running in to the same problem here:

{ field: 'Kiosk_Registration__c', value: true}

I've tried:
true
'true'
1

Nothing seems to work.
Photo of Zachery Tapp

Zachery Tapp

  • 72 Points
Figured it out - I forgot to add the boolean field to the Model I was trying to create a row on. Fixed the issue.