Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Best way to modify line items automatically

Posted on by 150

Let's say I have 3 items on an order or invoice.  I want to enter another line item that specifies a discount or cut off each line item, let's say 5% off.

I want to be able to auto update the amounts on the 3 items to take the 5% off when there is this line item present.

I was thinking I can do this when the user presses Save but I can't seem to access that underlying code or logic.

Has anyone experienced this?  What would be the best way to do this?

Thanks, appreciate it.

*This post is locked for comments

  • Almas Mahfooz Profile Picture
    Almas Mahfooz 11,003 User Group Leader on at
    RE: Best way to modify line items automatically

    I like the first way, it's clever.

    +10 points to Richard. :)

  • Suggested answer
    runner_code_82 Profile Picture
    runner_code_82 150 on at
    RE: Best way to modify line items automatically

    Ah I totally forgot about triggers!

    I like the idea of modifying it via the reports.

    Thanks, this might work!

  • Verified answer
    Richard Whaley Profile Picture
    Richard Whaley 25,195 on at
    RE: Best way to modify line items automatically

    The easiest way to do this would be to put a quantity of -1 for the extra line item and calculate the discount amount in total.  This would reduce the total amount.

    A second way would be to print your invoices using Crystal or SSRS and Accountable Forms Printer to integrate the document.  The line can be used like above but when the SSRS document sees the line, it adjusts the costs on each line and does not print your extra line.

    You could write a trigger and place it on the SOP10200 table.  When the extra line is added and not deleted first, you can then  write SQL code to update the lines.  You would not need to put any value on the extra line.  The reason for doing the update ONLY when the line is added but not deleted is that if you edit the line, GP will first delete it and then add it back.  You can test for this in the trigger.

    If you are not a SQL expert with trigger experience, have someone that is do this for you.

  • runner_code_82 Profile Picture
    runner_code_82 150 on at
    RE: Best way to modify line items automatically

    Hi Somak K,

    I'm not sure what you mean by in dexterity?  Can you explain?  I'm not sure what you mean.

    Rey

  • soma Profile Picture
    soma 24,406 on at
    RE: Best way to modify line items automatically

    Do you want the logic for modify line items in dexterity?

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

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans