Tuesday, 8 April 2014

Dynamic Look-up of all Objects, To Make Your Life Easy #Salesforce

Some days ago, I got an requirement of mass updating, everything was just fine but got stuck at Dynamic look-up, where I need to make a single look field but if user want to that he can change it to the another Objects look-up and save the record.

That means if I want to create a single look field having dependent on another picklist of Object Names,
If user selects Account Object, then our look-up field will pop-up the records of Account object.

But if user change the Object in the picklist and now he selects Contact object, then our look-up field will pop-up Contact records.

Here is the Snapshot for more understanding.

When you chose Account

And when you chose Contact from the picklist

Then your pop-up window will show me Contact records

The code is so simple but I just like the functionality so I thought to post it.
Hope some of you will like it.

Here is Controller Class "DynamicLookupController"

Visualforce Page "DynamicLookup"

Happy Coding..!!!! CHEERS


2 comments:

  1. seriously u got an requirement of mass updating.......

    ReplyDelete
  2. This is really good coding!...and very useful..!
    Thanks Abhi, :)

    ReplyDelete