我想在NetSuite中添加自定义选项。

huangapple go评论44阅读模式
英文:

I want to add custom option in NetSuite

问题

现在,我正在学习NetSuite课程。
我的任务是在销售订单记录中添加自定义选项。
我尝试使用UserEvent脚本,但它不起作用。

if(context.form && context.type == context.UserEventType.EDIT) {
    var currentForm = context.form;
        
    currentForm.addField({
        id: 'custpage_paymentoption',
        type: 'SELECT',
        label: '自定义付款选项',
        container : 'paymentmethod'
    });
    currentForm.addSelectOption({
        value: 'card1',
        text:  '卡片1',
    });
    currentForm.addSelectOption({
        value: 'card2',
        text:  '卡片2',
    });
    currentForm.addSelectOption({
        value: 'card2',
        text:  '卡片2',
    });
}

我不确定这是否是脚本问题。

英文:

Now, I'm in a course of learning NetSuite.
My task is to add custom option in Sales Order Record.
I tried this using UserEvent script but it doesn't work.

if(context.form && context.type == context.UserEventType.EDIT) {
    var currentForm = context.form;
        
    currentForm.addField({
        id: 'custpage_paymentoption',
        type: 'SELECT',
        label: 'Custom Payment Option',
        container : 'paymentmethod'
    });
    currentForm.addSelectOption({
        value: 'card1',
        text:  'Card1',
    });
    currentForm.addSelectOption({
        value: 'card2',
        text:  'Card2',
    });
    currentForm.addSelectOption({
        value: 'card2',
        text:  'Card2',
    });
}

I'm not sure this is script issue.

答案1

得分: 1

  1. 在 addField() 中移除容器值。
  2. 使用 insertSelectOption() 替代 addSelectOption()。

希望这些建议对您有帮助。

英文:
  1. Remove container value in addField().
  2. Use insertSelectOption() instead of addSelectOption().

Hope this advice is helpful for you.

huangapple
  • 本文由 发表于 2023年7月28日 03:28:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/76782850.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定