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
SIB AdminSIB Admin 

How to create an automated activity for whoever is listed in the primary sales rep field when the stage picklist has the value "Closed/Won"

Hi,

I have a custom object.I have two fields, SIB Sales Rep(Contact lookup field) and stage(picklist).I want to create an automated activity for the person listed in the "Primary Sales Rep" field when the stage picklist has a value "Closed/ Won".I know this can be done by writing apex trigger.However, I am new to apex code.If somebody could help me with the code, that would be great.

Thanks
Raj VakatiRaj Vakati
Hi SIBAdmin, 
You can create a thought process builder. Please see here below similar one 
User-added image
User-added image
 
SIB AdminSIB Admin
Hi,

Thanks for replying back.And my bad.SIB Sales Rep is a user lookup field.I wrote a process builder but it does not seem to work.
User-added image

Assigned to ID   Has value
 [LED Lighting_Opportunity__c].SIB_Sales_Rep__c.Id

Let me know what am I doing wrong.
SIB AdminSIB Admin
I tried using Formula too in the type field for "Assigned To" ID but did not work.Please help.
SIB AdminSIB Admin
User-added image
Raj VakatiRaj Vakati
Assigned to ID is a lookup to the user . and use Name ID(Who) to Contact Id  
SIB AdminSIB Admin
Thanks for replying back.I am not sure if I understood the solution to this.
SIB AdminSIB Admin
ok so looks like user Id worked but the tasks/activities does not appear under that particular account but does appear in task assigned report.How do I make it appear in the activities list under account.