I have an object called A which maintains the relevant details of that object and it is related to another object called B. the field which is relevant to object A is present in object B. When that field in object B is entered i want the corresponding fields from object A to be auto fetched in object B. How is it possible? How can i perform this.? Your ideas pls
Share
If you’re fine with it happening in background (once user saves the changes) then your best option would be simply a formula field on Object B that has syntax similar to
Object_A__r.Needed_field__c.If it has to be automatic but allow users to override the values later – read about workflows and field updates in the online help. Rule could be “
ISNEW() || ISCHANGED(Object_A__c)” and the actions would be field updates that get data from new selected A and fill it on B.In case of more complex logic – trigger on B might be needed.
But if you want it to be really visible in realtime (user picks an A record in the lookup, values change right on the new/edit page, he picks another A, values change again) – you’ll have to build some Visualforce I’m afraid. There’s an answer to similar question on Salesforce Stack Exchange that should get you started.
Whatever you’ll decide to go on with remember that first options are less intrusive. Sure, it will be not as flashy and cool for your users, but it will be reliable, easy to maintain (configured just with clicks, no code) and will work even if you’ll later have to perform mass data load/update with external tools for example.
Visualforce Page for creating/editing will look nice but mass updates will bypass it and you’ll need to maintain this page every time you add a new field because it will be hard to reuse standard page layout.