Follow

DOC - Add a Refresh Button to Marketing Documents

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

  1. Download the attached file FAQ_10153_Refresh_Button_on_Documents.cocu
  2. 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:
  1. Open an existing Sales Order (for this example, but it can be any marketing document)
  2. Modify the width of any of the columns on the line data matrix.
  3. 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;
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.