The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Is it possible to copy custom fields from "demand" to project ?

ammar_k
Tera Contributor

Hello, 
we've added some custom fields to pm_prject, and added the same fields ( same names) to the demande table.
is it possible to copy those fields from demand to project while using the ui action "create project" ? 

thank you

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@ammar_k 

there is no property etc which controls this.

the fields to copied are hard-coded and not controller from system property

2 ways

1) update the OOTB script to add your custom fields

AnkurBawiskar_0-1758626570027.png

 

OR

2) use before insert BR on project table to set your custom fields from Demand (Recommended way)

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

4 REPLIES 4

Anand2799
Giga Guru

Hi @ammar_k ,

 

OOB there is no property defined which you can use to copy additional values, however you can create a before BR on project table, glide record demand record and set the required fields.

 

Thanks

Anand

Brad Bowman
Kilo Patron
Kilo Patron

In the out of box UI Action you can do this within the if block that starts on line 21.  Just add a line for each field, followed by an update on the GlideRecord using 'current' to refer to the demand record from which the UI Action was executed, and 'project' to refer to the newly created project record such as:

project.u_field1 = current.u_field1;
...
project.update();

You can also / instead create a Business Rule on insert of the project table to do something similar.

 

Ankur Bawiskar
Tera Patron
Tera Patron

@ammar_k 

there is no property etc which controls this.

the fields to copied are hard-coded and not controller from system property

2 ways

1) update the OOTB script to add your custom fields

AnkurBawiskar_0-1758626570027.png

 

OR

2) use before insert BR on project table to set your custom fields from Demand (Recommended way)

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

M Iftikhar
Mega Sage

Hi @ammar_k ,

You can’t achieve this with configuration alone the out-of-box Create Project only maps standard fields. The cleaner approach is to add a before-insert BR on pm_project that queries the source demand and sets your custom fields, so you don’t have to modify the OOTB  UI Action.

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.