Sunday, December 8, 2013

How to get all the planned orders for a particular demand. in Ax2012

When we create a sales order in Ax. Basically we are creating demand in system and when we run scheduling in system it generates the planned production or purchase orders.


Following is the step by step process.

·         Create sales order. And check the explosion from salesline->Product and supply. Initially there are no planned orders. So there is no record in explosion.



·         Check the explosion from salesline

·         Now run the planning from Master planning ->Periodic->Master scheduling

·         Check the explosion from sales line

·         If we want to get all the planned production orders detail we can get it through following x++ code. We can get top level planned order from REqPo table where on the basis of pegging reference of sales order we can find top level planned production order. We can use that planned order as a parameter in a method and retrieve all the lower level orders.

private void doUpdateReferences(reqPo   _reqPo)
{
    ReqTransExplode         reqTransExplode;
    Map                     mapReqTransLocal;
    MapEnumerator           enumerator;
    container               conMapReqTrans;
    Map                     mapReqTrans;
    reqTrans                reqTrans;
    ReqPO                   reqPo = _reqPo;
    Map                     plannedOrderMap = new Map(Types::Int64, Types::Record);
   
    ;

    while (reqPo)
    {
        if (!plannedOrderMap.exists(reqPo.RecId) )
        {

           reqTransExplode = reqTransExplode::newReqTrans(reqPo.reqTrans(),ReqExplodeType::Down,true);
           reqTransExplode.run();

            conMapReqTrans = reqTransExplode.packMapReqTrans();

mapReqTransLocal    = (conMapReqTrans)  ? Map::create(conMapReqTrans) : new    Map(typeName2Type(extendedtypestr(recId)), Types::Record);

            mapReqTrans = new Map(typeName2Type(extendedtypestr(recId)), Types::Record);
            enumerator = mapReqTransLocal.getEnumerator();
            while(enumerator.moveNext())
            {
                reqTrans = reqTrans::findRecIdCrossCompany(enumerator.currentKey());
                if (reqTrans.RefType == ReqRefType::BOMPlannedOrder)
                {
                    Info(reqtrans.reqpo().refid);
                }
            }
        }

        next reqPo;
    }

}













7 comments:

  1. Your particular data is really Hadoop Training Chennai gigantic for me. Keep update your web journal. Hadoop Training in ChennaiThank you to such a degree...

    ReplyDelete
  2. Great post and informative blog.it was awesome to read, thanks for sharing this great content to my vision.
    Informatica Training In Chennai
    Hadoop Training In Chennai
    Oracle Training In Chennai
    SAS Training In Chennai

    ReplyDelete
  3. hi,i read your blog,its good and admirable,I am really happy reading your well written articles online microstrategy training thanks for sharing this.

    ReplyDelete
  4. Thank you for sharing such great information with us. I really appreciate everything that you’ve done here and am glad to know that you really care about the world that we live in

    click here

    Selenium Training in Bangalore|
    Selenium Training in Chennai

    ReplyDelete
  5. This post is really nice and informative. The explanation given is really comprehensive and useful...

    ssrs report tutorial

    ReplyDelete