How to create demand from request change form in PPM
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2023 07:52 PM
I need to create a demand from request change form of project management. I need demand information to be pulled from request change form.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2023 09:57 PM
HI @Zuri ,
I trust you are doing great.
Create a new Demand record:
- Use the ServiceNow API or script include to create a new Demand record.
- Set the necessary fields such as title, description, priority, and any other relevant information.
Pull information from the Request Change form:
- Retrieve the required information from the Request Change form.
- Identify the specific fields or data you need to populate in the Demand record.
Map the data from the Request Change form to the Demand record:
- Use JavaScript or Business Rules to map the data from the Request Change form to the corresponding fields in the Demand record.
- Make sure to validate and transform the data as required.
// Assuming you have retrieved the Request Change form data in the 'requestChangeData' variable
// Create a new Demand record
var newDemand = new GlideRecord('pm_demand');
newDemand.initialize(); // Initializes the new record
// Map the data from the Request Change form to the Demand record
newDemand.setValue('title', requestChangeData.title);
newDemand.setValue('description', requestChangeData.description);
newDemand.setValue('priority', requestChangeData.priority);
// Map other relevant fields accordingly
// Save the new Demand record
var demandSysID = newDemand.insert();
// Optionally, you can redirect the user to the newly created Demand record
var demandURL = '/pm_demand.do?sys_id=' + demandSysID;
gs.addInfoMessage('Demand created successfully. <a href="' + demandURL + '">Click here</a> to view it.');
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi