Skip to main content

Hi,

 

I just wanted to pass along a lesson learned with picker controls that may save people time searching for a resolution. 

 

We had a smartform in 4.6.11 that used a picker control on a text field that read a lookup table looking for a title.  Normally we would have stored the numeric identity field in the transactional data and used that as the field in the picker control.  But for this specific process we stored the text title in a transaction table for ease of use and future reporting so the control was defined with the text field.

 

The majority of the time when we would load our tranactional data into the form, the picker control would resolve without any issue.  However we were a few titles that just refused to resolve.  The value was loaded using the search on the picker control and it was saved in the database.  It just would not display when the form was loaded.  Both the lookup table and the transaction table had the field defined as varchar in SQL server.

 

What we found was the lookup table that stored the title for the picker control had a trailing space stored.  When yo selected the item from the picker control the trailing space transfered to the form and was resolved.  The trailing space also passed through the create and update smart object calls to the transactional data table. 

 

When the transactional data was reloaded it refused to resolve because of the trailing space.  As soon as we went into the lookup table and removed the trailing space from the title, our transaction data that still contained a trailing space started resolving and displaying in the picker control.  

 

To permanently resolve the issue, our admin form for the lookup table was changed to create an expression to trim the title.  The expression was then used in the create and update methods of the smart object.  That prevented us from ever hitting the problem again.

 

Hopefully this helps.

 

 

 

          

Be the first to reply!

Reply