DOC - Get Natureza da Operação

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.

This rule is specific for the Brazilian localization, but the logic could be use for other similar purposes.


Attached is one Easy Function rule that will get the description of the CFOP (Código Fiscal De Operações e Prestações) code and add it to a UDF (U_CFOPDesc) in the matrix line.


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 DOC_10175_Get_Nat... file

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”.

3. Create the UDF U_CFOPDesc as seen in the picture and place the column in the matrix next to the CFOP field.



To check the rule in action:

Just get an A/R Invoice or Sales Order and tab out of the CFOP field and the description should be populated into the UDF field.

Procedure to adjust these templates

Only forms 133,139 (A/R Invoice, Sales Orders) are supported. If other marketing documents are needed just add the form ID on the ItemUID on the Trigger area in the Optimizer window.


Preview Sample (Optimizer Rule C#):


SELECT '@@Condition1'

Parameters and Functions:

Condition1:<command>:Active Form
SQLQuery("CFOPDesc|SELECT Descrip FROM OCFP WHERE Code = '$[$38.2009.0]'")
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request



Please sign in to leave a comment.