How to update only one target field and ignore the other fields in Field maps (Transform Map)

Wiem Nabli
Kilo Sage

Hello, 

I have created onBefore Transform Script to update target fields in certain conditions for example : 

// If type is "A" & discovery is "B" --> Update only the target field discovery
        if (source.u_type == "A" && target.discovery == "B") {
            target.discovery = "A";
        }

When I test, I find that in the target record, all fields are updated but I want only the "discovery" field to be updated.

So how can I ignore the update of the other fields in the Field Maps section and only update one field "discovery" ?

Thank you

1 ACCEPTED SOLUTION

Abhijit4
Mega Sage

Hi,

There is only one way to achieve this, you will have to update target record in onBefore script and mark ignore as true.

Please try below script,

 if (source.u_type == "A" && target.discovery == "B") {
            target.discovery = "A";
            target.update();
            ignore=true;
        }

Let me know if you have any further queries.

Please mark this as Correct or Helpful if it helps.

Thanks and Regards,
Abhijit

View solution in original post

10 REPLIES 10

You can write that logic with script at field level (instead of on before script)