D365FO – Create a Tile in a D365FO Workspace with X++

 

There are two ways through which we can create tile one by personalizing form and another through code. In this example we’ll use code

The diagram below summarizes the operations we will perform to add a tile to a workspace

These are the steps we’ll do :

  • Create an AOT Query object
  • Create a simple list form to show the query results
  • Create a menu item to call the form
  • Create a tile to call the menu item
  • Add the tile to a workspace

Create an AOT Query object

Create a project and add a query called “DeliveredSalesOrdersQuery

Add SalesTable as datasource in “DeliveredSalesOrdersQuery”.

Set dynamic fields property to “Yes”

Add range in it for showing sales orders whose status is delivered.

Save the Query


Create a simple list form to show the query results

Add a Form object and call it “DeliveredSalesOrderInquiry

Add DeliveredSalesOrdersQuery as Form Data Source

Apply “Simple list” pattern

Add Action pane

Add group

Apply “Custom and Quick filters” pattern to the form group created before

Add Quick filter to the form Group created before

Add grid to the form

Add the fields that will be show in the form

Save the form

Create a menu item to call the form

Add a display menu item and call it “DeliveredSalesOrders

Set following properties on menu item

Object : DeliveredSalesOrderInquiry (The form creeated before)

Object type : Form

Query : DeliveredSalesOrderQuery (the Query created before)

Create a tile to call the menu item

Add a new tile and call it “DeliveredSalesOrderTile


Set following properties on tile :

Label : “Delivered Sales Orders”

Menu item Name : “DeliveredSalesOrders”

Menu item type : “Display”

Type : “Count” (this will show the total number of records as a result of the query as a preview in the Tile)

Add the tile to a workspace

First let’s create a new simple Workspace and call it “Workspace_TEST

Apply “Workspace” pattern

Add Tab

Add New tab page to Tab control

Apply “Tiles” pattern to Tab page

Add Tile button

There are 2 different tiles buttons, use the second one

Set these propertie to the Tile button

Tile : “DeliveredSalesOrderTile” (The tile created in the before steps)

Tile Display : Auto

Now let’s test our Tile. To do that you can add the workspace inside a menu or simply Set it as Startup object in your project.

So run the project by pressing Start button.

By default the form will open in DAT legal entity, so change it with your work company in the address bar

THis the result. The total record numbers are shown as a preview

By default the refresh time interval is 10 minutes, but you can change by changing the RefreshFrequency property of the tile object

Or simply by doing a manual refresh pressing “Begin update now” button

By pressing the Tile button you’ll be redirected to the form

Comments