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
arvinarvin 

Update look-up field dynamically-Reg.

How to update the value of a lookup field dynamically based on a value on some other field/based on the value of some other field in some other object ? Please help if any one is aware of this....
dev_jhdev_jh

Hi Arvin,

 

Can you explain in more detail what are you trying to achieve and with what methods? (Visualforce, Apex, ...). That would help...

arvinarvin

The thing is I have an object A, object B. The relation between them in (1:n). The lookup field in object B has the value of object A(say Name of the object). Here Object A is Release object and Object B is Item object. Each Release has several Items. Now I want to add some Items to another release without updating the look-up field in Item record which holds the Release name. Got it ?

arvinarvin
I am not using apex or visual force. Till now I am using only the point-click tools.
dev_jhdev_jh

Not sure. Are you saying that the same item you want to link to another release? (ie: the same item can be in more than one release?). If this is the case, what you need is a N:N relationship. For this you need an additional object that related the items with the releases.... If I missunderstood, please clarify

 

J

sandeep3385sandeep3385
I think you can use workflow action to update a field based on the value of some other field in the same object.
arvinarvin
Sorry I failed to mention that I have a third object also. There I have two look up fields one for Release and one for Item. Now my requirement is to have an Item in only one Release. I mean to move the Item record from old release to new release. It can be done by updating the lookup field(release) in Item object. But that has to be done dynamically when I choose the Item and a Release to relate that item through the layout in my third object. Say I choose Item no. 2(which is already in Release 1) and choose Release 2 through the layout in my third object, The item no.2 has to be only in Release 2 but not in Release 1.
dev_jhdev_jh

Hi Arvin,

 

Sounds to me like your third object is the one that hosts the N:N relationship. In this case, you don´t want a lookup on the item to the release, you have it through this object.

 

Although on the other hand if your constraint is that an item can only be in one release you don´t really have an N:N relationship and could do without that object that relates them and just have the release and item objects. The item links to the release and when the item "moves" to another release you just update the lookup there.

 

I think there is a flaw in your data model somehow. I would go back to the drawing board and see if I can change / tweak something....

 

J

arvinarvin

Hi dev,

I can understand your statements. But my requirement is like this. 1. Adding a new Item to a release

2. Adding an Item which is already present in a release to a new release and this has to be performed in the same layout of adding new item(may be in different sections).

So I have another object(third) which adds an Item which is already present in a release to a new release.

If there is anyother way to meet my requirements please suggest me...

arvinarvin

Hi dev,

Tell me onething. Is there any way to update a look-up field through workflow rules ?

dev_jhdev_jh

Hi Arvin,

 

I have never had a need to do this and by the looks of it workflow does not allow you to update these type of fields (eg: you can´t change the account on an opportunity via workflow).

 

J