Hiding messages from dataport when called from codeunit

Hi,

I’m calling a dataport from codeunit. In case of any errors in importing data, errors are shown in UI.

As I’m calling it from codeunit and want to automate the process, don’t want the errors to appear in UI.

Can someone tell me how to suppress the errors appearing from UI and also how to capture them from codeunit.

-Sudhakar

Hi sudhakar,

It is common thing when the process is going wrong getting message.

But if you don’t want to show any thing in UI, and want to capture the message from code unit

Delete the message function and write in that condition blog,

Where you want to store the data (table or text format file with path etc.)

At last use Error function with empty parameter.

so it rollback all process and nothing will display and u can store the data at the same time.

Hi Nagaraju,

I don’t have any message statements in my code… All the errors are coming from internal code

For ex. if I have the data length for a field in the csv is more than the size of the field in the table… then dataimport throws error message…I don’t want those to come up in the UI and all of them to be captured in the calling code unit.

-Sudhakar