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)

VST -Validate customer in cash receipts

(0) ShareShare
ReportReport
Posted on by

I have created an add-in with visual studio tools. The add-in was created to add extra criteria to validate customer on cash receipts. I want to stop the ability of cash receipts for certain customers. I added a method for ValidateBeforeOriginal for customer field. it stops the adding of the customer and leaves the field highlighted. I have set cancel to true for the ValidateBeforeOriginal. The problem is it also gives a warning that you can't change customers on a document, If you try to change the customer. I've tried LeaveBeforeOriginal. It does not work.

Any ideas! I need to make the window know that the customer is wrong.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Andrew John Dean Profile Picture
    1,337 on at

    You probably need to set the CustomerID to ( see code example below)

     

            void CustomerNumber_ValidateBeforeOriginal(object sender, System.ComponentModel.CancelEventArgs e)

            {

                if (rmCashReceiptsWindow.CustomerNumber.Value == "AARONFIT0001")

                {

                    rmCashReceiptsWindow.CustomerNumber.Value = "";

                    MessageBox.Show("Invalid customer selected.");

                    e.Cancel = true;

                }

            }

     

    Regards

    Andrew Dean

  • Tim W Profile Picture
    2,925 on at

    I've been through this window before working on turning off the feature that keeps the customer id populated for the next receipt so have dug in a bit on the code here.  I believe there is also an '(L) Old Customer ID' field that you should also clear when you clear the Customer Number.  The code continually compares values in those fields and I'm guessing that is where the warning message is popping from.

    Just a shot.

    Tim

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