Notifications
Announcements
No record found.
I have some C# code that allows the user to change the batch ID on the Sales Transaction Entry screen. I am doing this because I need to execute code behind the scenes as the batch ID is changed. The problem I have encounter is that the screen does not sense the change so as the user moves passed the batch ID field the user does not get the prompt about batch not existing, do you want to add it. Is there a way to trigger that routine so they will be prompted? If not, I will move my code to an event that senses the the batch ID being changed.
Hi Richard
The ValidateAfterOriginal event should capture whenever the field is changed by the user.
Is that what you are using?
Regards
David
What is the difference between ValidateAfterOriginal and LeaveAfterOriginal?
LeaveAfterOriginal is the equivalent of a dexterity trigger after the Field Post Script.
ValidateAfterOriginal is the equivalent of a dexterity trigger after the Field Change Script.
The field post event happens when the focus leaves the field even if the field did not change.
The field change event happens when the focus leaves the field AND that field has been changed OR if the change script on that field has been executed (even if the field did not have focus).
Richard
You should do Dexterity training, then you will understand lots more about how GP works and what VS Tools does, because VS tools is just exposing Dexterity functionality to C# and VB.Net.
Sounds like ValidateAfterOriginal is the better choice here as I only want my code to fire if the batch ID has been changed.
Are there any Dexterity training videos?
Dexterity is best learnt with the five day training course, but as I am not coming to Summit this year, we won't be running it.
You can also learn it will self study of the training manuals combined with some consulting time with me to make sure the concepts are bedded down.
David, I am treating myself to my annual fishing trip next week. Perhaps during the last week of September or the beginning of October we can connect. Where do I find the the Dexterity training manuals?
Email me directly and we can work something out.
Try this code, since I don't know when and from where you are trying to set batch number field, I just created this simple scenario.
public void Initialize() { sopEntryWindow.CustomerNumber.ValidateAfterOriginal = CustomerNumber_ValidateAfterOriginal; } private void CustomerNumber_ValidateAfterOriginal(object sender, EventArgs e) { if (sopEntryWindow.DocumentId.Value == "STDINV") { sopEntryWindow.BatchNumber.Focus(); sopEntryWindow.BatchNumber.Clear(); sopEntryWindow.BatchNumber.Value = "VSTOOLS"; sopEntryWindow.BatchNumber.ForceValidate(true); } }
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 664 Most Valuable Professional
André Arnaud de Cal... 522 Super User 2025 Season 2
Sohaib Cheema 303 User Group Leader