Open a designer layout from add-ons
I wish open a layout built with the designer. Basically I need to run some operations before printing and I want more control on user input parameters, so I create a class to execute the layout.
I saw an example in the customize forum based on LayoutHelper class and I thinked that it could be the solution; however when calling the method nothing happen, no errors and no actions, maybe I didn't understand how the LayoutHelper works.
This is my code:
public void CallLayout()
// next comment only to ensure class is running
catch (Exception e)
Marco SchweighauserYou have to reference the Assembly LayoutHelper.dll to compile the code.
To run your code coresuite designer has to be running. If think you can only test your code after you built a SIP and run your add-on like the user does (not from the development environment).
Massimiliano LuppisHi Marco,
I already referenced the LayoutHelper.dll; testing the code I referenced all the SWA_.dll I can find ...
Well the "SIP way" did not change the thing:
the designer is running and my code is compiled and installed by a sip but the form is still not visible.
I also tried to insert a Show.Message before calling the form, just to ensure the dll is working: the message is displayed but not the form.
Do you think that there are some methods that I have to call before calling LayoutOpener, something like LD.Start ?
Another thing i've disovered.
Use DocEntry not DocNum as the Parameter.
Please use the ExecutePrintDef Method to Print a Layout from scripts.
You have way more control on the Layout to print and there will be no Printdef Chooser if there are more than one Printdef defined for the Formtype.