Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jcampbell474
Creator III
Creator III

OnOpen Trigger Work-Around w/Bookmark

I need an app to open to the last loaded year and month.  Variables created in the load script contain these values.  When using OnOpen triggers in the desktop client, it works every time.  However, it doesn't work in ajax.  I've viewed many threads regarding this and called QV support - who confirmed it.  So, I need to create a bookmark to handle the task.

Again, I created two variables in the load script to get the year and month I need.  Using the listbox Search and Advanced Search features with these variables, I cannot get the right values selected. 

My two variables are: 1) vcFY 2) vmaxFM

vcFY = 2016

vmaxFM = 7

I've entered them as ='$(vcFY)' , =$(vcFY), =vcFY, etc...  It simply selects every year.  Should variables used in the search be formatted/applied differently?

Thanks!

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try something like

=Year='$(vcFY)'

View solution in original post

5 Replies
swuehl
MVP
MVP

Try something like

=Year='$(vcFY)'

jcampbell474
Creator III
Creator III
Author

It works now!  Thank you!!

Seems kind of odd that the OnOpen Trigger does not work to select a value in a field, but works to apply a bookmark.

Anyway, again, thank you.

dzmitry_shmurye
Partner - Creator
Partner - Creator

Hi Jason, Is it really works for you?

It doesn,t work for me.

I create 1 var in the load script vCurrMonth = OCTOBER for example.

Then I write search expression for the listbox = Month='$(vCurrMonth)' and the correct vallue selects in the filter.

Then i create bookmark, but when i reload my app and vCurrMonth changes My bookmark apply the old saved value:(

Could you please share me you example if it is possible or help me resolve my problem?

Why bookmark save field value but not the search string?

I did small example is attached.

Thanks in advance!

jcampbell474
Creator III
Creator III
Author

I added the bookmark to the document OnOpen trigger and tested.  It works, but I've found this feature/function to be rather delicate.  Reload the document with a different month, then apply the bookmark in the listbox search field (= Month='$(vCurrMonth)') bookmark it and note the bookmark name, enter the bookmark name in Settings > Document Settings > Triggers >  Document Event Triggers > OnOpen > Add Action > Bookmark.  Save the document and reopen.  It should work.

MariaLopez
Contributor
Contributor

Did you solve it? Because I have the same issue.