OK / Cancel buttons on a page

Rob_Hansen
Member Posts: 296
Greetings -
In the classic client this one is simple to handle, but I'm not sure how to approach it in the RTC...
I need to open a page with OK and Cancel buttons prompting the user to fill in some lines (so there is an underlying recordset). In the classic client, I use the "IF FORM.RUNMODAL(...) = Action::LookupOK THEN..." and all is fine. When I take the same approach in the RTC though, the form opens up in non-editable mode (like any list would) so the user has to right-click in the lines and select Edit to open an editable version. That's ugly. I've tried adding code to explicitly set EDITABLE to TRUE, but no luck.
In the classic client I could manually create my own form with OK and Cancel buttons with code behind the OK button to set a variable to TRUE (i.e. ClickedOK := TRUE), then I could read that back in my calling function. In the RTC I don't know if I can do the same thing...is it possible to manually define buttons to appear on a Page for OK and Cancel at the bottom?
Help!
In the classic client this one is simple to handle, but I'm not sure how to approach it in the RTC...
I need to open a page with OK and Cancel buttons prompting the user to fill in some lines (so there is an underlying recordset). In the classic client, I use the "IF FORM.RUNMODAL(...) = Action::LookupOK THEN..." and all is fine. When I take the same approach in the RTC though, the form opens up in non-editable mode (like any list would) so the user has to right-click in the lines and select Edit to open an editable version. That's ugly. I've tried adding code to explicitly set EDITABLE to TRUE, but no luck.
In the classic client I could manually create my own form with OK and Cancel buttons with code behind the OK button to set a variable to TRUE (i.e. ClickedOK := TRUE), then I could read that back in my calling function. In the RTC I don't know if I can do the same thing...is it possible to manually define buttons to appear on a Page for OK and Cancel at the bottom?
Help!
Rob Hansen
http://www.epimatic.com
http://www.epimatic.com
0
Comments
-
Could you upload a screenshot of the page, what pagetype is it and you said that you have a sourcetable on the page - how does the code look that sets the record on the page - and where is it?Freddy Kristiansen
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.0 -
Hi,
Was any solution found for this problem? I am having the same problem where I am running the sales order page modally to allow the user to edit a record and then I do some processing with that record afterwards. I would like to be able to not do the processing if the user clicked cancel, but if I check the modal result the sales order lines show up as readonly (header details can be changed).
Does anyone know of a way around this problem?0 -
I have tried your solution. But, without LOOKUPMODE(TRUE), the page show in View Mode. Please advise how to show Page in Select Mode? Thank you.Best regards,
Johanna0 -
Try below logic
CLEAR(FMSAddInfoList); FMSAddInfoList.SetNewDoc("Document No."); FMSAddInfoList.SETTABLEVIEW(FMSAddInfo); FMSAddInfoList.EDITABLE(TRUE); FMSAddInfoList.LOOKUPMODE(TRUE); IF FMSAddInfoList.RUNMODAL = ACTION::LookupOK THEN
0 -
Thanks Mohana. I have tried :
CLEAR(FormPostedSI); FormPostedSI.SETTABLEVIEW(recSalesInvHeader); FormPostedSI.SETRECORD(recSalesInvHeader); FormPostedSI.LOOKUPMODE(TRUE); IF FormPostedSI.RUNMODAL = ACTION::LookupOK THEN BEGIN InvNo := recSalesInvHeader."No."; END;
But, the page is shown with Close button only and there are no OK and cancel button. Please advise. Thank you.Best regards,
Johanna0 -
Did you check in Actions menu?0
-
No, I put that code on InvNo.OnLookup
InvNo is variable with data type Code.Best regards,
Johanna0 -
Is your base page in Editable mode?
the best example is Chart Of Accounts..
If we lookup totalling field in COA when it is in View mode, we will have only close button in G/L Account List page.
If we open COA page in editable mode and click totaling, we will have Ok and Cancle buttons in G/L Account List page.0 -
I have tried this:
myPage.LOOKUPMODE := true;
IF myPage.RUNMODAL = ACTION::LookupOK THEN BEGIN
Message('Ok Clicked');
END;
pointing the myPage variable to page 36 (bill of materials) - the Ok / Cancel buttons do show up.
I added an action on which I added the above code in the OnAction trigger.“This posting is provided "AS IS" with no warranties, and confers no rights.”
Henrik Metzger, Software Development Engineer, Dynamics NAV
MSFT0
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