You need to sign in to do that
Don't have an account?
Juul
Copy a field from account to event
Hi,
I've tried to create a workflow to copy the field accountstage (invisible for users, just for reporting) to a new event. But this is not possible unfortunately.
Is it possible to create a trigger only on event creation that copies the field accountstage to the custom field Accountstage on event? Does anyone have an example or an idea, triggers are not my specialty :)
Yes you can write a trigger to copy the field from Account to your event.
You also need to make sure that you trigger runs only when an event is created for account and not for other objects.
Thanks Prakashb, do you have an example to copy a field from one object to another object?
I Agree with prakash,
To give more insight on how I might go about it is,
Create a trigger on Events, and when the AccountId on event object is not null, I'd Query the corresponding field from the account and use it to store the value on to the event
you could take a look at the Event fields here
Best practices for writing Triggers (from Jeff Douglas's Blog)
Hope i did'nt convolute it too much. and it helped.
Do mark this as answered if it helped you solve your problem.
Happy coding!
Thanks for the reply. I've got some help. The trigger is working without the test class.
trigger:
But having some problems with the test class. Can someone please help me?
I saw this in an example.... I receive a compilation error: Compile Error: expecting right curly bracket, found 'insert' at line....
Can you perhaps help me in the right direction?
thanks