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

Transform Map not updating existing Project Task records

Community Alums
Not applicable

Hello All,

I have created transform map to update existing Project Task records. A few things I did:

1. Field Map: Didn't work. Always create new Project Task records never update the existing records. Given below script

 if(action == 'insert'){
         ignore = true;
 } 

Its stop creating the new record but didn't update the existing records.

2. Transform script: Didn't work 

        if(target.wbs == source.u_wbs){
            target.assigned_to = source.u_assigned_to;
            target.u_percent_complete = source.u_actual_work_percent_complete;
            target.u_actual_percent_complete_apc = source.u_actual_work_percent_complete;
            target.work_effort = source.u_actual_effort;
            target.u_critical_activity = source.u_critical_activity;    
        }    

It always creates a new records which I don't want. I know when I give below script in OnBefore or in above script it didn't create the record but it will not update the existing record also.

 if(action == 'insert'){
         ignore = true;
 } 

So help me gurus.

Thanks,

MK

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Thank you @Aman Kumar  and @Ankur Bawiskar  for the feedback, help and prompt replies. Instead of project field I have used top_task as coalesce field. In my transform map I have used 2 coalesces WBS and top_task. It is working fine with this. 

View solution in original post

13 REPLIES 13

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

please add your complete script in onBefore script and not in transform script section

regards
Ankur

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

Community Alums
Not applicable

Hi Ankur -

This Didn't work. The records were ignored. Attached script image. I have kept the Field Map fields too. Let me know if any changes are needs to be done at the Field Map level.

Thanks!

Community Alums
Not applicable

Project is Composite field in pm_project_task table. If I try to query from List I need to give contains to find the record. Also, sub_root_tree, top_task columns have value but it didn't fetch when I try to query from list view more.

Community Alums
Not applicable

Thank you @Aman Kumar  and @Ankur Bawiskar  for the feedback, help and prompt replies. Instead of project field I have used top_task as coalesce field. In my transform map I have used 2 coalesces WBS and top_task. It is working fine with this.