DOC - Block A/R Invoices based on Sales Order or Quotation

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.


Attached are 2 customize optimizer rules that prevent adding A/R Invoices which are based on Sales Orders or Sales Quotations. For certain business process it is important that invoices are only issued after the delivery note - not directly from sales orders or sales quotations. Generally, this produces more reliable reporting in a variety of use case scenarios.


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_10150_Block_invoices_based_on_Order_or_Quotation.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 (sample invoice document):
  1. Open a new A/R Invoice and enter Business Partner with open Sales Orders
  2. Select the Copy From button and select Sales Orders
  3. Select a Sales Order and draw all data
  4. Try to add the invoice and see that it will not be possible and instead an Statusbar error appears to tell you that you need to create a delivery first.

Procedure to adjust this small solution

The rule could be adjusted for different processes, for example allowing Sales Orders and as to the requirements of the customer's specific business processes.

Preview Sample (Optimizer Rule C#):

string ruleName = pVal.RuleInfo.RuleName.ToString();
string errorMessage = "Error in Optimizer Rule '" + ruleName + "'";
string msgOrder = "Direct Copy from Sales Order to A/R Invoice or A/R Reserve Invoice is not allowed. Please book a Delivery first.";
string msgQuotation = "Direct Copy from Sales Quotation to A/R Invoice or A/R Reserve Invoice is not allowed. Please book Sales Order and Delivery first.";
Matrix mtr = Matrix.GetFromUID(pVal.Form, "38");
for(int i = 0; i < mtr.Rows.Count - 1; i++)
if(mtr.GetValue("43", i).ToString() == "17")
return false;

if(mtr.GetValue("43", i).ToString() == "23")
return false;
catch(System.Exception ex)
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



Please sign in to leave a comment.