如何将自定义字段中的整数值添加到NetSuite中的自定义日期字段中? [英] How to add integer value from custom field to a custom date field in NetSuite?

查看:197
本文介绍了如何将自定义字段中的整数值添加到NetSuite中的自定义日期字段中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试找出如何在新创建的自定义字段中正确定义一个日期,该自定义字段引用当前交易日期,并从位于同一表单上的NetSuite中现有的自定义字段中添加"一个整数值( PO).每次提交时,都会收到无效表达式的错误消息,或者该值只是简单的null.

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.

这是我的代码:

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

"custbody01"表示已在自定义字段(整数)内计算的现有值.想法是将预先计算的值(整数)添加到当前交易日期,以在自定义字段中计算将来的日期.我是NetSuite的新手,可以使用任何提供的帮助.

"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.

谢谢

推荐答案

我也有类似的要求.我需要在日期中添加一个整数.我相信您只需要使用TO_DATE()函数.

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.

这是我专门用作工作流条件的代码,但我相信它可以移植,只要custbody01确实是一个int值即可. (custbody456是一个自定义的 date 字段,添加了一个整数值,以计算另一个日期字段)

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

因此,我认为您可以尝试: TO_DATE({trandate}) + {custbody01})

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.

这篇关于如何将自定义字段中的整数值添加到NetSuite中的自定义日期字段中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆