+ Start a Discussion
NOTLSimpsonNOTLSimpson 

manually editing data

Hi -- I have a custom object, Rev, which is a child of Opportunities and it needs to refer back to the Account that owns the Opportunity. My concern is that there are a whole bunch of Rev components that don't have the Account info populated, and I want to find a way to say:

 

If Rev A belongs to Opp B, and Opp B is owned by Account C, then populate Rev A's accountID field with Account C's ID.

 

Does anyone have an idea of how to do this?

 

sornasorna

I think you can simply create the Account field on Rev as a formula field and use cross object formula like: Opportunity__r.AccountId... this will populate the field for all the existing data as well...

NOTLSimpsonNOTLSimpson
Thanks -- I thought there should be something like that -- I'll try it.
sornasorna

just now i saw your other post...if you want the Rev to show up as a related list on accounts...then you cannot use formula fields...instead create a look up for account on Rev and populate using a workflow or a trigger....

NOTLSimpsonNOTLSimpson
Yes, I just ran into that when trying your first idea. I'll see if I can create a trigger that auto-pops it.
NOTLSimpsonNOTLSimpson

It appears that Workflows don't allow you to do a field update to a look-up field. Is that correct? I can try to create a trigger for this. Thanks!