MRVS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
15 hours ago - last edited 15 hours ago
I cloned the out-of-the-box widget to capture MRVS values when a request is submitted. However, the values entered by the user are not being captured on submission, and the custom portal throws an error.
If I switch back to the OOTB widget record, it works correctly. But when I use the cloned custom widget, the error occurs and the MRVS values are not captured.
Will MRVS work properly in a custom scoped application?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
15 hours ago
Hi @HARSHA GOWDA R ,
The error Cannot call property size in object... It is not a function, it is "number" is the smoking gun. In the ServiceNow Global scope, certain objects use .size() (a function), but in a Scoped Application, those same objects often use .size (a property) or .getSize().
The Fix
In your cloned widget's Server Script, look at Line 170. You need to change the way you check the size of the choiceListQuantity object.
Change this: for (var i = 0; i < choiceListQuantity.size(); i++) {
To this: for (var i = 0; i < choiceListQuantity.size; i++) {
If this works, Please Mark it as helpful and please Accept My Solution..
Best Regards,
SIVASANKARI S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
15 hours ago
Hi @sivasankaris
I already tried changing size() to size but its not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
15 hours ago - last edited 15 hours ago
Check this thread: You have to do several changes as per the post:
1. choiceListQuantity.size instead of choiceListQuantity.size()
2.choiceListQuantity.getChoice(i) instead of choiceListQuantity.get(i)
3. (isFinite(choice.getValue())) instead of (!isNaN(choice.getValue()))
4. lines 195 to 198:
data.sc_cat_item = $sp.getCatalogItem({
sys_id: data.sys_id + '',
is_ordering: true
});
Replace it with data.sc_cat_item = $sp.getCatalogItem(data.sys_id);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
15 hours ago
what's your requirement here?
why you did cloning?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
