Need help on client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2024 08:54 PM
HI Team ,
I want to fulfill the custom conditions through client script .
can anyone please provide me client script for my requirement .
we have catalog called ' XYZ '
We have a field ' FUNCTION' with below values
FMCODE
FMCP
FMGRM
FMMENU
Other
Field -
Action:
Add
Update
Delete
Total variables
1. Requested For
2. Line Manager
3. Short description
4. Request Type (drop down)
5. Company Code (tick box multi-selection)
6. Function (drop down)
7. Action (drop down)
8. Code Type (free text)
9. Code (free text)
10. Description (free text)
11. Report Description (free text)
12. Execution Date & Time (calendar selection)
13. Business Justification (free text)
Custom conditions
a) If function is FMGRM, and action is add, then the "code type" and "report description" fields are not there, and an extra free text field called "Value Change" is under the Description field.
b) If function is FMMENU, and action is add, then the "code type" and "report description" fields are not there
I want to fulfill the custom conditions through client script .
NOTE - Here we can use UI Plocy , there some conflicts in the UI pocly , that why i want to achieve this via cilent script .
can any one please provide correct script for this .
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2024 10:13 PM
For time being remove those two fields fro UI policy and apply alert message on functionField and actionField to check the value you getting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2024 09:48 PM
Did you tried debugging the client script with some log statements or alerts ? Please validate that the drop-down internal values are correct (For Label FMGRM -> Value is fmgrm and so on).
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2024 09:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2024 10:03 PM
Hi @nameisnani
create a onchange catalog client script, for function variable . and add 1 line on Amit verma script to check the script execution
console.log("Script executed. Function: " + g_form.getValue('function') + ", Action: " + g_form.getValue('action'));
var functionField = g_form.getValue('function');
var actionField = g_form.getValue('action');
If you are facing issues, check your proper variable names and modify it in code as well.
Note: Please Mark this Helpful and Accepted Solution. If this Helps you to understand. This will help both the community and me..
- Keep Learning
Thanks & Regards
Deepak Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2024 10:07 PM