Page 1 of 1

How to retrieve filter in edit form

Posted: Wed Apr 25, 2018 9:21 am
by Timo
There's a run button that opens a browse form with a given filter (e.g. Google)
filter_run.png
While the browse form is open, the filter can be retrieved with nuCurrentProperties().filter
Then I set a Hash Cookie with nuSetProperty:

Code: Select all

if (nuFormType() == 'browse') {
   nuSetProperty('project', nuCurrentProperties().filter);
}
When a record is selected from the browse table, the edit form is shown. Now I'm trying to get this hash cookie with nuGetProperty but it gives me an empty result.

Code: Select all

if (nuFormType() == 'edit') {
   alert(nuGetProperty('project'));
}
What I'm trying to get is the filter of the browse form while the edit form is shown. Or is there a method like previousForm.filter ? (the previous form would be a reference to the browse form)

Re: How to retrieve filter in edit form

Posted: Wed Apr 25, 2018 10:19 am
by toms
Hi,

sessionStorage.setItem(), sessionStorage.getItem() should do the job, unless there is a better way, of course.

Re: How to retrieve filter in edit form

Posted: Thu Apr 26, 2018 1:25 am
by admin
Timo,

Try this...

Code: Select all

nuFORM.breadcrumbs[nuFORM.breadcrumbs.length - 2].filter

Steven

Re: How to retrieve filter in edit form

Posted: Fri Apr 27, 2018 5:34 am
by Timo
thanks guys, both suggestions work :D I'll go for Steven's solution

Re: How to retrieve filter in edit form

Posted: Fri Apr 27, 2018 5:56 am
by admin
.