Hello All,

I am new to Axapta and I am trying to understand the QueryRun.changed method. I 
have pasted an example of code below. There is Query CusttransCustSettlement 
that essentials joins the custtrans and the custsettlement tables. In the code 
below there is a if(queryRun.changed(tablenum(CustSettlement))) statement. I am 
not sure what that means? does it mean if the table was updated while the code 
was executed? or does it mean if the record has changed? I would appreciate 
some input with an example.

Thank You in Advance
Salu Joseph

   while (queryRun.next())
    {
        custTrans = queryRun.get(tablenum(CustTrans));
        if (!optimizeUsingSumQuery)
        {

            if (!custTransRecIdSet.in(custTrans.RecId))
            {
                custTransRecIdSet.add(custTrans.RecId);
                //balanceAge[1] += custTrans.remainAmountMST();
                balanceAge[1] += custTrans.remainAmountCur();   // SP6 needed 
this Pankaj change
            }
        }
        if(queryRun.changed(tablenum(CustSettlement)))
        {
            custSettlement = queryRun.get(tablenum(CustSettlement));

            balanceAge[1]   += custSettlement.SettleAmountMST;
            balanceAge[1]   += custSettlement.ExchAdjustment;

            for (numOfAge = 2; numOfAge <= dimof(balanceAge); numOfAge++)
            {
                startDate = startDateArray[numOfAge];
                endDate   = endDateArray[numOfAge];
                if (!custSettlement.DueDate)
                {
                    custSettlement.DueDate = 
CustTransOpen::findRefId(custSettlement.TransRecId).DueDate;
                }

                if(this.dateOkSettlement(custSettlement, startDate, endDate))
                {
                    tmpAccountSum.AccountNum = _custTable.AccountNum;
                    this.placeTransInColumns(custTrans, 
custSettlement.SettleAmountMST - custSettlement.ExchAdjustment, numOfAge, 
custSettlement.DueDate);
                    break;
                }
            }
        }
    }

Reply via email to