- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2017 02:53 PM
Hi there - I am trying to embed a form widget within a modal widget. In this case it's a "New" button and I want to have the button bring up a Modal to create a new Task. The modal is coming up fine and it looks like the Form widget is embedding, but its not rendering the Form. I just get a "Record not found" message. I'm sure it has to do with the "widgetInput" parameter below, but based on the documentation i saw on Git it looks like I'm doing this correctly (even thought I'm clearly not).
Does anyone have a suggestion for what I'm doing wrong?
Solved! Go to Solution.
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2017 04:07 PM
Hi Kurt,
What you have there is perfectly correct from a technical perspective, after a bit of investigation I've discovered that the sys_id parameter is not actually getting passed over in your widgetInput object - for some reason it is getting stripped out! You can verify this yourself if you clone the Form widget and modify it to log out the $scope data.
So the best solution I can find is to follow that route, if your requirement is only to open a new form then make a clone of the Form Widget and call that clone in your modal instead. In the Server script of your cloned Widget, force it to use -1 as its sys_id
Hope this helps despite it not being a particularly elegant solution!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2024 09:26 AM
Below code has worked for me. Essentially instead of "-1" being a string, I made it an integer...
if(action == 'addRule'){
spModal.open({
title: "Rule Details",
widget: "widget-form",
widgetInput: {sys_id: -1, table: '<My Table Name>'}
}).then(function(){
alert("Rule Added);
});
}