Skip to main content

Notifications

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 74,036 Super User 2024 Season 2 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 32,748 Super User 2024 Season 1 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,091 Super User 2024 Season 1 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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans