AX2012 FP Product receipt from X++

Here the other day I have seen a change in functionallity between AX 2012 (6.0) and AX 2012 Feature Pack (6.1).  At several customers we are using simplified product receipt, where the warehouse worker and do a product receipt from a small PDA screen, after the items has been registrered :

image

A small demo X++ code for doing the product receipt is like this (for AX 2009 and AX 2012):

image

About these ads

About Kurt Hatlevik

Greetings. I appreciate that you’ve helped create this worldwide blog community—as a consultant working from Norway, the blog lets me share more than 16 years of experience with Microsoft Dynamics AX. Along the way, I developed the DCS, BTI, SYNC, KIT and the WM&D solution. My blog focuses on my deepest interests and expertise: along with a 360 degree view of warehouse management topics, I welcome opportunities to dive into retail and intercompany supply chain automation, logistics, and production—everything that is moving around in a truly connected enterprise. As executive consultant for Dynamics AX, I specialize in strategic development and planning for corporate vertical solutions and works to build international networks that increase knowledge and understanding for Dynamics AX. As an advocate for both providers and customers, I'm committed to ensure that customers meets constantly changing needs, and I see community as key for increasing expertise.
This entry was posted in Warehouse Management, X++. Bookmark the permalink.

10 Responses to AX2012 FP Product receipt from X++

  1. NK says:

    Hi Kurt,

    I am a follower of your blogs and read them regularly and likes them very much.

    I will like to take some help from your side here.

    There is a requirement to implement Bar Code solution for one of the customer. What do you suggest which will be a better solution ( 3rd party PDA solution or customizing Ax only). We are using Ax2009 version with medium to heavy customizations.

    We require the Bar code solution at the following places
    - Receipt,Picking, Packing, Packaging, Bill of Lading journal, Transfers.

    I have another question.
    1) In case we use the customization activities in Ax only , then how can be access Ax application through PDA devices. What will be the most optimum ways to access Ax 2009 application from PDA devices. Are there any implications from licensing side also here.

    2) What kind of PDA devices are recommened for warehousing solution.

    Thank you very much,

    NK

    • Hi Naresh.

      Thank you for reading my blog :-) There are many other solutions in the marked that covers both barcoding and PDA. This is like Dynamics anyware, RF-smart or To-Increase. The solutions I’m writing on is only made for AX 2012, and we currently do not have any plans on making them available for AX 2009.

      My personal preference has always been to have all features (like PDA and barcoding) created inside AX, because this reduces the complexity of the installation, and also reduces the number of different tools that is required.

      I will send you some information about what I’m working on, and you maybe can be inspired to look into this direction.

      Happy DAXing :-)

      //kurt

  2. Eric says:

    Kurt, Im looking to receive barcoded Fixed Assets at time of receipt. I cannot find this within AX 2012. Could you point me in the right direction? Then maybe i can get into some customizations from there…

    Thanks

    • I’m not quite sure of your requirements, but the Purchase module in AX 2012 is built for also purchasing fixed Assets. In the PO you can also select the bar-code that is expected. If the bar-code is a EAN128 you can use this barcode in the arrival journal, bu scanning on the EAN128 field. But there are functional limitations on this, so you very quickly end up with a customization.

      But take a look on the PDA and BarTender integration tools that I have described in my blogs. They do support to just scan to bar-codes to receive the goods, and the PDA does also support receive of Fixed Assets if using purchase orders. If interested in more information, I can send you the user manuals, or reach out to me to a chat.
      //kurt

  3. Rick says:

    Hi Kurt
    I like your receive screens. Actually I think the company I am currently working is using your AX bartender solution. Anyway, I have about 4 months AX development experience working in AX, so its a bit slow getting up to speed. I have created a screen similar to what you have to receive product and create arrival journal and post it (via X++). Next step I need to do is to post product receipt via X++. Looking at your code example how is the journal itself related to the posting of the receipt? I guess this already happens because the journal itself already referenced the specific purchase order and then the posting of the receipt also references the same purchase order? any thoughts would be helpful. I am only trying to post product receipt against purchase orders and maybe transfer orders (if possible). Basically need the same functionality you get from the arrival journal screen and clicking on “functions — product receipt”.

    • Hi Rick.

      The following code is Packingslip/Receipt updating a purchase order of what is registered.

      public boolean postProductReceiptList()
      {
          boolean ret;
          PurchFormLetter_PackingSlip purchFormLetter_PackingSlip;

          ttsbegin;
          purchFormLetter_PackingSlip = PurchFormLetter::construct(DocumentStatus::PackingSlip);
          purchFormLetter_PackingSlip.showQueryForm(false);
          purchFormLetter_PackingSlip.update(purchTable,
                                             productReceiptId,
                                             documentDate,
                                             PurchUpdate::RegisteredAndServices,
                                             AccountOrder::None,
                                             NoYes::No,
                                             printFormletter,
                                             printFormletter);
          ret = true;

          ttscommit;
          return ret;
      }
      If you are using arrival journal, then the following code is the core source >
      public boolean postJournal()
      {
          boolean ret = true;
          WMSJournalCheckPostReception wmsJournalCheckPostReception;
          PurchFormLetter_PackingSlip  purchFormLetter_PackingSlip;
          InventTransferParmTable      inventTransferParmTable;
          WMSJournalTrans              wmsJournalTrans;
          InventTransferUpdReceive     inventTransferUpdReceive;
         // SalesFormLetter_PackingSlip  salesFormLetter_PackingSlip;
          ttsbegin;
              if (this.wmsJournalTable().Posted == NoYes::No)
              {
                  wmsJournalCheckPostReception = WMSJournalCheckPostReception::newTypeJournalTable(JournalCheckPostType::Post, this.wmsJournalTable());
                  wmsJournalCheckPostReception.parmAutoBlock(true);
                  wmsJournalCheckPostReception.parmThrowCheckFailed(true);
                  wmsJournalCheckPostReception.run();
              }
              switch (this.wmsJournalTable().InventTransType)
              {
                  case InventTransType::Purch:
                      purchFormLetter_PackingSlip = PurchFormLetter::construct(DocumentStatus::PackingSlip);
                      purchFormLetter_PackingSlip.showQueryForm(false);
                      purchFormLetter_PackingSlip.update(this.purchTable(),
                                                          this.parmProductReceiptId(),
                                                          systemDateGet(),
                                                          PurchUpdate::RegisteredAndServices,
                                                          AccountOrder::None,
                                                          false,
                                                          false);
                      break;
                  case InventTransType::TransferOrderReceive:
                      while select wmsJournalTrans
                              group by InventTransRefId
                          where   wmsJournalTrans.JournalId == this.wmsJournalTable().JournalId
                              &&  wmsJournalTrans.InventTransType == InventTransType::TransferOrderReceive
                      {
                      inventTransferParmTable.TransferId = wmsJournalTrans.InventTransRefId;
                      inventTransferParmTable.EditLines = true;
                      inventTransferParmTable.AutoReceiveQty = true;
                      inventTransferParmTable.UpdateType = InventTransferUpdateType::Receive;
                      inventTransferParmTable.ReceiveUpdateQty = InventTransferReceiveUpdateQty::Registered;
                      inventTransferParmTable.TransDate = systemDateGet();
                      //Post
                      inventTransferUpdReceive = InventTransferUpdReceive::newParmBuffer(inventTransferParmTable);
                      inventTransferUpdReceive.run();
                      }
                      break;
                  case InventTransType::Sales:
                      //Not implemented
                      break;
              }

          ttscommit;
          return ret;
      }

      Let me know if it helps.  And PS!  super thx for using the barTender solution.  I hope your company also could look into the PDA solution.  It is from this solution that I have copied the code.

  4. Mustafa says:

    Hi Kurt
    Thank you for your valuable post,
    I am trying to create product receipt by code, and used the following sample code:

    My PO contains 2 lines, I created product receipt by the code and the PO status is received now.
    I received 1 just one item.

    I want to invoice the PO based on the created product receipt “PR-1234”

    can you please help me,

    Thanks and Best Regards,

    static void PurchRec(Args _args)
    {
    PurchFormLetter_PackingSlip purchProductReceipt;
    PurchTable purchTbl;
    PurchId purchid;
    PurchLine purchline;
    ;
    // let’s say, product receipt is for PO: ‘ PO-000242′
    purchid = “PO-000242″;
    purchTbl = PurchTable::find(purchid);
    // initiate PurchFormLetter_PackingSlip class
    purchProductReceipt = PurchFormLetter::construct(DocumentStatus::PackingSlip);
    purchProductReceipt.showQueryForm(false);
    ttsBegin;
    select forUpdate purchLine
    where purchLine.PurchId == purchTbl.PurchId
    && purchLine.IsDeleted == NoYes::No;
    && purchLine.itemid == “0001”

    if(purchLine)
    {
    purchLine.PurchReceivedNow = 32;
    purchLine.InventReceivedNow = 32;
    purchLine.doupdate();
    purchProductReceipt.update(purchTbl,”PR-1234″, today(), PurchUpdate::ReceiveNow, AccountOrder::None, false, false);
    info(“done”);
    }
    ttsCommit;
    }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s