function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Katherine RoweKatherine Rowe 

Trigger for data.com records only

I am writing a trigger for Accounts that I only want to run when the Account is created via data.com, as opposed to: the user through the GUI, the user through API.

How can I write my trigger to detect whether the account is coming from data.com or not? Is there a "best practice" way of doing this?
SwarnaSankhaSinghSwarnaSankhaSingh

Hi Katherine,

On the user record, you have a boolean field API named UserPermissionsJigsawProspectingUser which if the only indicator on whether the user is allocated a Data.com user license (value is TRUE) or not (value is FALSE). The Data.com user license lets the user add Data.com contact and lead records to Salesforce in the supported editions.

I hope this answers your question; please do let me know how it works out for you.

If you feel that your question was answered then do flag the answer as the solution to your query.

Kind Regards,
Swarna.

Katherine RoweKatherine Rowe

Swarna, 

But if the user has a data.com license but is creating an account manually... then I don't want the trigger to run. I think if I simply use "UserPermissionsJigsawProspectingUser" then it would run for manually created accounts as well?

What about the field "Data.com Key" (api name is "Jigsaw"), I could use that, right?

Katherine RoweKatherine Rowe
And what about updates (which would be clean, not prospector. How can I make my trigger distinguish between an account from data.com (1) that is being updated by data.com through Clean, and (2) that is being updated manually, through the API, a workflow rule, etc.