- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2024 06:26 AM
HI All
I need to clear one variable when add a new row using MRVS
Is that posible?
1
2
3
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2024 06:47 AM
You can do this with an onSubmit Catalog Client Script that applies to the MRVS
function onSubmit() {
parent.g_form.clearValue('slb_hardware_type');
}
It will be a bit more involved if you want to compare that the row added was for that Hardware type first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2024 10:04 AM
This version will work in both the native UI and Service Portal
function onSubmit() {
if (this) { //Service Portal method
this.cat_g_form.clearValue('slb_hardware_type');
} else { //native UI method
parent.g_form.clearValue('slb_hardware_type');
}
}
For the portal method to work you'll also need an onLoad Catalog Client Script that applies to the Catalog Item, not the MRVS
function onLoad() {
if (this) {//we only need to do this for Service Portal
//We need to make the g_form object for the parent item available from the MRVS window
this.cat_g_form = g_form;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2024 06:47 AM
You can do this with an onSubmit Catalog Client Script that applies to the MRVS
function onSubmit() {
parent.g_form.clearValue('slb_hardware_type');
}
It will be a bit more involved if you want to compare that the row added was for that Hardware type first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2024 09:08 AM
Hi Brad ,
the script doesnt work on the portal view. the value on the main after submit doesnt clear the variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2024 10:04 AM
This version will work in both the native UI and Service Portal
function onSubmit() {
if (this) { //Service Portal method
this.cat_g_form.clearValue('slb_hardware_type');
} else { //native UI method
parent.g_form.clearValue('slb_hardware_type');
}
}
For the portal method to work you'll also need an onLoad Catalog Client Script that applies to the Catalog Item, not the MRVS
function onLoad() {
if (this) {//we only need to do this for Service Portal
//We need to make the g_form object for the parent item available from the MRVS window
this.cat_g_form = g_form;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2024 01:22 PM
Youuu're ROCK!!!!!!
Thank you