Related list generated from values to be sent to another form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2024 03:10 AM
Requirement - We need to add Change request section on Project form . Then, on clicking the "NEW" button, Change form will open and some values from Project form needs to be auto populated to Change form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2024 05:12 AM
What do you mean by 'change request section'?
Just create a new ui action 'create change' on the project table, if not yet available. Have it put your required information in there (see below as example).
You can put a related list on the project form to show all changes (and vice versa) if you also create new fields on the tables to contain the reference to each other.
var changeGR = new GlideRecord('change_request');
changeGR.initialize();
changeGR.setValue('short_description',current.name); // current being the project
changeGR.setValue('type', 'normal');
changeGR.setValue('cmdb_ci', current.cmdb_ci);
etc.
etc.
var sysId = changeGR.insert();
current.u_change_request = sysId; // if you create a 'u_change_request' field on the project table as reference
current.update();
Or you can do the same automating it, through a flow.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2024 11:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2024 11:40 PM
If you click on new, a new change will be created with the parent field filled with the project. You could use a client script to populate the values.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2024 11:47 PM
Thanks for the quick response Mark.
Could you please help me with the script as I am unable to get the how would I link the new button on Project form to Change form with the dynamic values.