Widget save fails with message: "Could not save record because of a compile error"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2023 12:33 AM
Hi,
I try to add a "Delete" button on the widget "Form". Below you can see the HTML and client-side part.
However, when I try to save, I see the following message:
HTML part:
<button ng-if="getPrimaryAction()" type="submit" ng-click="c.delete()" ng-disabled="submitting" class="btn btn-primary action-btn pull-right">${Delete}</button>
Client-side:
var c=this;
c.delete = function() {
c.data.action = 'delete';
c.server.update();
var hosturl = 'https://' + $window.location.host;
$window.location.href = hosturl + "/sp?id=sc_home";
};
Any ideas why I can't save it?
Smith.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2023 09:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2023 10:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2023 10:47 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2023 03:24 AM
Hello, thanks for your reply. Unfortunately, still I can't save it.
Even if the function is empty, I can't save it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 12:24 AM
Hello @Smith Johnson
function(){
var c=this;
c.delete = function() {
c.data.action = 'delete';
c.server.update();
var hosturl = 'https://' + $window.location.host;
$window.location.href = hosturl + "/sp?id=sc_home";
};
}
Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.
Regards,
Samaksh