The CreatorCon Call for Content is officially open! Get started here.

need widget help to pass demand record to widget in portal page

Eli7
Tera Expert

Hi All,

 

I am trying to open a demand with a widget in the SP. I added demands to the Request menu and create a portal page with new widget to display the record but I am not quite sure how to pass the record sys id or number to then populate the fields.

 

At the moment I have the below code in the server script (I am just trying things still very new working with widgets)  but really need to pass the record id that opens. How should I do this can any suggest please. 

(function() {
  /* populate the 'data' object */
  /* e.g., data.table = $sp.getValue('table'); */
// step 1
data.array = [];
var grDem = new GlideRecordSecure('dmn_demand');
grDem.addQuery('sys_id', sysid);
grDem.query();
if(grDem.next())
gs.addInfoMessage(grDem.number);
{
data.array.push({
name:grDem.name.toString(),
number:grDem.number,
short_description: grDem.short_description,
bcase: grDem.business_case
});
}
})();
 
Thanks!
0 REPLIES 0