First coding - First Problem - RTC Newbie

Mauddib
Member Posts: 269
So finally getting to code on RTC in my company as the company have finally ok'ed my project to upgrade our system from classic to RTC.
Programming my first pages today. All very exciting. For me anyway. I know some of you have been at this 5 years
Quick question - for my education as much as for solving a requirement in my company. On an old style list form it was possible to put code on a button, set the button to be the "default" button for the form, and then if you DOUBLE CLICKED a line in the list the code behind that button would run.
Can similar be done in RTC? I tried creating an ACTION and putting code on it. I then set the ShortCutKey for that action to "Return". But when I double click OR press the ENTER key the code in my OnAction does not run. Here is my VERY simple page I created to demonstrate an example:
Programming my first pages today. All very exciting. For me anyway. I know some of you have been at this 5 years

Quick question - for my education as much as for solving a requirement in my company. On an old style list form it was possible to put code on a button, set the button to be the "default" button for the form, and then if you DOUBLE CLICKED a line in the list the code behind that button would run.
Can similar be done in RTC? I tried creating an ACTION and putting code on it. I then set the ShortCutKey for that action to "Return". But when I double click OR press the ENTER key the code in my OnAction does not run. Here is my VERY simple page I created to demonstrate an example:
OBJECT Page 50002 Test Default 1 { OBJECT-PROPERTIES { Date=19.03.14; Time=17:28:43; Modified=Yes; Version List=; } PROPERTIES { SourceTable=Table27; PageType=List; ActionList=ACTIONS { { 1000000003; ;Action ; Name=<Action1000000003>; ShortCutKey=Return; CaptionML=ENU=My First TEST; OnAction=BEGIN MESSAGE(Description); END; } } } CONTROLS { { 1000000000;0;Container; ContainerType=ContentArea } { 1000000001;1;Group ; Name=Group; GroupType=Repeater } { 1000000002;2;Field ; SourceExpr="No." } } CODE { BEGIN END. } }
0
Comments
-
-
It is always you that comes to my rescue - even after all this time
However is that not exactly what I tried? I do not see what I am doing different to you - but it is definitely not working for me. Double clicking on the lines when my action is set to "Return" does nothing.0 -
Please add "Item Card" in CardPageID property of page and try..
Don't forget to set Editable property of List page to No.0 -
If the required action is to open the card, then do like Mohana suggests. This is the default behaviour in Dynamics NAV. The return property is to create exceptions.0
-
It's done,Try this
OBJECT Page 50002 Test Default 1 Sam { OBJECT-PROPERTIES { Date=20/03/14; Time=[ 4:08:59 PM]; Modified=Yes; Version List=; } PROPERTIES { Editable=No; SourceTable=Table27; PageType=List; ActionList=ACTIONS { { 1000000004; ;ActionContainer; ActionContainerType=NewDocumentItems } { 1000000005;1 ;ActionGroup } { 1000000006;2 ;Action ; Name=<Action1000000003>; ShortCutKey=Return; CaptionML=ENU=My First TEST; Promoted=Yes; OnAction=BEGIN MESSAGE(Description); END; } } } CONTROLS { { 1000000000;0;Container; ContainerType=ContentArea } { 1000000001;1;Group ; Name=Group; GroupType=Repeater } { 1000000002;2;Field ; SourceExpr="No." } } CODE { BEGIN END. } }
Regards,
Suraj“Any fool can know. The point is to understand.”
― Albert Einstein0 -
Thanks guys. The goal was not to open the Item Card - but to have a table of dynamic records of our objects (Codeunits, XMLPorts, Reports) so I can "Per Company" define a report/export list that users can run in our database. The goal is to have a list form of objects the user can run, which we can edit dynamically and per company, and when the user Double Clicks one it runs automatically.
The code solution above works perfectly when I import it. Strangely it does not work when I try to manually reproduce it myself in my own form, rather than simply importing the code above. So I must be doing something wrong. But I trust I will find my error. My guess is it has something to do with how I am putting the Actions in the group and in the container or something like this.
But since the above was just a "proof of concept" for an internal requirement, this is enough for now.
So thanks muchly for the help all. I will try not to bother you TOO often with these newbie questions.0 -
Mauddib wrote:I will try not to bother you TOO often with these newbie questions.0
-
I just love the NAV community:)This posting is provided "AS IS" with no warranties, and confers no rights.0
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