How to customize the trace log file for errors and success messages

By | February 27, 2024

Trace files are extensively utilized in Sage X3 software, particularly during lengthy processes like Automatic Invoice Validation or Automatic Work Order Release. When a trace file is displayed, error lines appear in red text, allowing you to navigate through the errors.

To customize a trace file, follow the below steps:

Step 1: We need to open the trace file using the ‘OUVRE_TRACE’ function, as shown in the code below.

New Stuff: How to show comma-separated value for single or multiple fields in Sage X3 reports using crystal report

[Open_Trace_Log_File_Code]
[Open_Trace_Log_File_Code]

Step 2: After opening the log file, we can insert any messages as per our requirements.

Note: To customize a trace file, it’s essential to understand the color codes associated with different messages:

0: Used to display messages in black color.
1: Used to indicate error messages in red color.
-1: Used to present messages in green color.
-2: Used to showcase messages in blue color.

Step 3: Insert a message line using the ‘ECR_TRACE’ function. This function takes two parameters: the first parameter contains the message, and the second contains the color code, as shown in the code below.

[Inserting_Message_Trace_Log_File_Code]
[Inserting_Message_Trace_Log_File_Code]

Step 4: After inserting messages, we need to close this trace file using the ‘FERME_TRACE’ function.

[Close_Trace_Log_File_Code]
[Close_Trace_Log_File_Code]

Step 5: Now we can display our trace log file using the ‘LEC_TRACE’ function.

[Display_Trace_Log_File_Code]
[Display_Trace_Log_File_Code]

Step 6: If you want to delete this trace file, you can use the ‘SUPP_TRACE’ function.

[Delete_Trace_Log_File_Code]
[Delete_Trace_Log_File_Code]

After executing this script, you can view the log file as depicted in the screenshot below.

Note: If you added an error message using the code ‘1’ in the ‘ECR_TRACE’ function, you will receive a popup indicating the number of errors before the log file.

[Number_Of_Errors]
[Number_Of_Errors]
[Log_Reading_Screen]
[Log_Reading_Screen]

By following the above steps, we can customize the trace log file for errors and success messages.

About Us

Greytrix – a globally recognized and one of the oldest Sage Development Partners is a one-stop solution provider for Sage ERP and Sage CRM organizational needs. Being acknowledged and rewarded for multi-man years of experience and expertise, we bring complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third-party add-on development, and implementation competence.

Greytrix has some unique integration solutions developed for Sage CRM with Sage ERPs namely Sage X3Sage IntacctSage 100Sage 500, and Sage 300. We also offer best-in-class Sage ERP and Sage CRM customization and development services to Business Partners, End Users, and Sage PSG worldwide. Greytrix helps in the migration of Sage CRM from Salesforce | ACT! | SalesLogix | Goldmine | Sugar CRM | Maximizer. Our Sage CRM Product Suite includes addons like  Greytrix Business Manager, Sage CRM Project Manager, Sage CRM Resource Planner, Sage CRM Contract Manager, Sage CRM Event Manager, Sage CRM Budget Planner, Gmail Integration, Sage CRM Mobile Service Signature, Sage CRM CTI Framework.

Greytrix is a recognized Sage Champion Partner for GUMU™ Sage X3 – Sage CRM integration listed on Sage Marketplace and Sage CRM – Sage Intacct integration listed on Sage Intacct Marketplace. The GUMU™ Cloud framework by Greytrix forms the backbone of cloud integrations that are managed in real-time for the processing and execution of application programs at the click of a button.

For more information on our integration solutions, please contact us at sage@greytrix.com. We will be glad to assist you.