- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2023 08:36 AM - edited 11-21-2023 08:39 AM
Hi All,
I have Requirement :
In catalog item there are some fields :
1)office (cmn_location)- Reference
2)Desk Loaction -single line text
we are getting data for Desk location when office is selected based on location there is a field(Default desk location) in location table:
After getting data from the location table:
1)If suppose Desk location is contains all Alphabets it make ReadOnly.
Location Name(office) - Default Desk Location
-Zurich - Zurich
-Aix en Provence - Aix-en-Provence
2)If suppose Desk location contains Numbers and alphabets then it not ReadOnly.
Location Name(office) - Default Desk Location
- Wilmslow - CH/00/000
- New York (Avenue of the Americas) - 1251/00/000
-Birmingham - 67T/00/000
Please let us know how can I achieve this requirement.
Please provide code.
Please find the attached documents for your reference.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2023 11:38 AM
Hi All,
I have written ui policy
I have mention the below conditions
desk_location contains 0
or desk_location contains 1 like the I have mention the upto 9
for these and in that Run script I have written
g_form.setReadOnly('desk_location',false);
else condition
g_form.setReadOnly('desk_location',true);
For more information please find the attached screen shots.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2023 10:23 AM
@Sirri Please add an onChange client script on Desk location field as follows.
Here is the script for you.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
//Type appropriate comment here, and begin script below
if (/^(\-?[a-zA-Z]*[^d\/]*)$/.test(newValue)) {
g_form.setReadOnly('desk_location',false);
} else {
g_form.setReadOnly('desk_location',true);
}
}
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2023 11:23 AM - edited 11-22-2023 11:26 AM
Hi @Sandeep Rajput ,
Thank you
I tried with this but always showing as read only always. As per my requirement I didn't change desk location.
Desk Location data is getting from office. Please read the requirement clearly.
Thank you so much.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2023 11:38 AM
Hi All,
I have written ui policy
I have mention the below conditions
desk_location contains 0
or desk_location contains 1 like the I have mention the upto 9
for these and in that Run script I have written
g_form.setReadOnly('desk_location',false);
else condition
g_form.setReadOnly('desk_location',true);
For more information please find the attached screen shots.