Friday, March 21, 2014

DP Logic Example

///
/// Processes the report business logic.
///
///
/// Provides the ability to write the report business logic. This method will be called by
/// SSRS at runtime. The method should compute data and populate the data tables that will be
/// returned to SSRS.
///
[SysEntryPointAttribute(false)]
public void processReport()
{
    CommercialEvaluationContract commercialEvaluationContract;

    PurchRFQTable   rfqTable;
    PurchRFQLine    rfqLine;
    PurchRFQReplyTable  rfqReplyTable;
    PurchRFQReplyLine   rfqReplyLine;
    PurchRFQCaseId purchRFQCaseId;
    ;

    commercialEvaluationContract = this.parmDataContract() as CommercialEvaluationContract;

    purchRFQCaseId = CommercialEvaluationContract.parmPurchRFQCaseId();

    while select rfqTable where rfqTable.RFQCaseId == purchRFQCaseId
              join rfqLine
              where rfqLine.RFQId == rfqTable.RFQId
    {
        while select rfqReplyLine where rfqReplyLine.RFQLineRecId == rfqLine.RecId
        {


            rfqCommericalEvaluationTemp.Description         =  rfqLine.ItemName;
            rfqCommericalEvaluationTemp.Qty                 =  rfqLine.QtyOrdered;
            rfqCommericalEvaluationTemp.UnitOfMeasureSymbol =  rfqLine.PurchUnit;

            rfqCommericalEvaluationTemp.VendName            =  rfqTable.VendAccount;

            rfqCommericalEvaluationTemp.Vendor_Description =  rfqReplyLine.Name;
            rfqCommericalEvaluationTemp.Vendor_Qty         =  rfqReplyLine.QtyOrdered;
            rfqCommericalEvaluationTemp.ScopeOf             = "SCOPE OF WORK as per attached Demag offer (95032463 dated 19/09/2013)";
            rfqCommericalEvaluationTemp.insert();

         }

    }
}

// Item Transaction Dp


[SysEntryPointAttribute(false)]
public void processReport()
{
    ItemTransactionsContract  ItemTransactionsContract;
    InventTable inventtable;
    InventTrans inventTrans;
    ItemId itemid;
    CompanyImage    image;
    CompanyInfo     CompanyInfo=CompanyInfo::find();
    ;

    ItemTransactionsContract = this.parmDataContract() as ItemTransactionsContract;
    itemid = ItemTransactionsContract.parmItemid();

    while select inventtable where inventtable.ItemId == itemid
        //join inventTrans where inventTrans.ItemId == inventtable.itemid
    {

        select inventTrans where inventTrans.ItemId == inventtable.itemid;
        if(inventTrans)
        {
            ItemTransactionsTmp.ItemId = inventtable.ItemId;
            ItemTransactionsTmp.ItemName = inventtable.itemName();
            ItemTransactionsTmp.createdByy = inventtable.createdBy;
            //ItemTransactionsTmp.CreatedDt = inventtable.createdDateTime;
            ItemTransactionsTmp.CreatedDtTime = inventtable.createdDateTime;
            ItemTransactionsTmp.CompanyLogo =   FormLetter::companyLogo();
            ItemTransactionsTmp.insert();
        }
    }

}


No comments:

Post a Comment

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...