Make an order guide variable "ReadOnly" on "choose options" tab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2017 08:58 AM
Hi,
I have a field "Beneficiary" on an order guide . This field is populated on the order guide form.
I wrote a catalog client script to make it readonly on the first tab .
When I go back by clicking on " describe needs" button, I want the beneficaiary field can be editable.
My catalog client script is :
function onLoad() {
if (g_form.getParameter('sysparm_active')!='') {
// this stuff only runs if catalog item is viewed in Order Guide
g_form.setReadOnly('Myvariable',true);
}
}
So I want that when I am on "describe needs" tab the "beneficiary" field to be readonly but not on "choose options" tab.
Thanks you in advance for you help !
Arnaud
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2017 02:09 PM
You could try something like this in an onload catalog client script (assuming this is on a variable set?).
var thisGuide = $("sysparm_guide").value;
var thisItem = $("current_item").value;
if(thisGuide == thisItem) {
g_form.setReadOnly('Myvariable', true);
}
This should make the variable read-only as the order guide loads (or if you navigate back to the Describe Needs screen) but would take no action when a catalog item is loaded (when you click choose options).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2017 08:45 AM
Hi ,
Thanks you so munch for your answer. It works.
I tried the catalog client script and it works as bellow :
1. When I am on "Describe needs" tab the " beneficiary" field is ReadOnly.
2. But when I am on "choose option" tab the " beneficiary" field is not ReadOnly.
Could you tell me how to do the opposite ? That is finaly the request of the customer .
Many Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2017 08:55 AM
Hi.You should write the catalog client script for the Catalog Item present in the Choose Options tab.
Some thing like onLoad :
g_form.setReadOnly('Myvariable', true);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2021 11:01 AM
Did you get a response for this? I'm currently looking to do the same - make it read only on the options page.