Options

Purchase line can be modified after the PO is released?

koaladokoalado Member Posts: 70
After the PO is approved, the PO status change to 'Released'. But the buyer still can change the PO lines (Quantities, Price and etc). I checked their rights on table 'Purchase Line'. all the buyers have insert, modify and delete rights.
I'm Super. When I test it with my account, it will prompts error as what I expect. "The PO must be Reopened ".
Please help! Thanks

Comments

  • Options
    krikikriki Member, Moderator Posts: 9,090
    The only thing I can think of:
    In table 39, when you change a field, it calls function "TestStatusOpen()". This functions calls "GetPurchHeader()" and if the the header is still the same as the one in the last "GetPurchHeader()"-call, then Navision doesn't get the purchase header anymore.

    Maybe the release of the purchase header has been changed from calling the codeunit in the properties of the menu-item to calling it with C/AL code. In this case, try to do a CurrForm.UPDATE(FALSE) after calling the codeunit.


    If previous trick doesn't work, try this: in T39, function "GetPurchHeader()" in stead of the code like:
    TESTFIELD("Document No.");
    IF ("Document Type" <> PurchHeader."Document Type") OR ("Document No." <> PurchHeader."No.") THEN BEGIN
      PurchHeader.GET("Document Type","Document No.");
      IF PurchHeader."Currency Code" = '' THEN
        Currency.InitRoundingPrecision
      ELSE BEGIN
        PurchHeader.TESTFIELD("Currency Factor");
        Currency.GET(PurchHeader."Currency Code");
        Currency.TESTFIELD("Amount Rounding Precision");
      END;
    END;
    

    Try:
    TESTFIELD("Document No.");
    PurchHeader.GET("Document Type","Document No.");
    IF PurchHeader."Currency Code" = '' THEN
      Currency.InitRoundingPrecision
    ELSE BEGIN
      PurchHeader.TESTFIELD("Currency Factor");
      Currency.GET(PurchHeader."Currency Code");
      Currency.TESTFIELD("Amount Rounding Precision");
    END;
    

    But this has the problem that it will always get to the disk to get the purchase header.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    jonsan21jonsan21 Member Posts: 118
    Maybe the buyer Reopen the PO and Released it again?

    Not a very bright answer, I know :p

    Rgds,

    Jon.
    Rgds,

    Jon.
  • Options
    krikikriki Member, Moderator Posts: 9,090
    Maybe the buyer Reopen the PO and Released it again?

    Not a very bright answer, I know
    Actually, it is a very good question. It is so obvious, I didn't even consider it.
    But with users we should always start with the most obvious questions.


    -User to helpdesk: my computer doesn't function.
    -After a lot of questions, the helpdesk finds out that there is a black-out....
    You can read this story at www.techtales.com
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • Options
    koaladokoalado Member Posts: 70
    Hi all:
    Problem solved. I traced the program as you mentioned and found only PO's status <Type::Item> and <Type::"Fix Assets"> will be checked if it's Open when we try to modify purchase lines. But what I want is another type "G/L Account" should also be checked. So, I add that type to function <TypeStatusOpen>. Yeah, that works.
    Thanks again.
Sign In or Register to comment.