How to obtain the values of fields in the record producer, from a client script of a variable set?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 03:13 PM - edited 11-28-2023 09:36 AM
Hello, I want to know how to obtain the field values in the record producer, from a client script of a variable set that is located within the same record producer, i need an example
//Client script from variable set
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var mon= g_form.getValue('u_variable_from_variable set');
var macom = producer.u_variable_from_Record_producer; //doesn't work
var total = 0;
total = total + mon;
g_form.setValue('u_results', macom - total);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 03:20 PM - edited 11-27-2023 03:24 PM
You should just be able to call producer.variable_name in the script of the record producer. You could set a field like current.u_requested_by = producer.requester
requester is the variable in the variable set we're using. Hope that helps.
Edit: I guess I didn't quite read the question right, you're trying to pull the value from a client script within a variable set that is located within the same record producer. where exactly are you storing the client script value? what is your client script doing exactly?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 03:29 PM
I want to get the value of a field in the record producer from my client script from my variable set to use the field and then return a value to a field in the record producer in a client script type on change
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 03:49 PM
The same way you would get/set the value of a variable directly on a Record Producer:
g_form.getValue("variable_name");
and then:
g_form.setValue("other_variable", calculatedValue);