This topic contains 3 replies, has 0 voices, and was last updated by j.j 7 years, 2 months ago.
-
AuthorPosts
-
MarkZSSI- Contributions: 0
- Level 1
- ☆
I'm trying to set a checkbox and everything in the scheduled script works fine when testing it by writing to the screen.
In testing the code – This works:
Code:
response.write("n" + "check that box" + "n");
When I tried to push as a live schedule in our sandbox – This does NOT work:Code:
nlapiSetFieldValue('custbody_a1wms_dnloadtowms', 'T');
Any ideas on how to get the checkbox to check when the write to screen works fine using the same testing to write that statement.
This is a cached copy. Click here to see the original post. -
MarkZSSI- Contributions: 0
- Level 1
- ☆
Nevermind. I figured it out. Scheduled scripts make you go through the whole load record and submit record stuff. ie:
Code:
var order = nlapiLoadRecord('salesorder', it);
order.setFieldValue('custbody_a1wms_dnloadtowms', 'T');
nlapiSubmitRecord(order, true); -
erictgrubaugh- Contributions: 0
- Level 1
- ☆
nlapiSetFieldValue
would not be applicable in a Scheduled Scripts as there is no record in the global context. That would only work in a User Event, Client Script, or Workflow Action that is associated to a specific record type. In a Scheduled Script, you will need to be loading or creating a record, then use record.setFieldValue`
MarkZSSI replied on 06/08/2017, 03:32 PM: Yes, I figured it out. See above. And thanks for responding! -
j.j- Contributions: 0
- Level 1
- ☆
i would suggest using nlapisubmitfield – this would save you from loading and submitting the entire record.
-
AuthorPosts
You must be logged in to reply to this topic.