Tuesday 24 November 2015

cross company and change company

DataAreaId                  localDataArea = curext();

    InventItemOrderSetupType    setupType   = InventItemOrderSetupType::Invent;
    InventJournalCheckPost      journalCheckPost = new InventJournalCheckPost();

    //change company
    changeCompany(_DMS_IMEIDelinkingTable.DataArea)
    {

        ttsbegin;
        this.progressbar();
        inventJournalTable.clear();
        num = new NumberSeq();
        num = NumberSeq::newGetNum(InventParameters::numRefTransferId());

        inventJournalTable.initFromInventJournalName(InventJournalName::find(InventParameters::find().LossProfitJournalNameId));
        inventJournalTable.DMSRequestID = _DMS_IMEIDelinkingTable.DMSRequestID;
        inventJournalTable.Description  = "";
        inventJournalTable.insert();

        while select crossCompany DMSCurrentItermID, IMEI, DMSNewItemID from  IMEIDelinkingLine
            where IMEIDelinkingLine.DMSRequestID == _DMS_IMEIDelinkingTable.DMSRequestID
                && IMEIDelinkingLine.dataAreaId  == localDataArea
        {
            inventJournalTrans.clear();
//do the business logic
        }


change company : it changes the from current company to the current company.

cross company : normally when we select the table it will display the data related to company  id .

when  can select the cross company it select all the company records from the table and we can use it for flteration.

cross company in query

 this.query().allowCrossCompany(true);

        this.query().dataSourceTable(tablenum(InventJournalTable)).addRange(fieldNum(InventJournalTable,RequestID)).value(parmId);

        query = this.query();

intercompany PO multiple product receipt by x++

public void processStampICPO(PackingSlipId _deliveryNote,                             Transdate _deliverydate,                             ...