Unanswered: Selecting and opening a record from a dropdown
Can anyone help me please?
I have a form with a product field [ProductName] on it but there are lots of products in the folder to search through.
I thought it would be easier if I used a drop-down list [ProductSearchName] to select the product I'm looking for and then go to that record automatically. I created a drop-down based on records from the folder and then executed a script on edit to select and move to the chosen record. I used "Select Record by Rule and then [ProductName] = [ProductSearchName] (Ive omitted the rest of the code generated in the Rule here).
I then refreshed the Field [ProductName] but it doesn't work.
I know I'm missing something here and its probably blindingly simple and stupid but can anyone help me please?
That works for me on testing. You do have to make sure you specify the correct folder where the record to be located is when defining the "Select Record by Rule". It needs to be the actual folder as far as I can tell, can't be a parent folder. My example was like this:
Select Record By Rule (FOLDER_WITH_RECORDS, FORM_NAME And ([ProductName] = [ProductSearchName] of selected "FORM_WITH_DROP_DOWN"))
Ive got it now. It was the last part I was missing - either that or I did something else wrong when I was trying it.
Ive noticed that the drop-down list sometimes retains the selected value of the previous search even although the correct record has been returned by the search but the next time, the drop-down goes blank when it finds the correct record and when I select the drop-down again, it defaults to the bottom position of a very long list.
I tried refreshing both fields but it doesn't change anything. Any ideas?
The main thing is that it now works so thank you for pointing me in the right direction.
That behaviour seems to be a feature of drop down lists based on a folder. It always defaults to a blank item at the bottom of the list. That's why I've been trying to find a way of addressing the contents of that list so you could say select the first item or a specific item. But there doesn't seem to be a way.
I found a work around for the drop-down list defaulting to the blank record at the bottom (I think).
Its not very pretty but it is stupidly simple - I just set the drop down field value to equal the field value I just set using the drop-down - if that makes sense!!!
In my case, I have a lot of entries at the bottom of the list that will either be deleted eventually or will seldom be used and it was a pain having to scroll back up through the list every time (Lazy I know).