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 is one customize optimizer rule that will add a refresh button on the bottom of the marketing documents. This button will refresh the columns data and width of the line data (matrix) on the marketing document.
Requirements
The sample requires coresuite Version 3.50 or higher, and SAP Business One 8.8 or higher.
Procedure to use this small solution
- Download the attached file FAQ_10153_Refresh_Button_on_Documents.cocu
- Import in SAP Business One via > Administration > Add-Ons > coresuite customize > Import / Export > Import rules. In the message box, select “All Active”. Click on “Import”.
To check the rule in action:
- Open an existing Sales Order (for this example, but it can be any marketing document)
- Modify the width of any of the columns on the line data matrix.
- Click on the Refresh button and see that the columns width will be restore and fitted.
Procedure to adjust this small solution
No specific adjustments known.
Preview Sample (Optimizer Rule C#):
string ruleName = pVal.RuleInfo.RuleName.ToString();
string errorMessage = "Error in Optimizer Rule '" + ruleName + "'";
string buttonUID = "COR_CUS_UP";
string buttonLable = "Refresh";
try
{
/* Add the Button to the form */
Button button = Button.CreateNew(buttonUID);
button.SetSizeAndPosition(Button.GetFromUID(pVal.Form, "2"));
button.Value = buttonLable;
button.Left += 2 * (button.Width + 20);
pVal.Form.AddItem(button);
pVal.Form.Update();
/* Create delegate to refresh matrix when clicking on the button */
button.AddHandler_ItemPressed(
SwissAddonFramework.UI.Components.ModeComponent.FormModes.ALL,
null,
delegate (SwissAddonFramework.UI.EventHandling.ItemEvents.ItemPressed eventVal)
{
MenuItem.GetFromUID("1297").Activate();
MenuItem.GetFromUID("1300").Activate();
});
}
catch(System.Exception ex)
{
Debug.WriteMessage(errorMessage + ": " + ex.Message, Debug.DebugLevel.Exception);
}
return true;
Comments
0 comments
Please sign in to leave a comment.