I’ve been asked to validate whether or not certain fields are populated prior to the user exiting order entry.
I have a BPM running on update that catches it there. I also have check events on exit, clear, and the search tool.
I’m at a loss for these two, however. I cannot seem to get an event I can hook into that I can check and do a stop if necessary. Right now, if the fields are blank, the user can click the button to search and select a new sales order or they can type a new one in and it lets them leave. I’d like it such that if they click that button or tab out of that field, I can do a data validation and if the data is missing, then stop the form from changing to the new order.
I tried creating a salesOrderBtn.Click event, but the search dialog comes up and then it runs my code. I would like it to run my code before the search dialog even pops up.
Any ideas?
Ive typically made the native button so small it could not be clicked.
Then I just use a custom button and call something like saleOrderBtn.PerformClick
after running custom code from the custom button. Might not be the best way , but its worked in many places for me.
So, I think I’m missing a piece of the puzzle.
I created my own button and I used the customization wizard to generate a simple search that populated the order number box with the searched order. Default behavior would bring in all of the data for the order at this point. Is there something more that I need to do?
I’m a little confused as to the end goal. Are you just trying to have certain fields required in the dataset before an update? Wouldn’t a data directive BPM be the most simple solution?
The end goal is to require a field at all costs.
There are certain points at which an update never happens, so I’m trying to capture it at all scenarios.
I would argue that there will be no update of that table if you create an appropriate data directive on that table, so that would be the cleanest way. The form might appear to be “updated” but the table won’t accept an update if you choose not to
Here’s the scenario where that doesn’t work.
Create a quote, but leave the dates blank. (We don’t populate the dates in quotes for whatever reason)
Go into Order Entry and use Opportunity/Quote to create an order.
The dates are blank. The user can now exit the sales order without populating those dates. I’m trying to prevent that. This is not the only scenario where this happens; there are others, which is why I’m trying to have it “On Exit”. In order to be “On Exit”, I need to capture searches, exits, clears, etc.
Just doing a check on update, does not work because the update doesn’t always fire.
Good example, I see what you’re getting at now. Let me see if I can play around with a similar scenario and what I can come up with
Basically all I do is call the click of the actual search button from another button with .performclick after running my custom code.
Create a button and add your code to validate.
Then after all your code put in btnKeyField.PerformClick
You will first need to reference the EpiKey on the formload for btnKeyField button.
@mmcwilliams that works well for the button click.
What about when they type into the sales order number field and tab out?
Not sure if it’s easy to disable, but I believe the property EpiKeyField (or similar) determines whether or not it is validated by the system.
You possibly use the click event for txtKeyField to validate as soon as they click on the sales order text to try and change and if not validated dissallow editing.