Posts

Showing posts from March, 2023

Printing a logo in an excel file, using D365FO

Image
  Amigos,  Here is a small write-up that explains how to print a logo in an excel file, when you have created the Excel file through X++ code. The inherent problem with printing logo in an x++ generated files is: the logos stretch across several columns, and they are very hard to position to a particular location/cell, automatically. The following code, first gets the Logo image and then poses it at the start of the document, across first two cells.   Here are the steps: Before you begin, you need the following references: using System.Drawing; using OfficeOpenXml.Drawing; a. Get the image container: private container getCompanyImage()     {         CompanyInfo companyInfo     = CompanyInfo::find();         return CompanyImage::findByRecord(companyInfo).Image;     } Here for example, you are trying to print the company logo. b. Draw the logo and pose it across the first two columns of the file: void drawImage(ExcelWorksheet   _workSheet)         {             Container image = this.get

Using Maps(aka dictionaries) while interacting Python with X++

Image
  We all know the excellent capabilities of using a dictionary in Python.  A dictionary could be an indexed pair of key-value combinations, where we can have keys that necessarily not be a value that needs to start from zero.  Ex: assigning/defining a dictionary like this: custBal = {"CU0001": 250000.00, "CU0002": 65123.11, "CU0003": 43200.11, "CU0004": 10000.00} It contains customer balances. And thereby I can access the values like:  print(custBal["CU0002"]) We can also loop through the elements by: for x in custBal:     print (x) The compiler will give you Keys' values: Or I can access the values of the keys, by simply: print (custBal.values()) Which would result in: Also, I can add/remove/manipulate elements by simple operations like: del (custBal["CU0002"]) Now to the main point. Why so much ado about dictionary` data-types on Python? Answer is simple. They behave exactly as a map datatype of x++. We can, in essence,

D365FO: batches and workflows not working after database restored in VM

Image
Tired and worried of your batches malfunctioning/not working, after you have restored your database in your local VM? In case if you have faced this issue, just thought of sharing with you – this could save a good amount of your time. Going to your System admin à setup à Batch group, in case if you are unable to see this tab: This tab is very much essential, as this makes you assign servers to your batch group. Skipping this tab, will essentially make your batch groups left unassigned to any batch server. A little inspection in the form’s INIT method said: Which means if the ‘Batch priority based scheduling’ is enabled à then this tab won’t be shown. Go to features à and see this features is enabled:   Turn it off and come back to your Sys admin page à batch group à reload the page. This tab will be shown now:     Once you have selected the server, your batches should resume now.  Now whoa, whoa, whoa -- your batches are still not