Report request form how to check fields
mr.burns
Member Posts: 39
Hi all,
I have a report using a request form with several text fields, check boxes etc..
If I click the OK button I want to make sure that text fields are not empty.
How can I do that? I cannot find any trigger which is executed if I click the OK button.
If I put my 'check'-code inside the OnPreDataItem of first Dataitem it is too late since the request form is already closed.
Thanks for any help!
I have a report using a request form with several text fields, check boxes etc..
If I click the OK button I want to make sure that text fields are not empty.
How can I do that? I cannot find any trigger which is executed if I click the OK button.
If I put my 'check'-code inside the OnPreDataItem of first Dataitem it is too late since the request form is already closed.
Thanks for any help!
0
Comments
-
You can put your 'check'-code inside the OnPrereport trigger.0
-
Hi vijay_g,
thanks for reply, but unfortunately this also dos not work.
The request form is already closed if I run the code inside OnPreReport.
What I need is that the user stays on the request form until he has entered something inside the textfield.
So what should happen:
1. Request form opens, textfield is empty
2. User does not enter something in texfield
3. User clicks OK on request form
4. Code must be executed and check if textfield is empty
5. If textfield is empty, request form must not close and user gets message to enter something into textfield then back to point 3.
6. If textfield contains something the request form is closed and report runs as usual.
Thanks for any further help!0 -
I don't think this is possible through Request Form. You can do it through a standard NAV form. Run the form take the inputs from the user, validate them and then run the report.
Chn0 -
Hi Chinmoy,
thanks for reply. I think / feel the same. So I will deal with an extra form.0 -
There is one more crude method that comes to my mind, if you check the values in the OnPreReport and find that they are invalid, you can actually use Report.Run(<The same report object no.>) and then give an error message which will close the current report.
However, the parameter values which the user may have entered in the request form will be blanked out.
Chn0 -
The solution for this is the OnQueryClosePage()-trigger in the C/AL-code editor.
Here you can test, show a message and exit the trigger with FALSE.
So the page stays open and the values are still there.
If the check is successful exit with TRUE.
You can also determine, which button the user has pressed. It's the call parameter of the trigger.
If he has pressed CANCEL you can immediate leave the trigger with return value TRUE.0 -
I was also trying with this trigger but when the error comes navision get closed and the most intresting thing is when you come out from your report(on object designer) you will still getting this error and the result is you can not close object designer too.0
-
I guess you have already figured that out yourself, but just as remark:
OnQueryClosePage(CloseAction : Action None) : Boolean IF CloseAction IN [ACTION::OK,ACTION::LookupOK] THEN BEGIN IF tCodeunitNo = '' THEN ERROR(ERR_CuNo); IF tObjectRange = '' THEN ERROR(ERR_FILTER); END;
Alex Dragojevic0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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
