Scenario
Set the date/time the transaction was approved based on the approver's time zone on a free-form text field.
The sysdate in TO_CHAR(SYSDATE, 'YYYY/MM/DD') will return NetSuite server's time which is in PST.
The sysdate in TO_CHAR(SYSDATE, 'YYYY/MM/DD') will return NetSuite server's time which is in PST.
Solution
To get date/time value in logged in user's time zone as set under Home > Set Preferences > Time Zone, use an additional custom field. This is more reliable than adding time difference (e.g. sysdate+9/24) as the difference changes with daylight saving time.
1. Create a Custom Field that will store the approver's date/time
1.1. Go to Customization > Lists, Records, & Fields > Transaction Body Fields > New
1.2. Set fields as follows:
• Type = Date/Time
• ID = custbody_time_now
• Stored Value = False
• Applies To > Select applicable transaction type
• Validation & Defaulting > Dynamic Default = Current Date/Time
1.3. Click Save
2. Create the Workflow > Set Field Value Action
2.1. On your Workflow > State > New Action, select Set Field Value
2.2. Set fields as follows:
• Trigger On = Entry
• Event Types = Approve
• Parameters > Fields > Select your free-form text field. (e.g. Memo)
• Value > Formula = 'Approved on: ' || to_char({custbody_time_now}, 'YYYY/MM/DD HH24:MI:SS')
2.3. Click Save
1. Create a Custom Field that will store the approver's date/time
1.1. Go to Customization > Lists, Records, & Fields > Transaction Body Fields > New
1.2. Set fields as follows:
• Type = Date/Time
• ID = custbody_time_now
• Stored Value = False
• Applies To > Select applicable transaction type
• Validation & Defaulting > Dynamic Default = Current Date/Time
1.3. Click Save
2. Create the Workflow > Set Field Value Action
2.1. On your Workflow > State > New Action, select Set Field Value
2.2. Set fields as follows:
• Trigger On = Entry
• Event Types = Approve
• Parameters > Fields > Select your free-form text field. (e.g. Memo)
• Value > Formula = 'Approved on: ' || to_char({custbody_time_now}, 'YYYY/MM/DD HH24:MI:SS')
2.3. Click Save