Line breaks in labels

If you want to include line breaks (\n) in your labels, displaying in box or dialog screens then you need to use the strFmtLB control to make sure the label is displayed correctly.

@DAX123 = “Some text\nAnother line”


Custom lookup on InventTable

So you would like to create a custom lookup for the inventory table (Inventtable). As part of your design you include itemId and the display method ItemName. When you run the lookup you find the item name column is blank.

Continue reading

Query::Insert_Recordset and Crosscompany

When dealing with performance, there is a new control under the AX query system called Query::Insert_Recordset. This allows mutliple records to be inserted into a table, with a single SQL call, in the same way the insert_recordset command works.

While this command is great for performance, there is a problem with the standard crosscompany control when using the query::Insert_recrodset comamnd. The crosscompany controls only build the extended select statement to include the comapny control (dataareaid) when the queryrun class is used. If since the query::insert_recordset does not use the the queryrun class, the crosscompany control does not work, and will not filter the data across companies based on any rules you apply. It will however extract data for all companies.

The only work around that I have found is to add the dataareaid into the query, selecting the companies you want to use, this then includes the company control into the SQL statement ensuring only the companies you are interested in are processed.