Netsuite形式不重定向

时间:2015-05-18 05:51:45

标签: javascript netsuite

我在netsuite中创建了一个表单,以便在发布后,它应该重定向到所选记录。它没有发生 - 我做错了什么?

 if (request.getMethod() == 'GET') {
     var slcustomer = form.addField('custpage_selectfield', 'select',
                                    'Customer', 'customer');
     form.addSubmitButton('Submit'); //For submiting as i will check for post back  
     response.writePage(form); //Write the form or  display the form
 } else {
     if (request.getMethod() == 'POST') { 
         var task = request.getParameter('slcustomer');
         nlapiSetRedirectURL('RECORD', 'task', null, false);
     }
 }

2 个答案:

答案 0 :(得分:0)

我尝试在一个suitelet函数中使用你的代码,它对我有用。

grid.arrange(p1, arrangeGrob(p2,p3,p4, ncol=3), heights=c(2.5/4, 1.5/4), ncol=1)

答案 1 :(得分:0)

var slcustomer = form.addField('custpage_selectfield', 'select',
                                    'Customer', 'customer');

此行创建客户记录的下拉列表。

var task = request.getParameter('custpage_selectfield');
nlapiLogExecution('debug', 'selected id', task);
nlapiSetRedirectURL('RECORD', 'task', null, false);

任务变量应包含所选客户的内部ID。您的nlapiSetRedirectURL调用不正确。如果要重定向到所选客户,则应为

nlapiSetRedirectURL('RECORD', 'customer', task);