【问题标题】:cascading/dependent sublist dropdown in netsuite with suitescript带有suitescript的netsuite中的级联/依赖子列表下拉列表
【发布时间】:2018-07-19 12:38:38
【问题描述】:

我需要在子列表字段中实现依赖下拉菜单。 我已经使用form.addSubList(); 创建了子列表 在套件中并在子列表中添加了两个选择字段。使用 setScript() 调用客户端脚本进行一些验证和插入值。 这两个选择字段应该是相关的。例如,如果我分别有两个主要下拉列表和次要下拉选择字段,在主要下拉列表中可能是旅行,国家/地区,第二个选择字段应根据第一个选项的选择动态填充。如果我选择了旅行,那么第二个选择字段应该显示下拉值:Travel-Domestiv、Travel- International,如果选择了国家,它应该是阿根廷、比利时、印度。 为了实现这一点,我在字段更改时实施,使用 nlapiInsertLineItemOption 和 nlapiRemovetLineItemOption 我更新了值。但是当下一行更新时,第二次选择会覆盖这些值。请帮助我如何存储值或 id 它可以根据选择来禁用/隐藏子列表字段中的下拉列表,或者可以通过 psot 采购来实现。

代码 sn-p:

if(primary_selected == '1')//primary_selected dropdown:Travel and Country
{
      nlapiRemoveLineItemOption('custpage_other_cost_sublist_plan', 'custpage_secondary_plan_items'); //remove all existing select options 
            nlapiInsertLineItemOption('custpage_other_cost_sublist_plan', 'custpage_secondary_plan_items', '', '',true);
            nlapiInsertLineItemOption('custpage_other_cost_sublist_plan', 'custpage_secondary_plan_items', '1', 'Domestic',false);
            nlapiInsertLineItemOption('custpage_other_cost_sublist_plan', 'custpage_secondary_plan_items', '2', 'International',false);
            nlapiInsertLineItemOption('custpage_other_cost_sublist_plan', 'custpage_secondary_plan_items', '3', 'Others',false);

        }
        else
        {
            if(primary_selected == '3')
            {

            nlapiRemoveLineItemOption('custpage_other_cost_sublist_plan', 'custpage_secondary_plan_items'); //remove all existing select options 
            nlapiInsertLineItemOption('custpage_other_cost_sublist_plan', 'custpage_secondary_plan_items', '', '',true);
            nlapiInsertLineItemOption('custpage_other_cost_sublist_plan', 'custpage_secondary_plan_items', '4', 'Argentina',false);
            nlapiInsertLineItemOption('custpage_other_cost_sublist_plan', 'custpage_secondary_plan_items', '5', 'Belgium',false);
            //nlapiInsertLineItemOption('custpage_other_cost_sublist_plan', 'custpage_secondary_plan_items', '6', 'India');
            }
            }

【问题讨论】:

    标签: netsuite sublist


    【解决方案1】:

    我认为您尝试做的事情不可能在子列表中进行。您可能会考虑创建一个助手类型的解决方案,让用户在其中浏览“向导”类型的应用程序。助手可以在您在每一步重建页面时存储值。

    【讨论】:

    • 非常感谢您的回复。能否请您简要介绍一下。我没有得到完整的视图。
    猜你喜欢
    • 2016-08-13
    • 2016-04-05
    • 2015-02-25
    • 1970-01-01
    • 1970-01-01
    • 2015-01-02
    • 1970-01-01
    • 2020-04-27
    • 2018-01-12
    相关资源
    最近更新 更多