01 - Dynamic Code Sample
01 - Dynamic Code Sample
Description
We are going to use two function buttons to execute two samples of dynamic code.
The samples are not designed to do anything meaningful but simply give you a heavily documented overview
of how to use the dynamic code.
For copy/Paste
//This is a sample of Dynamic Code - This here is a C# Comment and generally what you can do in C# ..NET 2.0,
you can do here.
//C# Syntax is very unforgiving so the smallest error cause build errors. You can always press the Test-compile
code below to check validity of the code (but it does not make it correct usage so you need to test) ... Now
make some code :-)
EditText et = (EditText)form.Items.Item("7").Specific;
string name = et.Value;
application.MessageBox("Name is "+name);
//Now lets use the application to open an activity window and move name over
application.ActivateMenuItem("2563");
Form f = application.Forms.ActiveForm;
EditText etRemarks = (EditText)f.Items.Item("53").Specific;
etRemarks.Value = name;
For copy/paste
//This is a sample of Dynamic Code - DI - Lets make a Business Partner in code. This can off cause be combined
with UI-API
Result
When the two function buttons are pressed the C# code will get executed.