Scripting Help- Querying the Database and returning a True/False Answer for onCellEdit Client Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 08:34 AM
Would someone please help me with scripting for onCellEdit Client Script?
I have an onChange Client Script that works, but I need to replicate the same functionality with an onCellEdit Client Script.
The onChange Client Script uses a GlideAjax call to a Script Include.
The Script Include queries the database and returns a True/False Answer
The Client Script uses that Answer to determine if a pop up should display with 2 options: 'Yes' (proceed) or 'Cancel'
Needed Outcome:
It needs to query the database to retrieve Order Management 'Order Line Items' that are associated with a 'Product Order'. The value it needs to return to the Client Script is a true/false field 'u_order_line_updated'
Order Line Item table: sn_ind_tmt_orm_order_line_item
Product Order table: sn_ind_tmt_orm_product_order
Matching field is the 'Order' field on the 'Product Order' table: order_line_item.order
Use Case:
When state changes to "X" on the Product Order table, check all associated Order Line Items, if any of them have the field 'u_order_line_updated' set to true, popup a confirmation window.
The onChange Client Script, GlideModel for the pop up, and the associated Script Include is working.
I need help scripting to replicate this functionality for an onCellEdit Client Script with this logic:
Query the Order Line Item table
If Order # matches the Order # in the Product table
Check if the Order Line Item field 'u_order_line_updated' is true
Do this for all associated Order Line Items
should return true or false
(check all associated Order Line Items, if any of them have the field 'u_order_line_updated' set to true)
Here is the code that is working for the onChange Client Script and Script Include-
onChange Client Script:
Script Include (client-callable):
Help is GREATLY appreciated!!!
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2024 11:44 AM
You could try putting some logging into the script include to see where it's getting hung up.
In the list view of order line items [sn_ind_tmt_orm_order_line_item], do a list query filter using the same query fields and take a look at the encoded query.
for example:
encoded query: order=c26ca6ae11f43110f877366201dea656^u_order_line_updated=true