Netsuite:根据所选交易(采购订单)用项目填充字段
是否有方法过滤所选采购订单(交易)字段中列出的项目,即用户选择采购订单,然后用该采购订单上的项目列表填充项目字段Netsuite:根据所选交易(采购订单)用项目填充字段,netsuite,Netsuite,是否有方法过滤所选采购订单(交易)字段中列出的项目,即用户选择采购订单,然后用该采购订单上的项目列表填充项目字段 很抱歉,如果这是一个非常简单的问题,但我已经搜索了所有的地方,我不能找到确切的这种情况。在文档中也找不到它。我会继续努力,但如果有人能马上知道,我将不胜感激 可以使用Suitescript 您需要在加载前使用用户事件脚本在上动态地向表单插入一个自定义选择字段,我们将其称为custpage\u mycustomfield 然后您需要一个clientscript来填充custpage\u
很抱歉,如果这是一个非常简单的问题,但我已经搜索了所有的地方,我不能找到确切的这种情况。在文档中也找不到它。我会继续努力,但如果有人能马上知道,我将不胜感激 可以使用Suitescript 您需要在加载前使用用户事件脚本在
上动态地向表单插入一个自定义选择字段,我们将其称为custpage\u mycustomfield
然后您需要一个clientscript来填充custpage\u mycustomfield
上的项目列表,这需要在PO字段更改后进行。您可以运行搜索或加载记录以获取行项目
您在custpage\u mycustomfield
中输入的数据将不会被保存,因此,如果您想保留它,您需要执行以下操作:
使用列表/记录类型的UI创建自定义字段>
项目,让我们称之为custbody\u mypermanentfield
将clientscript函数设置为在将复制
从custpage\u mycustomfield
到custbody\u mypermanentfield
中选择的值
可以使用Suitescript
您需要在加载前使用用户事件脚本在上动态地向表单插入一个自定义选择字段,我们将其称为custpage\u mycustomfield
然后您需要一个clientscript来填充custpage\u mycustomfield
上的项目列表,这需要在PO字段更改后进行。您可以运行搜索或加载记录以获取行项目
您在custpage\u mycustomfield
中输入的数据将不会被保存,因此,如果您想保留它,您需要执行以下操作:
使用列表/记录类型的UI创建自定义字段>
项目,让我们称之为custbody\u mypermanentfield
将clientscript函数设置为在将复制
从custpage\u mycustomfield
到custbody\u mypermanentfield
中选择的值
我知道这是非常古老的,但我认为一个更健壮的解决方案是使用定制表单上保存的搜索过滤器
从管理中心-->自定义-->表单-->交易表单-->您的表单-->编辑
在“子列表字段”选项卡下是项搜索的下拉菜单。您只需选择一个搜索,根据您的需要限制下拉列表 我知道这是一个非常古老的解决方案,但我认为更可靠的解决方案是使用自定义表单上保存的搜索过滤器
从管理中心-->自定义-->表单-->交易表单-->您的表单-->编辑
在“子列表字段”选项卡下是项搜索的下拉菜单。您只需选择一个搜索,根据您的需要限制下拉列表 所有这些都可以通过采购订单字段的fieldChanged
事件上的clientscript完成。首先,在采购订单上应用搜索并获取所有子列表项目列表,然后删除项目字段的所有选择选项,然后在此字段上添加采购订单的子列表项目列表
function fieldChanged(context){
var currRec = context.currentRecord;
// search on PO to get sublist items
var itemSearch = search.create({
type: 'purchaseorder',
filter: ['internalid', 'is', '<your PO id>'],
columns: ['item']
}).run().getRange(0,100);
var poItemList = [];
itemSearch.forEach(function(result){
if (result.getValue({name: 'item'})) {
poItemList.push = { value: result.getValue({name: 'item'}), text: result.getText({name: 'item'})};
}
})
//remove all options of item field
var itemField = currRec.getField({fieldId: '<your custom field>'});
itemField.removeSelectOption({value: null}) //this removes all options
//add sublist items in item field options
poItemList.forEach(function(item){
itemField.addSelectOption(item);
})}
函数字段已更改(上下文){
var currRec=context.currentRecord;
//搜索采购订单以获取子列表项目
var itemSearch=search.create({
键入:“purchaseorder”,
筛选器:['internalid','is','',
列:['item']
}).run().getRange(0100);
变量poItemList=[];
itemSearch.forEach(函数(结果){
if(result.getValue({name:'item'})){
poItemList.push={value:result.getValue({name:'item'}),text:result.getText({name:'item'});
}
})
//删除项目字段的所有选项
var itemField=currRec.getField({fieldId:''});
itemField.removeSelectOption({value:null})//这将删除所有选项
//在项目字段选项中添加子列表项目
poItemList.forEach(函数(项){
itemField.addSelectOption(项目);
})}
希望这有帮助 所有这些都可以通过采购订单字段的fieldChanged
事件上的clientscript完成。首先,在采购订单上应用搜索并获取所有子列表项目列表,然后删除项目字段的所有选择选项,然后在此字段上添加采购订单的子列表项目列表
function fieldChanged(context){
var currRec = context.currentRecord;
// search on PO to get sublist items
var itemSearch = search.create({
type: 'purchaseorder',
filter: ['internalid', 'is', '<your PO id>'],
columns: ['item']
}).run().getRange(0,100);
var poItemList = [];
itemSearch.forEach(function(result){
if (result.getValue({name: 'item'})) {
poItemList.push = { value: result.getValue({name: 'item'}), text: result.getText({name: 'item'})};
}
})
//remove all options of item field
var itemField = currRec.getField({fieldId: '<your custom field>'});
itemField.removeSelectOption({value: null}) //this removes all options
//add sublist items in item field options
poItemList.forEach(function(item){
itemField.addSelectOption(item);
})}
函数字段已更改(上下文){
var currRec=context.currentRecord;
//搜索采购订单以获取子列表项目
var itemSearch=search.create({
键入:“purchaseorder”,
筛选器:['internalid','is','',
列:['item']
}).run().getRange(0100);
变量poItemList=[];
itemSearch.forEach(函数(结果){
if(result.getValue({name:'item'})){
poItemList.push={value:result.getValue({name:'item'}),text:result.getText({name:'item'});
}
})
//删除项目字段的所有选项
var itemField=currRec.getField({fieldId:''});
itemField.removeSelectOption({value:null})//这将删除所有选项
//在项目字段选项中添加子列表项目
poItemList.forEach(函数(项){
itemField.addSelectOption(项目);
})}
希望这有帮助 可以使用脚本。您认为这个“项目”字段如何工作?作为带有逗号分隔的项目列表的自由文本?还是多选?或者选择?如果可能,选择。基本上,用户将选择与此新记录相关的采购订单,然后用户需要选择PO上正在测试的项目(新记录是质量测试记录)。我可以过滤交易以仅显示采购订单,但我无法获得第二个选择框以进入该采购订单上的项目并列出这些项目。可以使用脚本。您认为这个“项目”字段如何工作?作为带有逗号分隔的项目列表的自由文本?还是多选?或者选择?如果可能,选择。基本上,使用