Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Automatically field is not updating in sales line table

(0) ShareShare
ReportReport
Posted on by 387

Dear Experts,

In blanket order I have created a field named as "Blanket order balanced quantity"
When we create a sell order from the Blanket sales order then how much balance quantity is left in the blanket order gets updated to the Blanket sales order balanced quantity.
But when we go to sales order and delete the line of that sales order then this field is not getting updated automatically in blanket order.

I have write the code on sales line table on (OnDelete() Button)

OnDelete()

IF (Type=Type::Item) AND ("Document Type"="Document Type"::Order) THEN BEGIN
IF "Line No."=0 THEN BEGIN
SalesLine2."Blanket Sales Order Bal. Qty.":=SalesLine2.Quantity;
SalesLine2.MODIFY;
END;
END;

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 77,925 Super User 2025 Season 1 on at
    RE: Automatically field is not updating in sales line table

    Hi, I agree with Nitin, using FlowField is the easiest solution. Because you don't need to think about when to update this field.

    https://docs.microsoft.com/en-us/dynamics-nav/flowfields

    Hope this helps.
    Thanks.

    ZHU

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 997 Moderator on at
    RE: Automatically field is not updating in sales line table

    You are not sharing your complete code. But as far as i can see you will also execute this code for all sales orders and not only the blanket orders?

  • Suggested answer
    Binesh Profile Picture
    Binesh 7,885 on at
    RE: Automatically field is not updating in sales line table

    Hello,

    Why Line No. = 0???

    Remove this statement and also check,

    I hope SalesLine2 has a record which you want to modify.

  • navision begginers Profile Picture
    navision begginers 387 on at
    RE: Automatically field is not updating in sales line table

    sir,

    Blanket sales order and sales order table is the same then how can we create flow field in it.

    When a sales order is created with help of Blanket Order, it is auto updated in blanket order.

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,273 Moderator on at
    RE: Automatically field is not updating in sales line table

    Hi,

    Can you try to create a flow field?

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,309 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans