You need to sign in to do that
Don't have an account?
SteveA101
Workflow to create a record
Hi All,
Is it possible to have a WFR create a record on a different object? My gutt tells me this is a trigger, but thought I'd check with the experts first!
Thanks!
Create a Trigger on Candidate Object. When the Candidate record is updated by setting the Hired checkbox to true, you create a new Partner Account record. You are initially adding all the partner accounts created to a list and then bulk adding them and the end.
Hope this helps.
Regards,
Satish Kumar
Please mark my answer as a solution if it was helpful so it is available to others as a proper solution.
If you felt I went above and beyond, please give me Kudos by clicking on the star icon.
All Answers
I think the route is "Trigger"
In case you want to minimize custom codeyou can put some logic for firing of trigger in WFR and put code of creating object in trigger.
But one can urgue that when one is writing a trigger why then write a WFR too, may be to reduce coding and build a more robust system :)
Do let me know if this answers your question.
Have a great day!!
Thanks and regards,
Hope this helps!
Regards,
Satish Kumar
Please mark my answer as a solution if it was helpful so it is available to others as a proper solution.
If you felt I went above and beyond, please give me Kudos by clicking on the star icon.
Hi. Thanks for the quick response. The object that I would like the record created on will already exist. Basically we are looking to use a Recruiting app, and when the Partner gets 'hired' (the Partner record is on the Candidate object), create a record for them on the Partner Account.
The trigger would be a simple before insert trigger.
Regards,
Satish Kumar
Please mark my answer as a solution if it was helpful so it is available to others as a proper solution.
If you felt I went above and beyond, please give me Kudos by clicking on the star icon.
Understood. Thanks!
Anyone happen to have any sampe code for something like this to get me started?
Create a Trigger on Candidate Object. When the Candidate record is updated by setting the Hired checkbox to true, you create a new Partner Account record. You are initially adding all the partner accounts created to a list and then bulk adding them and the end.
Hope this helps.
Regards,
Satish Kumar
Please mark my answer as a solution if it was helpful so it is available to others as a proper solution.
If you felt I went above and beyond, please give me Kudos by clicking on the star icon.
Fantastic. Thahks so much Satish!!
trigger HelloWorldTrigger on Book__c (before insert) {
Book__c[] books__c = Trigger.new;
Copy[] Copy__c = new Copy__c();
integer a=0;
Copy[] Copy__c = new Copy__c();
for(b Books__c : Book__c)
if (b.status=true)
{
SingleCopy Copy__c = new Copy__c();
SingleCopy.name="test";
SingleCopy.status="true";
}
Copy[a]=SingleCopy;
a++;
insert Copy;
}
Hope this helps
Thanks