|
Supplier priority validation |
|
|
|
In this example we are going to create a business rule which will ensure that each supplier code must have a priority defined. Business rules are a suite of SunSystems wide functions to validate, create, move and edit data, either from manual or data import. You can define conditions that determine when, and under what circumstances, a particular process occurs. At the same time you can also define the rules that you apply to an event on data entry. Rules can be used for a variety of purposes such as validation of data, setting of data values, conversations and calculations. On top of that you can establish conditions that control certain processes and actions. When a new business unit is created in Sun, no business rules are created. It’s up to the business to define them. For example, a business process requires that a customer must have certain customer analysis codes, or supplier must have a priority defined. All these validations and many more can be created using SunSystems Business Rules. If you want to read more about Sun business rules read this article.
We are going to use the following business rules functions: 1. Event Profile - EP 2. Rule Message – RMS 3. Rule Set - RS
1. Event Profile - EP Fire up event profile form either by typing EP or going to “Static Data Maintenance” -> “Business Rules” Enter the code Event Profile PRIORITY and click OK. Enter description and click Detail button to be able to create the event condition. Click to see the screenshot The Condition window will pop-up. Click Create button. Now we are going to create the event condition. The first condition of every event profile should be: IF System Function = XXX Select the IF command and then click on OK Select data item from the drop down list and click OK: Rule Common Fields -> Function Code Select the function and click on Ok. Select the operand =. Select your second data item or value: Static Data -> Suppliers Setup and click on OK. The completed event profile should look like this. Click to see the screenshot
2. Rule Message – RMS Now we will create an error message that will be displayed if the asset hasn’t been created with the asset posting preset. They need to be created before they can be used in a rule. Fire up rule message form either by typing RMS or going to “Static Data Maintenance” -> “Business Rules” Select a language code from the drop down list Enter your new message code and click on Ok Enter the message text and click on Ok. Click to see the screenshot
3. Rule Set - RS This is the last function we are going to use. Fire up rule set form either by typing RS or going to “Static Data Maintenance” -> “Business Rules” Choose the event code we created in step 1: PRIORITY Enter the rule code. I have called it 1, you can call it whatever you want. Click to see the screenshot Click on Detail button. The Rule Sets Details window will pop-up. Let’s create the first line. Select command if and click ok Select Value 1 Priority: Function Data Hierarchy -> Basic Information -> Payment -> Priority Select = and click on Ok Select Value 2 SPACE: Keywords -> SPACE By choosing SPACE we check if the priority is blank. Select Y in decision column 1 So, now we are going to create the second line that will show the error message we have created in the step 2. Select command Error As Value 1 select the message code PRIORITY we have created in the step 2: Business Rule Messages -> PRIORITY. Select X in decision column 1. The completed rule set will look like this. Click to see the screenshot Now if you try to enter a supplier in Supplier Setup SUS form and don’t define supplier priority you will be stopped from saving the supplier record and shown the error message: Supplier doesn't have priority defined Click to see the screenshot In this example you have been demonstrated how using powerful SunSystems business rules functionality you can implement your business logic and processes.
Only registered users can write comments. Please login or register. |