Emulating Controller technology transfers sometimes require that we transfer the data from the record information in the right-click menu on the recordings.
The following example has a material controller example. It also fills in the fields of record information.


Emulating Controller Right key menu data transfer
public class ItemController implements ILbsControllerTask
{
    private String m_ItemCode;
    public ItemController(String itemCode)
    {
        m_ItemCode = itemCode;
    }
    public void execute(LbsMenuController menu, IClientContext context)
    {
        try
        {
            ILbsController controller = menu.launchMaterials();
            if (controller instanceof MMXFItemBrowserController)
            {
                MMXFItemBrowserController controller1 = (MMXFItemBrowserController) controller;
                controller = controller1.createNew_CGCommercialGood();
                if (controller instanceof MMXFItemController)
                {
                    MMXFItemController controller2 = (MMXFItemController) controller;
                    controller2.setCode(m_ItemCode);
                    controller2.setCreatedBy(10);
                    Calendar cal = Calendar.getInstance();
                    cal.set(Calendar.DATE, 15);
                    cal.set(Calendar.MONTH, 11);
                    cal.set(Calendar.YEAR, 1983);
                    controller2.setCreatedOn(cal);
                    controller2.setModifiedBy(10);
                    Calendar cal2 = Calendar.getInstance();
                    cal2.set(Calendar.DATE, 16);
                    cal2.set(Calendar.MONTH, 11);
                    cal2.set(Calendar.YEAR, 1983);
                    controller2.setModifiedOn(cal2);
                    controller2.clickSave();
                }
                controller1.clickClose();
            }
        }
        catch (Exception e)
        {
            //TODO handle your exceptions
        }
    }
} 
Telif HakkıKullanım KoşullarıGizlilik
Copyright © 2018 Logo Yazılım