Populating custom field through Restlet
I have the following issue with restlets in Netsuite. I can not update any value on custom fields on any record. The record.setValue, record.setCurrentSublistValue, record.setText, record.setCurrentSublistText functions all seem to be ignoring my input when I set options.fieldId to a custom field, defined by another bundle/SuiteApp. For example, I have been trying to populate the field custcol_nl_wkr_category on a VendorBill’s expense sublist, or the custpage_eft_custrecord_2663_entity_acct_no/custpage_2663_entity_file_format fields on a customrecord_2663_entity_bank_details custom record.
I know that the function calls are actually executed, because I added logs just before and after, but they just seem to be ignored, there are no errors. Also when I wrap the call in a try/catch clause, nothing happens (no error is logged). Any other standard NetSuite field will work as expected.
A sample script of what I am trying:
rec = record.create({
type: 'vendorbill',
isDynamic: true,
});
// ... set some other fields
rec.selectNewLine({
sublistId: 'expense',
});
// ... set some other line fields
rec.setCurrentSublistValue({
sublistId: 'expense',
fieldId: 'custcol_nl_wkr_category',
value: line.wkrCategory // this comes from the payload of the restlet, is of type string
});
rec.commitLine({
sublistId: 'expense',
});
rec.save();
What else I have tried:
– Use record.setCurrentSublistText
– Make sure that the SuiteApp this restlet is deployed in, has the correct dependency on the SuiteApp the custom field is deployed in.
– Make sure that the user that executes the script has the permissions to set the field and read the items the field can have.
– Wrap the function call in a try/catch clause, and log the catched error, nothing was logged.
– Instead of populating the value from the payload, populate a hardcoded value which I know is a valid value for the field (so value: '2')
As I said above, I have a similar issue with creating a custom record of type customrecord_2663_entity_bank_details, with setting the custom fields on that type. So I think the problem lies with setting custom fields that belong to other SuiteApps/bundles.
https://www.reddit.com/r/SuiteScript/comments/1lk4d0b/populating_custom_field_through_restlet/ Found the solution here! The issue was that the custom field(s) I was trying to populate had specific access settings, the field can only be edited by certain roles.
However, that means that I can only execute my script/restlet as those roles. Our practice has been that we deploy the SuiteApp including a role, which has exactly those permissions that we need, so that our customers are sure we can not perform more than we need if they connect with that role.
The field in question is locked by the SuiteApp – meaning that I can’t add our own role. Is there any way to work around this? E.g., can I still change it in an installation script?
Thanks for posting your solution.
To populate a custom field via a RESTlet, ensure your script handles record.load, setValue for that field, and record.save. The RESTlet’s role must have write permissions on both the script and the target record type.
Trying AI porn chat https://lovescape.com/categories/ai-porn-chat was like discovering a new addiction overnight. The partners are bold, articulate, and filthy-minded — describing every thrust, lick, and gasp in delicious detail. They personalize everything and throw in surprises. Visuals are steamy, detailed, and make the whole experience explode. Best digital smut around.
This isa greate solution but I created a AI solution to auto create fields and populate them on the fly. If you need help I have code



