function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
punit.theikospunit.theikos 

updating reference fields in objects

Hi,

I want to update the reference fields (e.g. in Opportunity object field AccountId). It is giving me an error saying that AccountId field cannot be updated.

Do we need to delete and create the related objects in case we want to change the reference id or there is some better way out?

Thanks

Punit

 

punit.theikospunit.theikos

Has any one tried updating reference Ids in salesforce?

Any help would be greatly appreciated.

Thanks

Punit

ScotScot

Hello Punit,

You should be able to update reference fields. Your example ... updating the account id for an opportunity ... can work. 

Possible problems ...
     > user not having rights to update one of the involved records
     > a bad new reference value (one you don't have access to)

To verify that the update should work:
     Use the sforce explorer (on sourceforge), drill down to
         Opportunity / Fields / AccountID / Access
     and you'll see it has create-able, filter-able, nillable and update-able.

Scot