Password Option

NAVEDINAVEDI Member Posts: 3
Hi,

I have created a function in the EDI Receive where if the EDI price does not match the Navision Unit Price for an item it will not create a sales order. I want to add the ability to use a password to "force" the sales order to create.

Any ideas?

Comments

  • ara3nara3n Member Posts: 9,256
    I suggest a different approach.

    Instead add a field to User Setup to allow override.

    Then change the code to check this field and if's checked and GUIALLOWED then confirm that the price is different and if the user wants to continue.

    If UserSetup doesn't exist or is not checked error out.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • SavatageSavatage Member Posts: 7,142
    The Lanham edi adds some fields to the sales line like "EDI Unit Price" & "EDI Price Discrepancy (Boolean)"

    Then it's easy to filter on that field "YES" to see which items are an issue. Then it's up to you to let them go or delete them.

    Even easier if you add a menuitem to do the filtering for you. That's what we did.
    Caption:"Find EDI Price Discepancy"
    PushAction:RunObject
    Runobject:Form Sales Lines
    RunFormView:SORTING(Document Type,Shelf/Bin No.,No.) ORDER(Ascending) WHERE(Document Type=FILTER(Order),EDI Price Discrepancy=FILTER(Yes))

    So if you make it stop with a pop-up message and you have a lot of orders - it's alot of clicking.
    This way the orders pass & then all the questionable lines can be viewed at once.
  • NAVEDINAVEDI Member Posts: 3
    thanks for the tips, unfortunately we have to stop the orders from coming in. the person who is suppose to check these are still letting the orders go to shipping despite the Boolean being checked. But I need to add a force to create the sales order if there is approval for the order to go at the "incorrect" price.
  • SavatageSavatage Member Posts: 7,142
    Are you saying you are using Lanham edi? But need a mod to it?

    If you are using lanham then you need to look at CU 14000361 - EDI Create Sales Order
    There is a section as shown below that will determine that their is a price discrepancy..
    SalesLine.VALIDATE(SalesLine.Quantity,LastQty);
    IF LastUnitPrice <> 0 THEN
      SalesLine.VALIDATE("Unit Price",LastUnitPrice);
    IF LastEDIUnitPrice <> 0 THEN BEGIN
      SalesLine.VALIDATE(SalesLine."EDI Unit Price",LastEDIUnitPrice);
      IF SalesLine."Unit Price" <> SalesLine."EDI Unit Price" THEN
        SalesLine."EDI Price Discrepancy" := TRUE;
    END;
    

    Now are you looking to add a dialog message afterward?
    If SalesLine."EDI Price Discrepancy" then begin
     if CONFIRM('This order has a Price Discrepancy Item:%1 Price:%2 EdiPrice:%3 Continue?',Salesline."No.",SalesLine."Unit Price",SalesLine."EDI Unit Price", FALSE,TRUE)
     then error('Order Stopped');
    end; //not tested just a rough thought.
    
    Personally I like creating the order and viewing the differences after. That requires just training, no code, no mod.

    Another way if you create the order is to place code on CU 414 Release Sales Document.
    On release it can rifle thru the lines and error on if it hits SalesLine."EDI Price Discrepancy" := TRUE
    OnRun()
    SalesLine.SETRANGE("Document Type","Document Type");
    SalesLine.SETRANGE("Document No.","No.");
    SalesLine.SETFILTER("EDI Price Discrepancy",TRUE);
    IF SalesLine.FIND('-') THEN
      ERROR('Price Discrepancy Exists On %1 %2',"Document Type","No.");
    
Sign In or Register to comment.