How to add integer value from custom field to a custom date field in NetSuite?

只谈情不闲聊 提交于 2019-12-11 00:20:45

问题


I have been trying to figure out how to appropriately define a date within a newly created custom field that references the current transaction date and 'adds' an integer value from an existing custom field in NetSuite that's located on the same form (a PO). Each time I submit, I get an error for an invalid expression or the value is simple null.

Here's my code:

CASE WHEN {entity} = 'Test Vendor' THEN 
    {trandate} + {custbody01} 
ELSE 56
END

"custbody01" represents an existing value that has been calculated within a custom field (integer). The idea is for a pre-calculated value (integer) to be added to the current transaction date to calculate a future date in the custom field. I am very new to NetSuite and could really use any help provided.

Thank You


回答1:


I've had a similar requirement. I've needed to add an int to a date. I believe you just need to use the TO_DATE() function.

Here's the code I specifically used as a workflow condition, but I believe it would be transferable, so long as custbody01 is indeed an int value. (custbody456 is a custom date field, adding an integer value, to calculate another date field)

Estimated Ship Date=to_date({custbody456}) + 17

So I think for you, you may want to try: TO_DATE({trandate}) + {custbody01})

When executing, this code will reference the existing custom field and add that value to the current transaction date.



来源:https://stackoverflow.com/questions/54190796/how-to-add-integer-value-from-custom-field-to-a-custom-date-field-in-netsuite

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!