Conflict error when list of fields is used in select during update transaction

If you use this code, you will get an error on the line 29. The error message is following: Cannot edit a record in Table1 (Table1). An update conflict occurred due to another user process deleting the record or changing one or more fields in the record. 1: static void updateTable1(Args _args) 2: { 3:…

3

Error while calling Win API function on x64

When you are calling Win API function (or function from a native DLL) on x64 you get this error: An exception occurred when calling Function in Library name DLL library This happens only if the code calling the DLL function is running on server. The reason for this is that the DLLFunction class is not…


Rename object in TFS

You can get this error message while renaming object that is checked out from TFS. Unable to import Trying to import Table MFATable_test1 with ID 50003 ID already held by Table MFATable1 To rename the object you need to follow these steps: Right click the object in AOT and select Rename (without checking out the…


HOWTO: Print Word document from X++

You might need to print Word document directly from X++. Here’s a short sample how to do this:{ str document = “C:\\test.doc”; COM wordApplication; COM wordDocuments; COM wordDoc; ; // Create instance of Word application wordApplication = new COM(“Word.Application”); // Get documents property wordDocuments = wordApplication.Documents(); // Open document wordDoc = wordDocuments.Open(document); // Activate the…


HOWTO: Dynamicaly load picture from base64 string into image on form in X++

You may want to load an image from base64 coded string. Then there is a code sample how to achieve it. First is needed to put an “Window” controll on the form with name ex. “imageWindow” and then modify “run()” method of Form. String then could be loaded from database, generated by .NET (for example…

1

Sending reports per e-mail from batch

I was facing an issue that no mails were arrived while sending invoices in PDF from a batch. Sending e-mails from a client worked fine. The reason is in enabled SMTP relaying on customer’s mail server and in \Classes\RunbaseReportStd\serverSendMail method. This method calls quickSend() method from SysMailer class. The first parameter of this method is…

1

How to execute an external process from a batch

You might need to execute an external process in a batch and you’re thinking about using WinApi::shellExecute() method. Unfortunately the whole WinApi class is set to run on client. Also the method WinApi::shellExecute() is marked as client method. That why you can’t use this method to execute an external process from batch. How to execute…

3

Blocked queries on any change in AOT

You may face a blocking issue on SQL Server each time you do any change in AOT. And you’re using database log. This is the problem. While using database log an insert trigger on SysDatabaseLog table is always dropped and recreated what is causing blocking issues on SysDatabaseLog table. There are 2 options how to…

1

HOWTO: Using WinAPI FindFirstFile, FindNextNext in Batch Jobs.

In batch job is not posible to call WinAPI functions WINAPI::FindFirstFile(..) and WINAPI::FindNextFile(…). This is limited only for code running on client. Sometimes is necesary have similar function for code running on server (or in batches). There is a code sample which is using .NET Framework. static void Job1(Args _args) { FilePath sFilePath; System.IO.DirectoryInfo di;…

1

Running direct SQL code using Connection class

Sometimes you need to use direct SQL code in your methods. The easiest way is to use Connection class. However you might run into the error “Request for the permission of type ‘SqlStatementExecutePermission’ failed.” This is because you’re using the class in client-side code. Connection class has to be used only in server-side code, so…