Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Assign FG functionality(unable to update the check box value in punching master form)

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

I am new to NAV, any help will be appreciated.

I have created the new field in the Punching master table as"shipped"(boolean).

My problem is -

when i ship the quantity from the sales order form then the shipped field for the particular serial number in the punching card master should be checked as true.

Regards,

Aditi

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Assign FG functionality(unable to update the check box value in punching master form)

    How it got resolved?

    Pl. mark the relevant answer verified, if it helped you.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Assign FG functionality(unable to update the check box value in punching master form)

    Thank you for your advice :)

    I resolved the issue.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Assign FG functionality(unable to update the check box value in punching master form)

    As I can see, your code seems correct and you should be able to update the boolean field properly, provided you have the data available in the respected table.

    Debug the code and try to find out the reason.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Assign FG functionality(unable to update the check box value in punching master form)

    Ideally, you should not write such Repeat Until loop in Posting the Sales Order. This should affect the performance very badly.

    Check the possibilities of inserting the same code in CU 22 as mentioned above.

    Meanwhile, have you debug your above code and checked, if you are finding the reservation entries and related punching master record for required updation?

    Also,

    • Always set the proper key during filtering (Like Reservation Entry & Punching Master in your case)
    • Avoid using Setfilter, if Setrange can work
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Assign FG functionality(unable to update the check box value in punching master form)

    Hello,

    Thanks for the reply.

    I have written the code in the CU-80- sales post.

    when i click on post and choose ship then after shipping the Boolean value should be updated in the punching master as true.

    following is the code i have written :

          //START-032

            lrecReservationEntry.RESET;

            lrecReservationEntry.SETRANGE("Item No.",SalesLine."No.");

            lrecReservationEntry.SETRANGE("Source ID",SalesLine."Document No.");

            lrecReservationEntry.SETRANGE("Source Ref. No.",SalesLine."Line No.");

            lrecReservationEntry.SETRANGE("Source Type",DATABASE::"Sales Line");

            lrecReservationEntry.SETRANGE("Source Subtype",1);

            IF lrecReservationEntry.FINDSET THEN BEGIN

             REPEAT

                lrecPunchingMaster.RESET;

                lrecPunchingMaster.SETFILTER("Item No.",lrecReservationEntry."Item No.");

                lrecPunchingMaster.SETFILTER("W.O.No.",lrecReservationEntry."Source ID");

                lrecPunchingMaster.SETRANGE("W.O.Line. No.",lrecReservationEntry."Source Ref. No.");

                lrecPunchingMaster.SETFILTER("Valve Serial No.",lrecReservationEntry."Serial No.");

                IF lrecPunchingMaster.FINDFIRST THEN

                BEGIN

                  lrecPunchingMaster.Shipped:=TRUE;

                  lrecPunchingMaster.MODIFY;

                END;

             UNTIL lrecReservationEntry.NEXT=0;

            END;

          //STOP-032

    with this code i am unable to update the Boolean value.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Assign FG functionality(unable to update the check box value in punching master form)

    Punching Master table seems customized table.

    You really need to go through the code and relatively update the field while posting the sales shipment.

    In case, if you have unique Serial No. record in Punching Master, you can write the code in CU 22 - InsertItemLedgerEntry Function to update the boolean at Punching Master table.

    Hope this helps.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans