You need to sign in to do that
Don't have an account?
Dhairya
Recoed Owner Change
Hi,
In our application we are populationg one custom object from the webstore using api. Hence, all inserted records have same record owner but for the reporting purpose i need Account Owner name as the custome object owner name. We have two common fields.
How to resolve the issue?
Appreciate your help.
Thanks,
Dhairya
Does Account and custom object have a relation, If so you can write a before insert trigger on the custom object to update the owner field.
As you inserting date from sites so all records will have same owner thats the site guest user. If ayou want to have some different owner name then you have to write a trigger on before insert of records , where if the ownerid is guest user's id then replace it with the ownerid you want. Now in this case if you will replace it with any particular owner then it will be only single owner. So I would suggest to assign owner id in trigger based on some input that user provides on site register page.
Thanks for your replies.
(1) I do not have any relation between Account and Custom Obj.
(2) I tried to use before insert trigger but it failed.
Thanks,
Dhairya
Shashikant thanks for your reply,
webstore data populated into SFDC via API. So, here all inserted records have single owner. I want Account owner as a recoed owner based on one common field between both Account and custom object. I do not know how to write trigger for that.
thanks,
Dhairya
Could you please provide your trigger code and the exception that you got.
Hi Shashikant,
Sorry, last few months enggaged in other work and missed this piece for a long time.
Here is a trigger (daily usage object populated from the webstore and record owner name remain same for all records bcoz inserted using WSDL)
Class :
Now, we have to change record owner name as per account owner. (Daily Usage Name is always one of the Account name)
I really appreciate your help.
regards,
Dhairya