Learn how to integrate Excel files into SEI or SQL databases, using ODBC technology to combine Excel data with ERP...
Latest posts
-
Integrating Excel Files into SEI and SQL for Global Reporting via ODBCRead more -
VAT Simulation Before Invoice Generation in Sage X310/24/2024Read moreLearn how to simulate VAT in Sage X3 before generating an invoice, enabling accurate financial forecasts that include...
-
Optimizing Imports in Sage X3 with Multithread Batch Processing10/24/2024Read moreLearn how to optimize imports in Sage X3 with multithread batch processing by parallelizing tasks to reduce execution...
-
Document Download in Sage X3 Using 4GL Language01/19/2024Read moreExplore a method for Sage X3 developers to enhance user experience by simplifying document downloads from the server...
-
In-Depth Exploration of the New Container Management Feature in Sage X308/30/2023Read moreDiscover the revolutionary Container Management feature in Sage X3. Enhance operational efficiency and traceability...
-
EXEC_JS / streamline.js / Sage X3 Syracuse Javascript bundles07/19/2022Read moreSage X3: Overcoming Limitations with the Bridge between 4GL and JavaScript Sage X3 4GL can sometimes encounter...
-
Capturing Detailed Errors After a Silent Import in Sage X312/16/2021Read moreDiscover how to effectively capture detailed errors after performing a silent import in Sage X3. Learn methods to...
-
How to connect an external database in Sage Enterprise Intelligence with an identifier containing a dot ?12/15/2021Read moreLearn how to address issues with special characters in database identifiers when using Sage Enterprise Intelligence....
-
Exploring the ATEXTRA Table for Storing Translated Text in Applications12/15/2021Read moreDive into the ATEXTRA table, a crucial tool for storing translated text within applications. Discover how it manages...
-
Troubleshooting Sage X3 Folder Validation Errors12/15/2021Read moreLearn about common validation errors when creating or importing folders in Sage X3 and how to resolve them.
Blog categories
Search in blog
Capturing Detailed Errors After a Silent Import in Sage X3
You're likely familiar with manually generating CSV files for import through templates in Sage X3. But have you ever wondered how to capture detailed errors after a silent import? We have the solution for you.
There are instances where capturing incoming errors becomes essential, especially when you need to promptly alert end-users about issues like closed periods or incorrect dates. Unfortunately, the standard Sage X3 silent import function doesn't inherently display detailed errors during the import process.
Here's how you can overcome this limitation:
Start by calling the IMPORTSIL function:
Call IMPORTSIL([M:IMP2]MODIMP, [M:IMP2]NOMIMP) From GIMPOBJ
However, the standard ERR_IMPORT function will only provide an overall status of the importation without the specifics of errors. To address this limitation, you can utilize the following techniques:
-
The
IMPORTSILfunction captures log data in a trace file to prevent popups on the end-user's screen. -
Examine the log file for any potential errors. Sage X3 runtime adheres to the same logging standards as typical shells.
-
0001= Errors output -
0000= Standard output

This procedure ensures that you have a clear overview of the import process and any errors encountered.
For further clarity, consider the following example:
1) Initiate a silent import call in 4GL:
| Code | Description |
|---|---|
[M:IMP2]MODIMP = YAOENAME |
Import Template Name |
[M:IMP2]NOMIMP = YTMPFILE |
File Location and Name |
[M:IMP2]TYPEXP = 2 |
Server |
Call IMPORTSIL([M:IMP2]MODIMP, [M:IMP2]NOMIMP) From GIMPOBJ |
Invoke IMPORTSIL function |
Call ERR_IMPORT([M:IMP2]STAT, YMESSAGE) From GIMPOBJ |
Retrieve import status |
If [M:IMP2]STAT or GOK < 1 : YRESTA += 1 |
Handle Import Error |
Else : YRESTA = 0 |
Import Successful |
If !GSERVEUR : Call FERME_TRACE From LECFIC |
Close trace file if needed |

2) Log reading process:
| Code | Description |
|---|---|
Openi filpath("TRA", GTRACE, "tra", 0) Using [YTRA] |
Open trace file |
Local Char XLINE(100) |
Declare variable for line |
Repeat |
Repeat until end of file |
Rdseq XLINE Using [YTRA] |
Read next line |
If left$(XLINE, 5) = "<0001" |
Identify error |
Append YMESSAGE(YRESTA), right$(XLINE, 6) : YRESTA += 1 |
Add error message |
Break |
Exit loop |
Elsif find(left$(XLINE, 11), "Création de") |
Check for successful import |
[L]Y2_TSKNUM = right$(XLINE, 13) |
Retrieve task number |
Append YMESSAGE(YRESTA), [L]Y2_TSKNUM : YRESTA += 1 |
Add success message |
Endif |
End conditional |
Until fstat <> 0 |
Loop until end of file |
Openi Using [YTRA] |
Close trace file |
Related posts
-
Troubleshooting Sage X3 SVG Folder Configuration
12/07/2021Learn how to resolve issues with Sage X3 SVG folder configuration, including creating symbolic links using mklink...Read more -
Exploiting Software Security Vulnerabilities in Sage X3
12/08/2021Learn about a non-standard approach to exploiting a security breach in Sage X3 software.Read more -
The Impact of Cloud Computing on Sage X3 Debugger Tools
12/08/2021Explore the significant changes in Sage X3 debugger tools brought about by cloud computing and the challenges faced...Read more -
Troubleshooting Sage X3 Folder Validation Errors
12/15/2021Learn about common validation errors when creating or importing folders in Sage X3 and how to resolve them.Read more -
Exploring the ATEXTRA Table for Storing Translated Text in Applications
12/15/2021Dive into the ATEXTRA table, a crucial tool for storing translated text within applications. Discover how it manages...Read more
Leave a comment