- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2022 10:28 AM
Hi All,
I have two Multi Row Variable Sets in record producer after entering the data in MRVS then the row count should be store in 'Volume' field (out of MRVS) dynamically in the form. How to get the requirement any suggestions?
Script Include:
getVolume: function() {
var volume = '';
var gr1 = new GlideRecord('x_nooy_gbs_siam_gbs_request');
gr1.addQuery('sys_id', this.getParameter('sysparm_ritm'));
gr1.query();
if (gr1.next()) {
var mrvsDataField = gr1.variables.project_definition_status_update;
var rowCountDataField = mrvsDataField.getRowCount();
volume = rowCountDataField;
}
return volume;
Client Script:
function onSubmit() {
var ga = new GlideAjax("x_nooy_gbs_siam.GBS_Fetch_PrjMaintenace_Data");
ga.addParam("sysparm_name", "getVolume");
ga.addParam("sysparm_ritm", g_form.getUniqueValue());
ga.getXML(setMRVSVar1);
}
function setMRVSVar1(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
g_form.setValue('volume',answer);
}
In the above pic I entered two rows the 2 number should be in Volume field how to implement that please share your suggestions - Thank you
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2022 10:44 AM
Hello
You can do one thing in that on submit client script replace your script like below
function onSubmit() {
var mv = g_form.getValue('your mvrs backend name');
var par = JSON.parse(mv);
g_form.setValue('volume field back end name',par.length);
}
This worked for me
Please mark my answer correct if it helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2022 10:44 AM
Hello
You can do one thing in that on submit client script replace your script like below
function onSubmit() {
var mv = g_form.getValue('your mvrs backend name');
var par = JSON.parse(mv);
g_form.setValue('volume field back end name',par.length);
}
This worked for me
Please mark my answer correct if it helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2022 11:46 AM
Thank you