简体   繁体   English

SuiteScript:如何使用自定义数据字段从数据库加载信息

[英]SuiteScript: how to have a custom data field to load infomation from database

I use suitescript user event to add tab and some field belong to that tab when open a sale order. 打开销售订单时,我使用suitescript用户事件添加选项卡,并且某些字段属于该选项卡。 However, whenever I save the the information in that field, I can't see the information I manually input and save when i go back to that document. 但是,无论何时将信息保存在该字段中,当我返回该文档时,都看不到手动输入并保存的信息。 It seems like I miss the step loading data for custom field. 似乎我错过了为自定义字段加载数据的步骤。 Any suggestion on how to fix that problem? 关于如何解决该问题的任何建议? Thanks!!! 谢谢!!!

The normal way to do this is to create a customized form, rather than writing SuiteScript. 通常的方法是创建自定义表单,而不是编写SuiteScript。

Have you looked at the field APIs? 您是否看过现场API? I would try nlapiGetFieldValue(). 我会尝试nlapiGetFieldValue()。

You are creating a fields dynamically using script. 您正在使用脚本动态创建字段。 You should be aware that the information on these fields will not be saved because you created it using a script unless you get the value of this dynamically created field and put it to an existing standard or custom field before you submit the record to capture the information. 您应该知道,这些字段上的信息将不会保存,因为您是使用脚本创建的,除非您在提交记录以捕获信息之前获取了此动态创建的字段的值并将其放入现有的标准或自定义字段中。 As for viewing the record you need to get the value from the standard or custom field and set that as default value of your dynamically created field. 至于查看记录,您需要从标准或自定义字段中获取值,并将其设置为动态创建的字段的默认值。

I am not sure why you need to create the field dynamically if you can create a custom field. 我不确定如果可以创建自定义字段,为什么需要动态创建该字段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM