sysverb_insert

Raymond Beijerl
Tera Expert

In some UI Actions the action name is called sysverb_insert

e.g Demand Management->Ideas Table->UI Action: Accept

This example creates a demand request record and redirects to the Idea Record (as defined in the script part of the UI action)

What is de code behind the sysverb_insert action name?

How can I influence it? If I want to transfer additional information to the demand Record.

1 ACCEPTED SOLUTION

There's actually a business rule on the idea table that creates the demand:



Create Demand on Accepting Idea


var demandTable = "dmn_demand";


if(GlidePluginManager.isActive('com.snc.project_management_v3')){


  demandTable = SNC.PPMConfig.getDemandTable(current.getTableName());


}




var demand = new GlideRecord(demandTable);


demand.setValue("business_case", current.business_case);


demand.setValue("short_description", current.short_description);


demand.setValue("category","strategic");


demand.setValue("type", "project");


demand.setValue("submitter", current.submitter);


demand.setValue("parent", current.sys_id);


demand.setValue("idea", current.sys_id);


var dmnId = demand.insert();


demand.get(dmnId);


current.demand = dmnId;


current.stage = 'demand';


var link = ' <a href ="/' + demandTable + '.do?sysparm_query=number%3D' + demand.getValue('number') + '">'+ demand.getValue('number') +'</a>';


var message = gs.getMessage("Demand {0} has been created");


message = message.replace("{0}", link);




gs.addInfoMessage(message);


View solution in original post

7 REPLIES 7

xiaix
Tera Guru

Thanks, David, good information, however not explaining what's behind sysverb_insert


It doesn't?   So the second screen shot (UI Action - Submit) doesn't show the code?  


Looking at other UI Action(s), "sysverb_insert" is also used,   however with a different script



Table: Ideas , UI Action: "Accept"



current.state = '2';


current.update();


if (action.get('isFormPage') == 'true')


  action.setRedirectURL(current);


else


  action.setRedirectURL('/'+current.getTableName()+'_list.do');



This UI action creates a New Demand record and links that to the Idea record. The above script code does not reflect that.