Basically codeunit can be used in following way:
For example:-
codeunit 50101 “Test Functions”
{
procedure Factorial()
var
IntValue, IntValue2, Fact : Integer;
begin
IntValue := 5;
IntValue2 := IntValue;
Fact := 1;
while
IntValue >= 1
do begin
Fact := Fact * IntValue;
IntValue -= 1;
end;
Message(‘IntValue = %2, My Factorial value is %1’, Fact, IntValue2);
}
For example :-
pageextension 50101 CustomerListExt extends “Item List”
layout
// Add changes to page layout here
actions
addlast(Functions)
action(Factorial)
ApplicationArea = All;
Caption = ‘Factorial’;
trigger OnAction()
TestFunctionCodeunit: Codeunit “Test Functions”;
// TestFunctionCodeunit.Run();
TestFunctionCodeunit.Factorial();
After this, we should publish our program and check for the result
For more details kindly visit our LinkedIn page:
https://www.linkedin.com/company/allgrow-technologies-pvt-ltd/mycompany/
or you can write us on contact@allgrowtech.com
Author
Your email address will not be published. Required fields are marked *
Save my name, email, and website in this browser for the next time I comment.