Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV forum
Suggested answer

Automatically field is not updating in sales line table

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 70,099 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,744 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,025 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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,558 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,645 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans