Multirow variable set value shows empty after submit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2019 01:46 PM
Hi,
We've a catalog item available for end-user over Service Portal. After all the approvals, catalog items gets created. This catalog item is contains a mult-row variable set.
The value of the multirow variable set is showing as empty in log messages.
What could be the cause?
Thanks.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2019 12:00 PM
Could you post onchange Script, which calculates the amount from quantity and rate? Do you verified, that you set the value of the amount as String and not as Number? I mean: looks your code like
var amount = parseInt(g_form.getValue("quantity"), 10) *
parseFloat(g_form.getValue("rate")); // Number
g_form.setValue("amount", String(amount)); // set String
or like
var amount = parseInt(g_form.getValue("quantity"), 10) *
parseFloat(g_form.getValue("rate")); // Number
g_form.setValue("amount", amount); // set Number
which produce the error in Service Portal. It was the problem described in my answer on the referenced question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2019 12:25 PM
Sorry, I found the code of widget, which you posted, too late. It could be that the origin of your problem the usage of old "SC Catalog Item Deprecated" clone. Could you place breakpoint on the line
return $http.post(requestUrl, reqData);
or to add console.log(reqData); before the line and verify the data contain property with the name of Multi-row variable and the value as JSON string, which represent the array of values added in Multi-row variable?
New "SC Catalog Item" use spScUtil.addToCart for adding data to chart or spScUtil.orderNow for placing order now. The data, which will be posted are filled with respect of getVarData function instead of usage $scope.data.sc_cat_item.
Probably, you make one test with new "SC Catalog Item" widget (id="widget-sc-cat-item-v2"). If Multi-row variable will be correctly posted, then you can modify your current widget to post the results like "SC Catalog Item" do. I know the widget good and can help you if needed.