Script to copy the values from demand to project form using UI Action

shallumittal
Tera Contributor

I have a requirement to create a project from demand form and also to copy the values from demand to project form.

I have checked "Create Project" UI Action but unable to add customized field script to get values. I also tried the script similar to "Create change" or "Create Problem" but we need same functionality of "Create Project" UI Action.  

It would be great help if someone guide me how to do scripting for this.  

Thanks

1 ACCEPTED SOLUTION

venkatvraman17
Kilo Guru

DemandToProjectCreationHelper Script include takes care of creating a Project from a Demand object and population all the items from Demand to Project. You can either update that Script Include or create a custom script as per dvp to populate the information on the project from the UI Action.


View solution in original post

6 REPLIES 6

@Vaishnavi35 
Please follow below steps to copy demand fields to project without making any changes to OOB Script Include : DemandToProjectCreationHelper. ( keeping future upgrade in mind so that it doesn't generate skipped logs)

 

1. Create before insert BR on pm_project with condition demand changes.

2. PFB script (replace the backend name of your custom field to be copied)

 

var refDmd = current.demand.getRefRecord();

current.u_sponsor_guid = refDmd.getValue('u_sponsor_guid');

 

This will copy demand field value from demand to project without making any changes to OOB Script Include : DemandToProjectCreationHelper.

P.S: Please mark helpful, if it works for you.

Manal  AQUIL
Tera Contributor

@shallumittal 


Please follow below steps to copy demand fields to project without making any changes to OOB Script Include : DemandToProjectCreationHelper. ( keeping future upgrade in mind so that it doesn't generate skipped logs)

 

1. Create before insert BR on pm_project with condition demand changes.

2. PFB script (replace the backend name of your custom field to be copied)

 

var refDmd = current.demand.getRefRecord();

current.u_sponsor_guid = refDmd.getValue('u_sponsor_guid');

 

This will copy demand field value from demand to project without making any changes to OOB Script Include : DemandToProjectCreationHelper.

P.S: Please mark helpful, if it works for you.