The CreatorCon Call for Content is officially open! Get started here.

How to copy Demand fields to Project fields

Michael Bachme1
Kilo Guru

When a Project is created from a Demand, how do I copy the Business Case field on the Demand table to the Description field on the Project table?

So far I've copied the Demand Business Rule, "Create Strategic Type on Approve" and added the bolded line but it doesn't seem to work:

function createNewProject(){

  var project = new GlideRecord("pm_project");

  project.initialize();

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

  project.setValue("description", current.business_case); //copy DMND business case to PRJ description

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

Thoughts?

27 REPLIES 27

dvp
Mega Sage

I highly suggest you not to use the parent field for relating demand and project.



even if you use it, the parent field will not be populated as in there is a rule to not to populate the demand info in parent field


I'm not understanding the logic behind why this isn't recommended. Isn't the parent field supposed to specify which record generated the PRJ? In this case the Demand?


Add parent field on the project form and try to related a project to a demand manually. You can't, as there is reference qualifier that is filtering the demands



Here is the reference qualifier in dictionary override


javascript:var util = new ProjectManagementUtils(); util.parentRefQual();




The reason is in project there are roll up calculations that are done using the parent field, which is why in OOB there are trying to avoid relating demand and project using parent field.


So how do we know what Demand a Project came from?


Simple solution is to Create a custom field referencing the demand table and populate it..