This topic contains 2 replies, has 0 voices, and was last updated by AnaMG 7 years, 3 months ago.
-
AuthorPosts
-
July 21, 2017 at 3:34 pm #18358
AnaMGDoes anybody know what the fieldId is for the salesteam subrecord?
I have been trying different names, I cannot find documentation about it.
I tried: salesteam, salesteamteam
Code:
require([‘N/record’],
function(record){var soRecord = record.load({ type : record.Type.SALES_ORDER, id:552371, isDynamic : false });
soRecord.insertLine({sublistId:’salesteam’,line:0});
var salesteamSubrecord = soRecord.getSublistSubrecord({sublistId : ‘salesteam’, fieldId : ‘???????’, line:0});
salesteamSubrecord.setValue ({ fieldId : ‘isprimary’, value : true});
var id = soRecord.save({ enableSourcing : true, ignoreMandatoryFields:true });
function execute(){
}
return {
execute: execute};
});
Thank you very much in advance,Ana
This is a cached copy. Click here to see the original post. -
July 24, 2017 at 7:57 am #18359
Lakshmi NarayanaHi Ana I hope this helps.. soRecord.getSublistSubrecord({sublistId : ‘salesteam’, fieldId–> : ’employee’, line:0});
-
July 24, 2017 at 8:21 pm #18360
AnaMGI got this one to work, it is a customer not a sales order
Code:
require([‘N/record’],
function(record){var custRecord = record.load({ type : record.Type.CUSTOMER, id: 1417121, isDynamic : false });
custRecord.insertLine({sublistId: ‘salesteam’, line:0});
custRecord.setSublistValue({
sublistId:’salesteam’,
fieldId: ‘salesrole’,
value: ‘-2′,
line: 0
});
custRecord.setSublistValue({
sublistId:’salesteam’,
fieldId: ’employee’,
value: 1183656,
line: 0
});
custRecord.setSublistValue({
sublistId:’salesteam’,
fieldId: ‘isprimary’,
value: true,
line: 0
});
custRecord.setSublistValue({
sublistId:’salesteam’,
fieldId: ‘contribution’,
value: 0.00,
line: 0
});var id = custRecord.save({ enableSourcing : true, ignoreMandatoryFields:true });
function execute(){
}
return {
execute: execute};
});
Thanks -
AuthorPosts
You must be logged in to reply to this topic.