最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

netsuite - How to create entity group record using user event script 2.1? - Stack Overflow

programmeradmin1浏览0评论

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
  • What happens when you run this code? Do you get an error? entitygroup is the correct ID according to the Record Browser. I don't see grouptype or dynamic 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
  • When I add type as employee, record gets Created but not working for entity group record. Also I can create entity group record manually. – Maira S Commented Jan 30 at 4:00
Add a comment  | 

1 Answer 1

Reset to default 0

Script 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.

发布评论

评论列表(0)

  1. 暂无评论