UI field set from url parameter

  • 1
  • Problem
  • Updated 2 years ago
  • Solved
I have a "search" model with a UI text field where the user inputs the text they want to search from.  Sometimes, based on the source where the user enters this page from, the search string is passed over using a URL parameter.

My url parameter is 'djnum' and the model doesn't query on page load, and creates a new model if none is found.

My problem is that the UI field always is populated with the parameter name itself - not the value, and not a NULL if the parameter is not found in the url.

In this example,url parameter djnum='test' so I would expect to see 'test' in my text box, not djnum.

Any ideas on this one?
Photo of Chandra V

Chandra V, Champion

  • 7,270 Points 5k badge 2x thumb

Posted 2 years ago

  • 1
Photo of Peter Kong

Peter Kong, Employee

  • 472 Points 250 badge 2x thumb
Hi Chandra!

I believe this is because we are using a UI-Only Field - if you try with Description__c (another String based field that's actually connected to SFDC) the desired affect will be achieved... I'll have to look into why this is the case. 

- Peter
Photo of Chandra V

Chandra V, Champion

  • 7,250 Points 5k badge 2x thumb
You are right, it works fine with a normal model field.  I don't understand why the UI field pulled the parameter name into the field, but I switched it over to a standard field in order to keep moving forward.  Thanks for the help.