Search This Blog

Thursday, February 14, 2013

Ax2012 get the Dimension description and display value


This job is used to get the dimension value and description for the specific dimension record.

static void  Krishh_GetDimensionAttributeDesc(Args _args)
{
    DimensionAttributeValueSetItemView  dimAttrsetView;
    DimensionAttribute                  dimensionattr;
    DimensionFinancialTag               dimensionfinancialtag;
    refrecid  financialTagCategory;
    ;

    select dimAttrsetView
    where dimAttrsetView.DimensionAttributeValueSet ==5637149326
    join dimensionattr
    where dimensionattr.RecId == dimAttrsetView.DimensionAttribute
        &&
    dimensionattr.Name == "SAPProductCode";

    financialTagCategory=dimensionattr.financialTagCategory();

    select  dimensionfinancialtag
    where dimensionfinancialtag.FinancialTagCategory == financialTagCategory;

    info(dimAttrsetView.DisplayValue);
   or
   info(strfmt("Display value= %1",dimensionfinancialtag.value));
    info(strfmt("Descriprition %1",dimensionfinancialtag.Description));
}

Tuesday, February 12, 2013

Ax2012 Run Workflows


Start workflows manually without batch jobs configured in AX2012.


static void Krishh_StartWorkflowManually(Args _args)
{
    SysWorkflowMessageQueueManager  queueManager;
    WorkflowWorkItemDueDateJob      workItemDueDateJob;
    ;
    queueManager = SysWorkflowMessageQueueManager::construct();
    queueManager.run();

    workItemDueDateJob = new WorkflowWorkItemDueDateJob();
    workItemDueDateJob.run();

}

AX2012 Send Service Framework


we can use the send service framework when wewant to send outbound messages. The following job is used send documents containing SalesOrders to an outbound port that endpoint configured for this document.


When you run this job you will get the senddocument dialog where we have to select the outbound port for the specified document.When you click on OK in dialog , the record will be inserted in the AifOutboundProcessingQueue table.

we should create the find operations for the service, by default AXSend service framework method sendMultipleDocuments will use find method.



static void Krishh_AxdSendframework(Args _args)
{
    AxdSend axdSend = new AxdSend();

    AifConstraintList aifConstraintList = new AifConstraintList();

    AifConstraint aifConstraint = new AifConstraint();

    aifConstraint.parmType(AifConstraintType::NoConstraint);

    aifConstraintList.addConstraint(aifConstraint);

    axdSend.sendMultipleDocuments(classNum(SalesSalesOrder),
    classNum(SalesSalesOrderService), AifSendMode::Async,  aifConstraintList);
    info("succeeded");
}