Record Producer Variable

stevenm
Kilo Guru

I'm trying to change the field label or question value dynamically on a Record Producer.   This is an unmapped variable field whose label would change depending upon a value in another field.

For instance if I enter New in a dropdown I want another field label to say New Capacity:   If I enter Add in the same dropdown I want the field label to say Add Capacity.   I'll keep googling.

Thanks

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi Steve,



For simplicity and maintenance, I would approach these as two different fields and expose them with a UI policy (or two) rather than messing with the complexity of changing a field label. No code involved and the people who come behind you in the years to come will be happier.


View solution in original post

7 REPLIES 7

alexlwm
Giga Expert

Hi Steve,



Use an onChange client script and use below code:


var field1 = g_form.getValue('dependent_value')



g_form.setLabelOf("your_field", field1);



Regards, Alex


I tried a g_form.setLabelOf("my field", "Add") and it didn't work.   I found something that says that method doesn't work in the Service Catalog.   A record producer is part of the catalog, right?   I'll try again but I don't think it'll work.


It should work, i'm using it in one of my record producer client scripts. What happens when you are trying the script?


Chuck Tomasi
Tera Patron

Hi Steve,



For simplicity and maintenance, I would approach these as two different fields and expose them with a UI policy (or two) rather than messing with the complexity of changing a field label. No code involved and the people who come behind you in the years to come will be happier.