We’re working on a customization to our Part Entry so we can better control the Part Numbers that can be created in our system.
To summarize, we have a different part number “counter” for each Part Class. So the user has to first choose a Part Class, then click a button to get the next available Part Number for that Part Class. This all works… but we’ve had to jump through some hoops to block some system default functionality for adding parts. For example, if a user types a non-existing part number into the Part Search… the system prompts: “Record not found. Add new?”
In this way a user can create any “Part Number” they want… outside of our Part Numbering scheme.
On the Part Entry Landing Page… we’ve set the Part Search field to read-only, search only. However, the problem I’m currently having is that when the page first loads, the cursor is placed inside that Part Search field by default. So, even though the Part Number field is read-only/search-only… when the page first loads, I can type in a non-existing part number and get the “Add new?” prompt:
If I click outside of that Part Search field on the Landing Page, I cannot click back in… so the read-only functionality works. But the problem is, it is “in focus” when the form initially loads.
Is there any way to automatically shift focus anywhere else when the Landing Page first opens?
Or… even better… is there any way to turn off the “Record not found. Add new?” functionality?
We have one Data Directive on Part but it is being used to pre-populate the Part Type (Manufactured, Purchased, etc.) of the Part being created. We have a default Part Type assigned to each Part Class, so when a Part is created under a particular Part Class, that Directive just sets a default value into the Part Type field.
So… no… we don’t have anything set up that would prevent the saving of a new part.
Data Directives are best when you want to guard a table regardless of method. They should be short and efficient since they are called every time the table is hit. Test and exit quickly if you can. You can have more than one so I would run the Part Number check first and throw an exception to prevent others from running. Check if it’s an add and only run your check then.
If you went in Insights - (or know someone) - The labbook has a good example of creating sequence ID (partNums) using a function.
This added with a BPM form - may help you out.
Advanced BPMs (Business Process Management) and Epicor Functions 201
Epicor Functions allow defining orchestrations of a business process as a standalone, dynamically crafted service that can be used across BPM, Client customization in WinForms or Kinetic Forms, or as an integration point to external systems that the customer needs to integrate against.
At the conclusion of this lab, you will be able to: