AL Triggers are not working in VSCODE.

iHateCoding
Member Posts: 3
new to AL and not sure if this is the right place to post but,
page 50110 DataTypeCard
{
PageType = Card;
ApplicationArea = All;
UsageCategory = Documents;
Caption = 'Date Type Card';
layout
{
area(Content)
{
group(GroupName)
{
}
}
}
actions
{
area(Processing)
{
action(ActionName)
{
ApplicationArea = All;
trigger OnOpenPage()
var
myInt: Integer;
begin
Message('The value of %1 is %2', 'YesOrNo', YesOrNo);
Message('The value of %1 is %2', 'Amount', Amount);
Message('The value of %1 is %2', 'When Was It', "When Was It");
Message('The value of %1 is %2', 'What Time', "What Time");
Message('The value of %1 is %2', 'Description', Description);
Message('The value of %1 is %2', 'Code Number', "Code Number");
Message('The value of %1 is %2', 'Ch', Ch);
Message('The value of %1 is %2', 'Color', Color);
end;
trigger OnAction()
var
myInt: Integer;
begin
end;
}
}
}
var
LoopNo: Integer;
YesOrNo: Boolean;
Amount: Decimal;
"When Was It": Date;
"What Time Was IT": Time;
description: Text[30];
"Code Number": Code[10];
ch: Char;
color: Option Red,Orange,Yellow,Green,Blue,Violet;
It say OnOpenPage is not a valid trigger and i cant get any other trigger to come up in intellisense, as well as typing them manually continues to say they're not valid triggers.
here is the error.
"Documents\AL\ALProject2\Date Type Card.Page.al(27,25): error AL0162: 'OnOpenPage' is not a valid trigger"
Ive tried reinstalling the AL extension, renaming the file, and a few more things i can't remember, this makes 0 sense as these as this is a valid trigger and every other page extension trigger does not work. Please help before I jump out a window.
page 50110 DataTypeCard
{
PageType = Card;
ApplicationArea = All;
UsageCategory = Documents;
Caption = 'Date Type Card';
layout
{
area(Content)
{
group(GroupName)
{
}
}
}
actions
{
area(Processing)
{
action(ActionName)
{
ApplicationArea = All;
trigger OnOpenPage()
var
myInt: Integer;
begin
Message('The value of %1 is %2', 'YesOrNo', YesOrNo);
Message('The value of %1 is %2', 'Amount', Amount);
Message('The value of %1 is %2', 'When Was It', "When Was It");
Message('The value of %1 is %2', 'What Time', "What Time");
Message('The value of %1 is %2', 'Description', Description);
Message('The value of %1 is %2', 'Code Number', "Code Number");
Message('The value of %1 is %2', 'Ch', Ch);
Message('The value of %1 is %2', 'Color', Color);
end;
trigger OnAction()
var
myInt: Integer;
begin
end;
}
}
}
var
LoopNo: Integer;
YesOrNo: Boolean;
Amount: Decimal;
"When Was It": Date;
"What Time Was IT": Time;
description: Text[30];
"Code Number": Code[10];
ch: Char;
color: Option Red,Orange,Yellow,Green,Blue,Violet;
It say OnOpenPage is not a valid trigger and i cant get any other trigger to come up in intellisense, as well as typing them manually continues to say they're not valid triggers.
here is the error.
"Documents\AL\ALProject2\Date Type Card.Page.al(27,25): error AL0162: 'OnOpenPage' is not a valid trigger"
Ive tried reinstalling the AL extension, renaming the file, and a few more things i can't remember, this makes 0 sense as these as this is a valid trigger and every other page extension trigger does not work. Please help before I jump out a window.
0
Best Answer
-
Sure triggers are working, it's just in the wrong place. You have it inside an action, page level triggers go outside all layout elements. Intellisense will tell you what is available from where your cursor is. Just type 'trigger' and then type 'on' and it should drop down a list of available triggers.
here's what shows up as available outside layout elements:
This is what's available in an action
OnOpenPage is not a valid trigger in an action1
Answers
-
Sure triggers are working, it's just in the wrong place. You have it inside an action, page level triggers go outside all layout elements. Intellisense will tell you what is available from where your cursor is. Just type 'trigger' and then type 'on' and it should drop down a list of available triggers.
here's what shows up as available outside layout elements:
This is what's available in an action
OnOpenPage is not a valid trigger in an action1 -
Sure triggers are working, it's just in the wrong place. You have it inside an action, page level triggers go outside all layout elements. Intellisense will tell you what is available from where your cursor is. Just type 'trigger' and then type 'on' and it should drop down a list of available triggers.
here's what shows up as available outside layout elements:
This is what's available in an action
OnOpenPage is not a valid trigger in an action
Thank you so much, really appreciate the detailed response, doing this course from Microsoft and it's not exactly the best at teaching specifics, again really appreciate your help!
https://learn.microsoft.com/en-us/training/modules/intro-basics-al-programming/9-exercise0 -
Try this one:
https://youtu.be/04T2pAnXjGQ
There's a playlist with more than 20 hours of content
https://www.youtube.com/embed/videoseries?list=PL1FESh9FqyhQxkZXYYp1X1tTpXf3-9iSR
The videos are out of order in the playlist, there's a part 1 and part 2 for doing development in AL. I don't know who the dude in the first video is, kind of annoying how someone else's face is on 20 hours of dev training that I recorded1 -
Haha i can imagine, I will definitely take a look at these, and appreciate the help!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