Change of Filtering Required - Purchase Req to Purch Order

carlcarl Member Posts: 19
Dear All,

With standard NAV if you have two purchase requistion lines with different vendors (e.g. Vendor A and Vendor B) the application will transform these requisition lines into two seperate Purchase Orders (one for Vendor A and one for Vendor B).

A client of ours requires a change in the way NAV goes about the above filtering/grouping. The client requires for a new Purchase Order to be created following the below criteria:
- Different Vendors (standard NAV)
- Different Buyer ID (this is a new field in purch req. lines)
- DIfferent Department (this is a new field in purch req. lines)

In other words if two requisition lines have the same Vendor but different Buyer ID's, or same vendors, same buyer IDs but different departments a new purchase order (with its respective lines) is to be created in each case.

I have been experimenting with Codeunit 333 - Req. Wksh.-Make Order but I haven't managed to achieve the above as yet. Has anyone ever encountered such a situation?

Any ideas would be much appreciated.

Regards,
Carl.

Comments

  • rajatkaliarajatkalia Member Posts: 65
    Hi Carl

    regarding department code, this can be made available by treating it as a global dimension. this is reflected in the respective PO line and then a single PO can be there with multiple lines if you are ok with a single PO.

    For Buyer ID do you want the user id who has created or the Purchaser code.


    Regards,
    Rajat.
  • carlcarl Member Posts: 19
    Hi Rajat,

    Thanks for your reply. Regarding the department, in our case this is a new field and we cannot use dimensions. Regarding the Buyer ID this will be linked to the Purchaser Code.

    The client wants his PO’s to be split according to these 3 fields (not only vendor no. as in standard nav). I have tried to modify Codeunit 333 but I haven’t managed to reach the required result as yet. Is this the right codeunit to modify? And if so any ideas of which part can I modify?

    Regards,
    Carl.
  • rajatkaliarajatkalia Member Posts: 65
    Hi Carl

    The person who creates req worksheet, he only would be updating the purchaser code and vendor or the req worksheet is created by one user nd then another user updates that and then does carry out action message. if the same user does then u can play around req worksheet batches.

    Have u tried to explore the Purch quote option instead of using Req worksheet?


    Regards,
    Rajat
  • swjswj Member Posts: 68
    Yes, the code unit is code unit 333.

    Just roughly guess, it should be at InsertPurchOrderLine function..on check condition when system will create new header...

    IF (PurchOrderHeader."Buy-from Vendor No." <> "Vendor No.") OR
    (PurchOrderHeader."Sell-to Customer No." <> "Sell-to Customer No.") OR
    (PrevShipToCode <> "Ship-to Code") OR
    (PurchOrderHeader."Order Address Code" <> "Order Address Code") OR
    (PurchOrderHeader."Currency Code" <> "Currency Code") OR
    (PrevPurchCode <> "Purchasing Code")
    THEN BEGIN
    InsertHeader(ReqLine2);
    LineCount := 0;
    NextLineNo := 0;
    PrevPurchCode := "Purchasing Code";
    PrevShipToCode := "Ship-to Code";
    END;
  • carlcarl Member Posts: 19
    @ Rajat: Thanks for the different batches idea. The only problem is that this company has hundreds of department and thus creating a different batch for each department might not be viable.

    @swj: Thanks for your reply.The code you pasted is the exact customisation I did :) Somehow it is ignoring my code completely.
  • swjswj Member Posts: 68
    Hello,

    The 2 new fields that added in Req. Line, should be populated at Purchase Header also in function "InsertHeader".

    What field do you use for these fields in Purchase Header Table? If you didn't populate, they will be always same value when you compare.
Sign In or Register to comment.