GEN - Best Practise coresuite customize rules - coding templates

Important Notes

The samples and information below is provided without a warranty of any kind. This post is for informational purposes and coresystems ag assumes no responsibility for errors or omissions in the information provided.


Purpose

Attached are 6 rules to be used as templates when creating Optimizer, New Menu or Function Button rule with C# or VB.

These template rules should be used by every developer to follow best practise guidelines in relatation to description and error handling. This ensures easier maintenance and trouble shooting of customize rules.


Requirements

The templates require coresuite Version 3.50 or higher, and SAP Business One 8.8 or higher.


Procedure to use these templates

1. Download the attached FAQ_10121_TEMPLATES.cocu file
2. Import in SAP Business One via > Administration > Add-Ons > coresuite customize > Import / Export > Import rulesIn the message box, select “All Inactive”. Click on “Import”.
3. Whenever you want to create a new Optimizer, Function Button or New Menu rule with C# or VB duplicate the corresponding rules and adjust the name and code according to your requirements


Procedure to adjust these templates

Adjust the rule name and description and add your code under
// Your Code

Preview Sample (Optimizer Rule C#):

/*
***** General Information *****
Creator: <company name>, <devleoper name, email or initials>
Create Date: YYYY-MM-DD
 
***** StartConfDesc *****
<Your Description of the Customize Rule in English>
***** EndConfDesc *****
 
***** Updates *****
YYYY-MM-DD, name: Update Comment
*/

string ruleName = pVal.RuleInfo.RuleName.ToString();
string errorMessage = "Error in Optimizer Rule '" + ruleName + "'";
 
try
{
StatusBar.WriteWarning("DEBUG - Rule: " + ruleName + " was triggered.");
// Your Code
}
 
catch(System.Exception ex)
{
MessageBox.Show(errorMessage + ": \n" + ex.Message, "OK");
StatusBar.WriteError(errorMessage + ": " + ex.Message);
Debug.WriteMessage(errorMessage + ": " + ex.Message, Debug.DebugLevel.Exception);
}
return true;
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Article is closed for comments.