- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2022 11:40 AM
I’m running a client script to make two updates to a Device record. One update is captured as expected, but the other is not done. There is no error message or anything to indicate what the problem is.
To start, the Device record has Status of “Active” and Checked Out To of “Bill”. The columns are u_status (Choice) and u_checked_out_to (String).
When I create a Service Request and save it, that should do as follows, in this order:
- Save the Device record with a blank for Checked Out to and “En Route for Service” for Status.
- Create a Service Request record and redirect the user.
For troubleshooting I have #2 rem’d out in my client script, so I won’t show that.
What actually happens is that Status is updated but Checked Out To is not.
The client script:
The result is that although the Device is now en Route for Service, it still has the name of the person it was last checked out to.
But if I set Checked Out to to a space it works fine.
// First, update the device to set status to "En Route For Service" and
// clear the checked-out-to column.
const checkedOutTo = " ";
const status = "en_route_for_service";
var query = `u_checked_out_to=${checkedOutTo}^u_status=${status}`;
var payload = {
"table": "x_acso_rf_poc_device",
"recordId": api.context.props.deviceSysid,
"templateFields": query,
"useSetDisplayValue": false
};
I also tried this:
const checkedOutTo = null;
const status = "en_route_for_service";
But that just sets it to "null".
The status column has no default value and there are no related business rules.
Can anyone suggest what to try next?
Solved! Go to Solution.
- Labels:
-
Now Experience UI Framework

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 10:49 AM
In server-side scripting, the syntax to reset a value is to set the value to "NULL". You may want to try:
const checkedOutTo = 'NULL';
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 05:18 AM
Hi,
Can you construct your "query" value as below and try?
var query = 'u_checked_out_to=' + '';
query += 'u_status=' + 'en_route_for_service';
thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2022 10:49 AM
In server-side scripting, the syntax to reset a value is to set the value to "NULL". You may want to try:
const checkedOutTo = 'NULL';