- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2023 03:17 AM
Hi Community,
Need your help with the Ajax code (Script include) and client script.
This code is created to call the record from the leave bucket and populate the respective fields in the new leave request form. variables are correct, but some how the code is not working (unable to pull the record and populate)
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2023 11:55 AM
@MG_Azam I asked you to make changes in the Client script only. Your script include script should remain same.
In a nutshell, your ImsAjax should look like the following
And your Populate leave data should have the following code.
Hope this clears out all the confusion and resolves your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2023 05:39 AM
Hello @MG_Azam
In client script in 8th line use this
g_user.userID()
And in the script include
In the line 22, 23 and 24
Use this
gr.accrued.getDisplayValue();
gr.balance.getDisplayValue();
gr.taken.getDisplayValue();
This will work.
Please accept solution and mark as helpful if it helps you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2023 09:56 AM
Hi @Harsh_Deep ,
I'm getting an error at the form stating the user.userID is not a function.
And included the same for line 22,23 and 24 as you suggested, still not working, any other solutions, please let me know
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2023 05:52 AM
Troubleshoot this by adding alerts to the Client Script to confirm that it is running, and the answer/result. Make sure your Script Include is Client callable, and add some gs.info or gs.addInfoMessage lines to confirm it is running, the values passed in from the client, if/which record is fetched by the GR, and the value that is to be returned to the client. If/once it's making it inside the gr.next with the correct record, if the log of the leaveDetails object is not correct, you might just need to force each field to a string like this:
leaveDetails.accrued = '' + gr.accrued.toString();
leaveDetails.balance = '' + gr.balance.toString();
leaveDetails.take = '' + gr.taken.toString();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-29-2023 09:54 AM
Hi @Brad Bowman ,
Thanks for helping the code is running as you mentioned to add the gs.addInfoMessage, I'm able to find the notification, but still the script is not pulling the record, any other suggestions, please provide.