admin管理员组文章数量:1418371
I am trying to create entity group record via script. I am using record.create api to create entity group record. But in record.type enum, I don't see 'entitygroup' parameter value. How it can be done? Please advice.
This is function to create entity group record,
function entityGroupCreation(name, subAbbrev, searchId){
var entityGroupRec = record.create({ type: 'entitygroup' });
log.debug("entityGroupRec",entityGroupRec);
entityGroupRec.setValue('grouptype', 'Employee');
entityGroupRec.setValue('dynamic', true);
entityGroupRec.setValue('groupname', `${subAbbrev} Folder Grp - ${name}`);
entityGroupRec.setValue('savedsearch', searchId);
return entityGroupRec.save({ enableSourcing: true, ignoreMandatoryFields: true });
}
I am trying to create entity group record via script. I am using record.create api to create entity group record. But in record.type enum, I don't see 'entitygroup' parameter value. How it can be done? Please advice.
This is function to create entity group record,
function entityGroupCreation(name, subAbbrev, searchId){
var entityGroupRec = record.create({ type: 'entitygroup' });
log.debug("entityGroupRec",entityGroupRec);
entityGroupRec.setValue('grouptype', 'Employee');
entityGroupRec.setValue('dynamic', true);
entityGroupRec.setValue('groupname', `${subAbbrev} Folder Grp - ${name}`);
entityGroupRec.setValue('savedsearch', searchId);
return entityGroupRec.save({ enableSourcing: true, ignoreMandatoryFields: true });
}
Share
Improve this question
asked Jan 29 at 17:03
Maira SMaira S
716 bronze badges
2
|
1 Answer
Reset to default 0Script worked when I used record.create api as below:
record.create({ type: 'entitygroup', defaultValues: { grouptype: 'Employee', Dynamic: true } });
Need to add mandatory fields in the default values.
本文标签: netsuiteHow to create entity group record using user event script 21Stack Overflow
版权声明:本文标题:netsuite - How to create entity group record using user event script 2.1? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745288335a2651637.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
entitygroup
is the correct ID according to the Record Browser. I don't seegrouptype
ordynamic
as valid field IDs, so those might cause problems, but the record type you have is correct. You aren't forced to use the enumeration. – erictgrubaugh Commented Jan 29 at 17:06