- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2023 08:14 AM
Hi Team ,
am trying to print the error message in the portal using widget ,but not getting the error
Please help me wright syntax
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2023 09:20 AM
@String ,
Could you please try this:
api.controller=function($scope,spUtil) {
/* widget controller */
var c = this;
$scope.myFunc = function(){
spUtil.addInfoMessage("There has been an error processing your request")
}
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2023 08:19 AM
Hi @String
please check the below link it might help you.
https://www.servicenowelite.com/blog/2019/7/31/widgets-in-catalog-items
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2023 09:20 AM
@String ,
Could you please try this:
api.controller=function($scope,spUtil) {
/* widget controller */
var c = this;
$scope.myFunc = function(){
spUtil.addInfoMessage("There has been an error processing your request")
}
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2023 10:03 AM
am using the below code
api.controller = function($scope, spUtil) {
/* widget controller */
var c = this;
$scope.clickMethod = function() {
var inputs = {
"shipto": $scope.page.g_form.getValue('shipto'),
"billto": $scope.page.g_form.getValue('billto'),
"mrvs": JSON.parse($scope.page.g_form.getValue("IO:6390228f1b306d1009952f02604bcb2b")),
"asset": $scope.page.g_form.getValue('asset')
};
//$scope.page.g_form.getValue("IO:3D1bf06ecb1b306d1009952f02604bcbb6");
c.server.get(inputs).then(function(resp) {
alert(resp.data.result);
($scope.page.g_form.setValue("IO:6390228f1b306d1009952f02604bcb2b", resp.data.result));
alert('total amount' + ". " + resp.data.amount);
if (resp.data.amount != null) {
alert('total amount if');
$scope.page.g_form.setValue('u_total_amount', resp.data.amount);
} else {
alert('total amount else 12345');
$scope.myFunc = function() {
spUtil.addInfoMessage("There has been an error processing your request");
};
}
});
};
};
code is going to else block and can see the alert total amount else 12345 but addinfoMessage is not coming
Please guide me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2023 10:08 AM
@String ,
Your else should be like this:
else {
spUtil.addInfoMessage("There has been an error processing your request");
}
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact.