web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

GP 2010 SOP Likne Scroll Area

(0) ShareShare
ReportReport
Posted on by 75,850 Moderator

I am trying to trap the event when a user changes the sell price of an item. All I want to do is capture and display a box that say "Hey dummy, you are trying to change the sell price, do you really want to be doing that???" I am using VS C# and all works well with the exception I do not want this check to occur when the user is entering a new line on the order in the Line Scroll area. What can I use in my code as an indication that this is a new line?

 

Here is my current code:

/*Register a change event for the Unit Sell Price field of the Line Scroll window on the sales transaction entry window*/

sopEntryWindow.LineScroll.LocalUnitPrice.Change +=

 

new EventHandler(CheckForLineValueChanges);

/* Check for line value change of the field LocalUnitPrice */

 

 

 

public void CheckForLineValueChanges(object sender, EventArgs e)

{

    sopEntryWindow.LineScroll.LocalUnitPrice.LeaveAfterOriginal +=

 

new EventHandler(SellPriceChangeNotification);

}

 

 

/* Notify the user that the sell price has been changed and prompt for confirmation and reason */

 

 

public void SellPriceChangeNotification(object sender, EventArgs e)

{

 

 

if (SOPCheckSellPriceForm == null)

    {

        SOPCheckSellPriceForm =

 

new frmSOPCheckSellPrice();

    }

 

 

    else

    {

 

 

    if (SOPCheckSellPriceForm.Created == false)

    {

        SOPCheckSellPriceForm =

 

new frmSOPCheckSellPrice(LocalUnitSellPrice,UnitSellPrice);

    }

}

 

 

/* Display notificaction that user has changed sell price */

SOPCheckSellPriceForm.Show();

SOPCheckSellPriceForm.Activate();

}

 

 

 

public void CheckForLineValueChanges(object sender, EventArgs e)

{

    sopEntryWindow.LineScroll.LocalUnitPrice.LeaveAfterOriginal +=

 

new EventHandler(SellPriceChangeNotification);

}

 

 

/* Notify the user that the sell price has been changed and prompt for confirmation and reason */

 

 

public void SellPriceChangeNotification(object sender, EventArgs e)

{

 

 

if (SOPCheckSellPriceForm == null)

    {

        SOPCheckSellPriceForm =

 

new frmSOPCheckSellPrice();

    }

 

 

    else

    {

 

 

    if (SOPCheckSellPriceForm.Created == false)

    {

        SOPCheckSellPriceForm =

 

new frmSOPCheckSellPrice(LocalUnitSellPrice,UnitSellPrice);

    }

}

 

 

/* Display notificaction that user has changed sell price */

SOPCheckSellPriceForm.Show();

SOPCheckSellPriceForm.Activate();

}

 

 

 

public void CheckForLineValueChanges(object sender, EventArgs e)

{

    sopEntryWindow.LineScroll.LocalUnitPrice.LeaveAfterOriginal +=

 

new EventHandler(SellPriceChangeNotification);

}

 

 

/* Notify the user that the sell price has been changed and prompt for confirmation and reason */

 

 

public void SellPriceChangeNotification(object sender, EventArgs e)

{

 

 

if (SOPCheckSellPriceForm == null)

    {

        SOPCheckSellPriceForm =

 

new frmSOPCheckSellPrice();

    }

 

 

    else

    {

 

 

    if (SOPCheckSellPriceForm.Created == false)

    {

        SOPCheckSellPriceForm =

 

new frmSOPCheckSellPrice(LocalUnitSellPrice,UnitSellPrice);

    }

}

 

 

/* Display notificaction that user has changed sell price */

SOPCheckSellPriceForm.Show();

SOPCheckSellPriceForm.Activate();

}

 

 

public void CheckForLineValueChanges(object sender, EventArgs e)

{

    sopEntryWindow.LineScroll.LocalUnitPrice.LeaveAfterOriginal +=

 

new EventHandler(SellPriceChangeNotification);

}

 

 

/* Notify the user that the sell price has been changed and prompt for confirmation and reason */

 

 

public void SellPriceChangeNotification(object sender, EventArgs e)

{

 

 

if (SOPCheckSellPriceForm == null)

    {

        SOPCheckSellPriceForm =

 

new frmSOPCheckSellPrice();

    }

 

 

    else

    {

 

 

    if (SOPCheckSellPriceForm.Created == false)

    {

        SOPCheckSellPriceForm =

 

new frmSOPCheckSellPrice(LocalUnitSellPrice,UnitSellPrice);

    }

}

 

 

/* Display notificaction that user has changed sell price */

SOPCheckSellPriceForm.Show();

SOPCheckSellPriceForm.Activate();

}

 

 

*This post is locked for comments

I have the same question (0)
  • Richard Wheeler Profile Picture
    75,850 Moderator on at

    OK, I think the solution is this.

    When you go to create a new line in the line scroll area, the line is not added to the SOP line table until you move to the next line. So they way to tell if it is a new line is to check to see if it exists in the SOP10200 table. If it does not, then it is a new line. Now the question is how do you do that using VS C#?

  • Dave Dusek Profile Picture
    on at

    Richard,  Use the ValidateBeforeOriginal or ValidateAfterOriginal events.  Those will only run if the user actually tries to change the field.  The change event is going to run whenever the field changes whether the user did it or not.  

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans