Catalog Client Script in a Variable Set: setReadOnly not working

tahnalos
Kilo Sage

I'm trying to use a Catalog Client Script to set Read Only to a bunch of variables in a variable set.  Others are having setReadOnly set to false as I expect data to be populated on these variables.  This variable set is on a Record Producer, and the script is only being run on the Target Record.

 

However, when I attempt to use g_fom.setReadOnly (<variable_name>, true) or g_form.setReadOnly (<variable_name>, false), neither of these options work.  And before you wonder why I'm using a Catalog Client Script instead of a Catalog UI policy, it's because I'm using a g_scratchpad variable to determine the course of action.

 

Is it possible that setReadOnly doesn't work on Catalog Client Scripts on variable sets?

 

Thanks

7 REPLIES 7

Murthy Ch
Giga Sage

Hi @tahnalos 

From where you are accessing the scratchpad value?
Can you share your script?

Thanks,
Murthy

Kieran Anson
Kilo Patron

Hi,

Are you wanting all variables in the variable set to be set to read only, or specific ones? When you say others are working, are these variables not in the variable set?

 

Is this a multi-row variable set? 

 

On your target table, have you confirmed there isn't any other scripts that could be applying after your script, and therefore making them accessible again? 

 

Can you share your existing script?

All of these variables are in the variable set.  However, due to specific values that are gathered via the scratchpad variable, some are made visible and some are not.  Before you ask, I did confirm the scratchpad variable is working.  What's not working is when I ask for setReadOnly to work.

Juhi Poddar
Kilo Patron

Hello @tahnalos 

The issue could be due to the following reasons:

  • The field is mandatory – If the variable is set as mandatory, g_fom.setReadOnly (<variable_name>, true) may not work as expected. Try making the field non-mandatory before setting it to read-only.
  • The Client Script should be inside the Variable Set – When working with variables inside a Variable Set, ensure that the Catalog Client Script is written within the same Variable Set rather than the main Record Producer. This ensures the script properly references the variables.

Hope this helps!

 

"If you found my answer helpful, please like and mark it as an "accepted solution". It helps future readers to locate the solution easily and supports the community!"

 

Thank You
Juhi Poddar