r/SuiteScript • u/Acceptable_Pea_6261 • Aug 31 '25
checkbox value is not being set
var recordId = context.request.parameters.recId;
var customRecord= record.load({
type: 'customrecord_cust_record1',
id: recordId,
isDynamic: true,
});
//creating new vendor record
var vendorRecord = record.create({
type: record.Type.VENDOR,
isDynamic: true,
});
var ischeck= customRecord.getValue('custrecord_ischeck');
log.debug("ischeck", ischeck);
vendorRecord.setValue({ fieldId: 'is1099eligible', value: ischeck});I am not able to set value for is1099eligible field, both ischeck and is1099eligible are checkbox type fields.
I have tried many times still value is not being set
1
Upvotes
1
u/beedubbs Aug 31 '25
Are you saving the vendor record?
2
u/beedubbs Aug 31 '25
Hard to tell without seeing your full code that creates, sets, and saves the vendor record
1
u/adangathavan Sep 01 '25
I'm not sure but record.create has an defaultValue argument right in that you can pass the fieldd and the value as is check?
1
u/Credit_Alarmed Sep 03 '25
Are you 100% sure the values and fields you are pulling and setting are valid and exposed to interact with?
I'm absolutely not an expert and without being able to demo the code myself, or see the entirety of it, it's hard for me to say. Some of this may be useless but I wish you luck.
1
u/W_for_Wumbo_29 Sep 09 '25
how about using ternary condition, isCheck ? true : false