How can i define a global variable and can use it another page
can anyone please help me out in this??
You cannot access any variable defined in a single object to others except using them as the parameter to your function and still, they are available internally to that object. You can write a Return function and use a global variable for values but Navision does not allow multiple return functions
And what is your core requirement?
Can you please explain us a bit?
Use SingleInstance propery set to Yet on Codeunit Object
On Page1:
Codeunit1.SetNumber(100);
On Page2:
Number := Codeunit1.GetNumber();
MESSAGE(Format(Number));
The SingleInstance property in Codeunit1 is set to Yes. Page1 calls a function on Codeunit1 and sets the parameter to 100. Codeunit1 saves this parameter in a local variable. Page2 is now able to get the parameter value (=100) from Codeunit1. A message is displayed.
I want to access test variable in another page
procedure combine(name1: Text)
begin
test := name1;
end;
// i wouldn't be able to access it just access that method only. i want to access its member also
Do you have any code example of it
You can use global variables by creating a Codeunit and defining your customized procedures with some custom global variables into that and use that procedure with any of the objects.
Cheers!
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156