Monday, February 17, 2014

Using document service (AIF)

static void Services_CustTable_Create(Args _args)
{
    // Customer Service class
    CustCustomerService     custService;
    CustCustomer                customer;

    // Data object of Service class
    CustCustomer_CustTable  custTable;
    AifEntityKeyList               entityKeyList;
    AccountNum                    accountNum;
    ;

    //Service instance
    custService =  CustCustomerService::construct();

    customer = new CustCustomer();
    customer.createCustTable();
    custTable = customer.parmCustTable().addNew();

    custTable.parmName("Cust_Service");
    custTable.parmCustGroup("20");
    custTable.parmCurrency("EUR");
    custTable.parmPartyType(DirPartyType::Organization);

    // Create Customer
    entityKeyList = custService.create(customer);

    if(entityKeyList)
        accountNum = entityKeyList.getEntityKey(1).parmKeyDataMap().lookup(fieldnum(CustTable, AccountNum));
        infolog.messageWin().addLine(accountNum);
}

No comments:

Post a Comment