I have a related list that i have created myself. And there is a button which contains a URLFOR($Action.New) of said object. I am trying to fill the input box on the next page with a stuff with its parent page. However it works perfectly fine when it is in default pages. But when i change to visualforce, it now generates input ids like j_id0:j_id3:j_id4:j_id8:LoanID

This is now causing the $action.new not to work. I am trying to just fill the input with the data from the previous page, but this new id structure doesn't work.

<apex:commandbutton value="New Interest Rate" action="{!URLFOR($Action.InterestRate__c.New,null,['saveURL'=URLFOR($Action.Loan__c.View, Loan__c.id), 'j_id0:j_id3:j_id4:j_id8:LoanID'=Loan__c.Name])}" />

Is there anyway to strip it out. I have tried delimiting it with \\, to no avail. Is there anyway to achieve what i want. To fill a new pages input box.


You can't use this kind of URL hack to pass values to Visualforce pages. It only works with standard pages. If you want to pass values to a Visualforce page, you'll need to update your controller or controller extension to get the parameters and add them to the record.

String LoanId = System.currentPagereference().getParameters().get('LoanId');
  • Yeah this doesn't seem to work when passing through pages of different controllers. I cannot retrieve the Loan ID value through pages. – James Mar 11 '14 at 15:27

Why do you even want use this structure in VF page?

If you already use VF page create method to populating new record in controller and pass any required value in URL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.