Friday, 21 October 2016

Form _Splitters

Form _Splitters

Example : Tutorial_from_split





Create a new form by name - pramod_Splitters

Add a new static text control  and add a new string control

set autodeclarations for both controls to Yes

Drag and drop the group control from the tutorial_form_split to the newly created form in
 between the static
 text and string edit controls

In the class declaration

public class FormRun extends ObjectRun
{
    SysFormSplitter_Y _formSplitter;
}

override init() method of the element and instantiate the sysFormSplitter_y class object

public void init()
{
    super();

     _formSplitter = new SysFormSplitter_Y(groupSplitter,StaticText,element);
}

Three important methods on the group control which will help to resize the splitters are mouseup, mousemove, mousedown

int mouseUp(int x, int y, int button, boolean ctrl, boolean shift)
{
    int ret;

    ret = super(x, y, button, ctrl, shift);

    Return _formSplitter.mouseUp(x, y, button, ctrl, shift);
}

int mouseMove(int x, int y, int button, boolean ctrl, boolean shift)
{
    int ret;

    ret = super(x, y, button, ctrl, shift);

    Return _formSplitter.mouseMove(x,y,button,ctrl,shift);
}

int mouseDown(int x, int y, int button, boolean ctrl, boolean shift)
{
    int ret;

    ret = super(x, y, button, ctrl, shift);

    Return _formSplitter.mouseDown(x, y, button, ctrl, shift);
}






Saturday, 1 October 2016

Insert method, Update method and delete method

static void insert(Args _args)
{
    //LopTable        lopTable;
    //lopTable.Age = 12;
    //lopTable.Name ="pramod";
    //lopTable.Sid = "1001";
    //lopTable.insert();
    //{
        //info("all record  insered");
    //}
   // temTable.setTmp();
 
   
    LopTable            lopTable;
    ;
   
    //
    //ttsBegin;
       //update_recordSet lopTable setting Sid="10";
    //
    //
    //
    //lopTable.Sid ="151";
    //lopTable.update();
    //ttsCommit;
    //
    //{
        //info(strFmt("All record updated"));
    //}
   
   
    //ttsBegin;
    //
    //select  forUpdate lopTable where lopTable.Sid;
    //
    //lopTable.Sid = "160";
    //lopTable.update();
    //ttsCommit;
   
    ttsBegin;
    delete_from lopTable
   
    where lopTable.Sid =="160";
    ttsCommit;
   
    {
        info(strFmt("%1",lopTable.Sid));
    }
   
   
}

Friday, 23 September 2016

Run base batch framework SendmailBatch

 Run base batch framework SendmailBatch

//Class Declaration the  class should Extend RunBaseBatch

class sendmailBatch extends RunBaseBatch
{
    Name                name;
    DialogField         dialogfield;

    #define.CurrentVersion(1)
    #define.CurrentList(1)
    #define.Version(1)
    #define.ImageSysTestProjcet(1)
    #define.MainBalance(1)
    #localmacro.CurrentList
   


        MainBalance
    #endmacro

}

the method must be overloaded in situations where a class must be selectable for a batchJournal

public boolean conGoBatchJournal()
{
    return true;
}


This  is used to populate/add the fields to Dialog

public  Object dialog()
{
    DialogRunbase    dialog =super();
    #resAppl

    dialog.addImage(#ImageSysTestProjcet);
    //dialogfield = dialog.addFieldValue(extendedTypeStr(name),MainBalance);


    return dialog;
}


This  will get the  Values form the  dialog a used to populate into Fields


public boolean GetfromDialog()
{
    mainBalance = dialogfield.value();

    return super();

}

This is  used to initialize any  variables


public  boolean init()
{
    return true;
}

Constructer

protected void new()
{
    super();
}


public container pack()
{


    return [#currentVersion,#CurrentList];
}


public void Run()
{
    SysMailer  sysmailer;
    EmployeeTable       employeeTable;
    QueryRun                qr;

    str                 mailMessage;

    InteropPermission permission = new InteropPermission(InteropKind::ComInterop);
    permission.assert();
    try
    {
        sysmailer = new SysMailer();
        employeeTable = qr.getNo(1);

        while select  employeeTable where employeeTable.Name>= name
        {
            mailMessage =strFmt("Dear Customer, your balancein in the is%1.please call us for further query",
            employeeTable.Age);

            //sysmailer.quickSend("",
            //employeeTable.Age,"Account Age",
            //mailMessage);
            //
            info("notification Mail sent");
        }
    }
    //{
        catch(Exception::Error)
        {
            info("Error due to maill configuration.chcek and run again");
        }

    }



public boolean validate(Object _CalledFrom = null)
{

    //if(name <=0)

    return checkFailed("Error!invaild value in minimun balance field");

    return true;
}

static ClassDescription Description()
{
    return "send mail Batch";
}



server static sendmailBatch construct()
{
    return new sendmailBatch();
}


static void Main(Args args)
{
    sendmailBatch       sendmailBatch;
    sendmailBatch = sendmailBatch::construct();
    if(sendmailBatch.prompt())
        sendmailBatch.run();

}