+ Start a Discussion
shweta kumari 25shweta kumari 25 

How to map objectB record to object A record

I have 2 custom objects i.e obA and ObjB.

ObjB is a lookup to objA.

ObjA  has fields as : Name , f1 , f2 , f3 and f4  (all type=text)

ObjB has only one field say name: ; values like ProductA , ProductB , ProductC etc.

Now I am creating a new record in custom object ObjA, so I will select ProductA, so when I select ProductA it should show only the fields f1 and f2.

similarly I create another record in custom object ObjA, so I will select ProductB, so when I select ProductB it should show only the fields f3 and f4.

How to achieve this functionality?

My though process is like create recordtype on ObjA , recordTypeA map to fields f1, f2 etc

alternatively, I thought of having a counter variable in objB for every product added. Then in a visualforce page when I select ProductA then I will reRender a pageBlock wich shows fields f 1 and f2 only.

I require some urgent input on this scenario; I request forum members to come up with their though process and eloborate whereever required.

I hope I am clear.

Thanks
shweta