I'm trying ](*,) to get landscape account schedules out of NAV.
1st, I see that there are two account schedule reports, 10028, Account Schedule, and 10029 Account Schedule Landscape. They are nearly identical except for the dimensions of a couple of vars, and the latter has the orintation set to 'Landscape'. So, I go looking to see how to invoke the landscape version ...
But, I can't find it in the existing menu structure, and the Help (!) is no help. (Search for landscape and the 1st hit describes what a landscape schedule is/does - but gives no clue on how to do it.) (State secret I'm guessing. [-( )
So, I dig ...
Form 104, Account Schedule, invokes Report 10028 (portrait.) So, maybe I can add an option to it ... But, I can't see how 10028 is set. The code in the Print button references a var called AccSched, but I don't see where it is either defined or set.
So, I dig some more ...
Exporting form 104 as .txt I found this code:
OnPush=VAR
AccSchedName@1001 : Record 84;
AccSched@1002 : Report 10028;
BEGIN
AccSchedName.GET("Schedule Name");
AccSched.SetAccSchedName(AccSchedName.Name);
AccSched.SetColumnLayoutName(AccSchedName."Defa ...
AccSched.RUN;
END;
}
So, my 2nd question is this: Where (in the object designer) can I see this variable defined or set?
Thank's in advance.
Bob
[/code]
Comments
Change the Print button, to a menu button. In the menu button, make 2 option, Potrait and Landscape. on both the OnPush Trigger of the Potrait and Landscape, copy the exact code of the previous print button. Declare the variable. But in the Landscape, use 10029 instead of 10028 (local variable)
So I think to answer your question, the variable is set in the local variable on the OnPush trigger of the print button.
Jon.
Yes, that was my plan.
However, I still don't know how/where to access the variable AccSched. The code example I provided is from a .txt export of the object - but I can't seem to find it when I'm in the designer.
Bob
You can find the definition of this in the button's local variables.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
Yes, i know that (Nav's code) is calling report 10028.
>You can find the definition of this in the button's local variables.
That's my problem: How do I access the local variables?
Bob
On the Object Designer
1. Go to Print Button
2. On the View Menu, click C/AL Code
3. Go to OnPush Tigger
4. On the View Menu, click C/AL Locals
Jon.
Bob