Default values on Request Form

NavDev
Member Posts: 21
Hi experts,
this is another basic question ... sorry for this.
I tried to initialize the data items (not the options-tab!) on the request form with specific values, that shall be identical to all users and active, whenever the request form opens. So I do not want to use "SaveValues" for the request form.
Let's say I want to initialize a report containing contacts with
City = 'Chicago'
i. e. when the request form open, the contact-tab should show the field "City" (->ReqFilterFields) and a given value of "Chicago", which can be changed by the user, but represents a default.
How (simple) is it done? Thanks in advance.
kind regards,
NavDev
this is another basic question ... sorry for this.
I tried to initialize the data items (not the options-tab!) on the request form with specific values, that shall be identical to all users and active, whenever the request form opens. So I do not want to use "SaveValues" for the request form.
Let's say I want to initialize a report containing contacts with
City = 'Chicago'
i. e. when the request form open, the contact-tab should show the field "City" (->ReqFilterFields) and a given value of "Chicago", which can be changed by the user, but represents a default.
How (simple) is it done? Thanks in advance.
kind regards,
NavDev
0
Comments
-
Have you tried, in OnInitReport (which fires before you see the request form):
Contact.SETFILTER(City,'=%1','Chicago');
0 -
hi DenSter,
in fact I have. But it didn't work. :-(
NavDev0 -
That's where I thought it would be. I also tried setting the table filter in properties, and played around with FILTERGROUP, but I couldn't get it to work quickly. I am pretty sure though, if you do a SETFILTER like that in code when you call the report in C/AL from a form or something, that it works like that.0
-
Hi NavDev,
This sound more simple than it actualy is. Daniels solution works and sets the filter, however it is not visible for the user.
The only way to make the filters visible that I know of is to make a fuction that calls the report.
e.g:Cust.SETRANGE(City, 'Amsterdam'); Report.run(Report::X, true, false, Cust);
Sorry, but I think this is all you can do.
Regards,
Mark0 -
-
thank you, guys!
I see, it is not so easy as I thought. I think I will consider Mark's solution or try to live without it.
best regards,
NavDev0 -
Hello guys,
is this realy the only solution to call the report via CU?
it realy works fine whith the CU but i think it´s not the best solution.
Have anybody ideas?
greets
george0 -
Doesn't have to be a codeunit. It can be from a button, or another report, or anywhere else that you can access the C/AL editor.0
-
DenSter wrote:Doesn't have to be a codeunit. It can be from a button, or another report, or anywhere else that you can access the C/AL editor.
Like NavDev wrote:NavDev wrote:
Let's say I want to initialize a report containing contacts with
City = 'Chicago'
so it´s impossible to initialize the Report with standard values?
hmmm ](*,)
greets
george0 -
http://www.microsoft.com/Businesssoluti ... c.navision
Just say 'I Agree' and we will see if some good will come from it.1 -
Hi experts,
I am running a report within a report so I can get the default filters to appear on the request form. The only issue I'm have is when I set the ReqWindow to TRUE I get two preview windows. When I set it to false I don't get either. I only want to show the request form for the report I"m calling not the one I'm using to call that report. I hope this makes sense.
Thanks all,
Dneal0 -
not sure if I am missing something, and I haven't had a need to do this, but my first thought is to:
1. set a user defined global variable city1 and put this on the request form
2. then set the initial value on the report OninitReport section
City1 := "Chicago"
3. Then before the report is ran set the filter on the onPreDataItem section
Customer.SETFILTER("City", City1);
so the user would change the filter in the request form, only problem would be that they couldn't use a lookup to get values, they would have to type them in. but worst case if they spell it wrong the report would just be blank.
on edit, just realized the date of the original thread is very old, and the question just above this really is a different question then the original thread was asking, I answered for the original thread, not the post just above this one.0 -
You can set the Global Variable for the Request Page option in the OnOpenPage() under the Request Page. If you attempt to set them in either InitReport, it does not work because the variable has not been created yet (according to the debugger).1
-
And there is one sufficient answer to this question in following forum post:
http://forum.mibuso.com/discussion/35317/default-filter-on-report--
Ivica0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions