Reference group and GROUP BY

This blog post explains a problem that you can run into when using reference group controls with grouped data – and a solution for this problem. I have a table which stores references to workers. The field has HcmWorkerRecId data type, i.e. it stores record IDs from HcmWorker table. When I drop this field to …

Continue reading ‘Reference group and GROUP BY’ »

Throwing managed exceptions from X++ in D365FO

Update! PU31 has added the ability to throw managed exceptions. Read more about it here. What I really miss in X++ is the ability to throw exception objects. If you throw an exception in X++, it’s just a number defining what kind of exception it is, which usually says just “Error” (Exception::Error). You also typically …

Continue reading ‘Throwing managed exceptions from X++ in D365FO’ »

Find D365FO labels in Powershell

You can use Dynamics 365 > Find labels… in Visual Studio to find D365FO labels, but its capabilities are quite limited. Sometimes a better option is searching through the underlying text files directly and you can easily automate it with Powershell. The following script looks at all label files for US English and finds all …

Continue reading ‘Find D365FO labels in Powershell’ »

First chance exceptions

Dynamics 365 for Finance and Operations runs completely in “.NET”, which has some interesting implications. The runtime and tools working with it (such as Visual Studio) offer many new options that may be very useful. One of these options is the ability to catch first chance exceptions. When an exception is thrown, it’s considered a …

Continue reading ‘First chance exceptions’ »

Word document from code

Sometimes you may want to generate a Word document from code in D365FO, which gives you much more control over the result than if you simply printed a report to Word. Here is a very brief example of how you can do it. Start with creating an X++ project. Then add a C# class library …

Continue reading ‘Word document from code’ »