Create Employee Object ( Relation :Look up to Account) When we will create Event Record with Condition (Event Status = Closed) and once we click on save ,it should create Employee record automatically.. please can anyone send me code? please its urgent.. - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Rhea SamuelRhea Samuel 

Create Employee Object ( Relation :Look up to Account) When we will create Event Record with Condition (Event Status = Closed) and once we click on save ,it should create Employee record automatically.. please can anyone send me code? please its urgent..

Need Urgent help. 
 
Nitish SinghalNitish Singhal
Under which object are you trying to create Event record? 
Rhea SamuelRhea Samuel
hI NISTISH,

Account object it is.


Thanks for the response,
Rhea SamuelRhea Samuel
This is complete scenario,

Req: one custom object: Test...which has lookup relationship with Account object.
So now as we know in Account related list:> open Activities> we can create new event.
so on creating new event, wherein if status is Closed...that same record should automatically create in test object.

So now as we know in Account related list:> open Activities> we can create new event.
Nitish SinghalNitish Singhal
Ok.. then you can create a process builder on event object, and check the condition that if status = closed. 

Then in action, you can choose 'create a record' option and enter the object name as employee. While choosing the value for fields, choose employee.AccountId = event.whatId

please try.

regards
Nitish SinghalNitish Singhal
Ok which is parent? Employee or Account?? 

 
Rhea SamuelRhea Samuel
Hi Nitish,
yes but employee object dosent come..it asks for record type where employee object option are not coming.:(

Rhea
Gerry SyjongtianGerry Syjongtian
Same question as this - https://success.salesforce.com/answers?id=9063A000000l3JyQAI
Rhea SamuelRhea Samuel
Employee is parent.

Thanks ,
Rhea
Rhea SamuelRhea Samuel
Hi Gerry,

Could you please help me on this...i already went through the question and solutions you ahve posted on above link..
could you please help me on the same step by step
Nitish SinghalNitish Singhal
Ok if employee is Parent, Account is child, and you want that when you create a event with closed status, the same event should also create under employee record as well?? Correct? 

If yes, then same process builder with action as "create a record" and choose event as the object type. While filling in field values just copy everthing from the current event record, and change the relatedTo/whatid to event.Account.Employee

hope this helps, please try
Rhea SamuelRhea Samuel
yes sure. 
will let you know.

Thanks.