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
Sam.arjSam.arj 

inputField does not automatically read the Url parameters in VF

I am writing a VF page that replaces the Edit/Page page of my custom object (A). Edit and New buttons are overrided to show my VF page.  (A) has mater-detail relationship with Custom object (B).

When i click on custom object (A) List Button "New" from Custom Object (B) detail page following Url is produced:

/a03/e?CF00N700000028JuA=Custom+Object+A+Name&CF00N700000028JuA_lkid=a007000000A7Rc1&scontrolCaching=1&retURL=%2Fa007000000A7Rc1

a007000000A7Rc1 = this the Custom Object A ID.

And my VF page is lunched properly but the inputField which is hooked to Custom Object (A) is empty!

Any idea how i can fix this?


ESES
You can accomplish this with the help of an apex extension (assuming that you are using standard controller). You can check the instance of standard controller to see if you are editing or creating a new record (for example see if id field has a value or not). Once you determine this. you can read the request params and update the fields in the SObject standard controller is using accordingly.
Sam.arjSam.arj
Thanks Emad,
That was actually what I thought of myself but the point is I did not find any documentation on these URL parameters to understand how they work.

CF00N700000028JuA=Custom+Object+A+Name&CF00N700000028JuA_lkid=a007000000A7Rc1

for example the "CF00N700000028JuA" is the parameter name for the SObject name field and "_lkid" is added to it to make the ID parameter.
But how can put this into a program this so that it would work all the times?


Ron HessRon Hess
These fields do not represent an API, please do not use them to drive the functionality of your app or any Visualforce page, they could change at any time.
Sam.arjSam.arj

So what do you have any suggestions for me? Is there any other way to resolve this problem?