28. Mai 2024 18:13
codeunit 50112 CodeunitEsempio03
{
Access = Public;
Subtype = Normal;
procedure DisplayName(Name: Text[20]): Record Customer
var
Customer: record Customer;
begin
Customer.SetFilter(Name, '@' + Name + '*');
Customer.FindFirst();
exit(Customer);
end;
}
page 50112 PageCodeunitEsempio03
{
PageType = Card;
ApplicationArea = All;
UsageCategory = Administration;
Caption = 'Search for Name';
layout
{
area(Content)
{
group(Input)
{
Caption = 'Search for Name';
field(Name; Name)
{
ApplicationArea = All;
Caption = 'Name';
ToolTip = 'Enter the Name you want to find';
}
}
}
}
actions
{
area(Processing)
{
action(Level)
{
ApplicationArea = All;
Caption = 'Find your Name';
RunObject = codeunit CodeunitEsempio03;
trigger OnAction()
var
InsertName: codeunit CodeunitEsempio03;
begin
InsertName.DisplayName(Name);
end;
}
}
}
var
Name: Text[20];
}
codeunit 50111 LevelCodeunit02
{
Access = Public;
Subtype = Normal;
procedure DisplayALevel(Number: Integer)
begin
case Number of
1..10:
Message('With ' + Format(Number) +' your Level is A');
11..20:
Message('With ' + Format(Number) +' your Level is B');
21..30:
Message('With ' + Format(Number) +' your Level is C');
else
Message('Unknown Level');
end;
end;
}
page 50111 LevelPage02
{
PageType = Card;
ApplicationArea = All;
UsageCategory = Administration;
Caption = 'Level Page 2';
layout
{
area(Content)
{
group(Input)
{
Caption = 'Number Selection';
field(Number; Number)
{
ApplicationArea = All;
Caption = 'Number';
ToolTip = 'Enter your Number';
}
}
}
}
actions
{
area(Processing)
{
action(Level)
{
ApplicationArea = All;
Caption = 'Find your Level';
RunObject = codeunit LevelCodeunit02;
trigger OnAction()
var
InsertNumber: codeunit LevelCodeunit02;
begin
InsertNumber.DisplayALevel(Number);
end;
}
}
}
var
Number: Integer;
}
28. Mai 2024 19:27
28. Mai 2024 20:00
29. Mai 2024 00:31
procedure DisplayName(Name: Text[20]): Record Customer
var
Customer: record Customer;
begin
Customer.SetFilter(Name, '@' + Name + '*');
if (Customer.FindFirst()) then
Message('The Name is: ' + Format(Name))
else
Message('The Name is not found');
exit(Customer);
end;
codeunit 50113 CodeunitEsempio04
{
Access = Public;
Subtype = Normal;
procedure DisplayName(CustomerNumber: Code[20]): Record Customer
var
Customer: record Customer;
begin
//Customer.SetFilter("No.");
if (Customer."No." = CustomerNumber) then
Message('The Customer Name is: ' + Format(Customer.Name))
else
Message('Customer not found');
exit(Customer);
end;
}
page 50113 PageCodeunitEsempio04
{
PageType = Card;
ApplicationArea = All;
UsageCategory = Administration;
Caption = 'Search for Name 2';
layout
{
area(Content)
{
group(Input)
{
Caption = 'Search for Name';
field(CustomerNumber; CustomerNumber)
{
ApplicationArea = All;
Caption = 'Number';
ToolTip = 'Enter the Customer Number';
}
}
}
}
actions
{
area(Processing)
{
action(Level)
{
ApplicationArea = All;
Caption = 'Find your Name';
RunObject = codeunit CodeunitEsempio04;
trigger OnAction()
var
InsertNumber: codeunit CodeunitEsempio04;
begin
InsertNumber.DisplayName(CustomerNumber);
end;
}
}
}
var
CustomerNumber: Code[20];
}
29. Mai 2024 09:51
29. Mai 2024 16:48