D365 Customer Engagement and the MS product renaming

I’ve often read about “Customer Experience”, a relatively new Dynamics 365 product from Microsoft. At first I couldn’t even figure out what it was. As it is often the case, there is a lot of nonsense being spread, especially by people in the acquisition sector who have no idea about and confuse CRM and ERP.

Microsoft is known for renaming products. What do marketing and product management think or want to achieve? Who knows it. It has been confusing customers since many years, also anyone who deals with MS products. At some point they will rename Windows or Word or Excel.

Microsoft CRM, i.e. Customer Relationship Management from MS: It was known by that name for a long time. You knew what that was. What happened to it? First it was renamed to Dynamics CRM, because the MS products are SO dynamically … whatever that means. But that was kind of ok. Then… to Dynamics 365? Yes and no. The term is used for everything, including ERP products. Actually it is the name for the “product family” as MS calls it. CRM became D365 Sales, D365 Marketing, D365 Customer Service (CS), all CRM systems with different feature weightings.

Now there is also the so-called “Customer Engagement” or CE for short. What is that? A mixture of D365 Sales, D365 Marketing, D365 Customer Service, AI stuff, etc. So a mishmash that can do everything, more or less. The jack-of-all-trades, just think of Sharepoint. That’s something like that too. Somehow anything can happen and nothing will happen. But again, that’s what you need. Why all this? To compete with Salesforce. Does it work? Who knows.

Addition: The ERP products are D365 Business Central (formerly Navision or Dynamics Nav), D365 Finance & Operations (formerly Axapta, Dynamics AX). The latter is available in 2 versions: D365 Finance and D365 SCM … and 2 other versions. Why multiple ERP products? No idea. There are also more, there is Great Planes (GP) too. But that has already been abandoned. Well, SAP also has several ERP systems running. So whatever.

If you would like to find out more about it, just get in touch.

#d365ce, #d365cs, #d365bc, #d365fo, #d365scm, #d365, #dynamics365, #businesscentral, #navision, #crm, #microsoft, #customerengagement, #kalchmair, #erp

Freelance Consultant

Hi,

since a couple of years i work as freelance consultant, in the bc/nav area as well as business analyst and project manager.

If you are looking for support, want to implement bc, have issues with your bc or nav system or you are not satisfied with your current partner, feel free to contact me.

I provide consulting for Business Central and Navision. That contains business analysis, project management, license management, data migration, trainings, coding, reports.

Other services are business analysis and project management for every kind of software project as well as software evaluation.

As you may know i was an active member of the nav/bc community for many years, helped thousands to solve there issues. I do also have many years of project experience in various branches.

My company homepage: dfk-consult.at

So, you are welcome to contact me via

freelancermap, my homepage, mail

Dipl.Ing. Franz Kalchmair

ERP consultant, Business Analyst, Project Manager
Problem solver, Former MVP

Austria

Howto add item images to the Sales quote report

Not often, but it can be, that a client wants product pics in the lines of a report, e.g. the sales quote is a candidate for that. So the client can present his products in a more convincing way. 😉

I researched for a solution in Business Central, but did not find any solution, especially when using a word report. But i found my own way, as always.

For that follow these steps:

1) Copy the standard sales quote report, also the layout to a new custom report, set new object id (e.g. 50100) and name (e.g. “Custom Sales Quote”), so that you can make the needed changes. save, compile, publish the extension. for that steps follow my last post.

2) add variable TenantMedia: record “Tenant Media” to the global report variables

3) add new dataitem(Item;Item) after the last column of dataitem “Line” (Sales Line)

4) add the typical properties to connect the dataitems Line and Item via field “No.”

5) add column(Picture;TenantMedia.Content) to the new dataitem for viewing the item picture in the line

6) in trigger OnAfterGetrecord of dataitem “Line” add new local variable “Item: record item”.
at the end of the trigger’s code add:
item.get(“no.”)
if item.picture.count > 0 then begin
TenantMedia.get(Item.picture.item(1));
TenantMedia.CalcFields(Content);
end;

remark: to load the picture data within the OnAfterGetrecord trigger in new dataitem “Item” won’t work, the data is loaded to late to be shown in the line.

7) edit the word layout in vs-code using ms word, activate the developer tools menu in word, activate the xml structure to view the fields structure

8) add new column in the lines matrix. set the column heading to “Picture”, set the cursor into the new data cell in the new column, add new field Header/Line/Item/Picture as Picture (type) into the new data cell. save the word report, close word, compile and publish the extension. replace the sales quote no. in “report selection” to the new report.

Result:

Great, isn’t it?

Change standard reports in BC?

First of all, you cannot make changes in standart reports. You cannot change the dataitem, the code behind. But it’s possible to change the layout by creating a custom layout with BC using MS Word or the RDLC Report Designer. There you can use the available fields from the standard report. It’s not possible to add new fields.

To add new fields, additional code, following has to be done: Copy the existing Standard report, create a new report extension and add the dataitem and the code to the extension by using the “AL Object Designer” in Visual Studio Code.

(AL Object Designer)

For version 15 or newer:

  • Start with a new extension in BC
  • Install or use installed “AL Object Designer”
  • Download symbols from a sandbox
  • Open the “AL Object Designer”: type “AL Object Designer” in the search box.
  • Search for the report, click on the report name. A new tab will be opened, the code incl. dataitem of the report is then shown.
  • Copy the code to the new .al file, change ID and name. Make then the needed changes, add fields and code, what ever, save.
  • Upload and publish the extension to the sandbox.
  • Goto “Report layouts/Custom layouts”, download the original layout and upload it to the new report, press update layout.
  • Download the report layout from the new report, change the layout according to your needs, add e.g. the new fields.
  • Upload the changed report layout, select the new report in report selections and use it, where needed.  

For older Releases do the following: Install a local version of BC on your laptop or use a docker container for that. Export the report object using finsql as .txt file. Then convert it to AL code using the Txt2Al conversion tool.

Convert String to Char array in AL code

Was needed in a forum question.

 procedure ConvertStringToCharArray(var arr: array[10] of char; srcStr: Text) var   i: Integer; begin   for i := 1 to strlen(srcStr) do     arr[i] := srcStr[i]; end;
or simply convert a String Element into a char value. 😉
srcStr: Text;chVal: char// get 1. element of the string and convert it to a charchVal := srcStr[1]; .

 

HexToInt in AL code

That was needed in a forum question.

begin  hexStr := 'A2F'; // int value = 2607  intVal := HexToInt(hexStr);  Message(hexStr + ' = ' + format(intVal));end;procedure HexToInt(hexStr: Text): Integervar  len, base, decVal, i, j : Integer;begin  base := 1;  decVal := 0;  len := strlen(hexStr);  for i := 0 to len - 1 do beginj := len - i;if (hexStr[j] >= '0') and (hexStr[j] <= '9') then begin  decVal += (hexStr[j] - 48) * base;  base := base * 16;end else if (hexStr[j] >= 'A') and (hexStr[j] <= 'F') then begin  decVal += (hexStr[j] - 55) * base;  base := base * 16;end;  end;  exit(decVal);end;

Create recurring sales invoices automatically

A common issue is to generate invoices per month for items and services automatically, which are being sold periodically.

You can use report “Create recurring Sales Invoice” to generate sales invoices with the needed lines manually. The parameters “Order Date” and “Posting Date” in the request page are mandatory. So, the report cannot be used to generate invoices automatically without setting the mandatory parameters.

But one step after the other.
First goto “Recurring sales lines” and create a new record, set code and description and add a line with the item, which should be added in the sales invoice, when a new sales invoice will be created.

Next open the customer, for which the sales invoices with recurring lines should be created for. There goto Navigate/Sales/”Recurring sales lines” and add a new record with code “LIC”. Set additional values if needed.
Now, if a new sales invoice with that customer is created, the recurring lines are added automatically. That’s fine.

Next run report 172 “Create recurring sales invoices” to create sales invoices with recurring lines, semi-automatically. In the Request page set “customer no.” with the customer’s no. from above, also set the Code from the “Recurring sales lines”.

Fields “Order Date” and “Posting Date” are mandatory to run the report. Therefore it cannot run automatically without setting both date fields.

What to do now?
To run the report automatically e.g. monthly, the best choice is using a job queue entry. There the request page default values can be set. Set the filter fields like above, additional you could set a default value for the date fields. Doing that, the job queue entry can be run with no problem, but all invoices get then the default date value, what we do not want. It would be nice, if the current date is used.
To solve that  it could be an option to extend table “Standard Customer Sales Code”, if there would be a kind of “OnBeforeCreateSalesInvoice” event to replace the dates, but there isn’t.

So i decided to create a copy of report 172 and make one change.

trigger OnPreReport()  begin  //-  if (CurrentClientType = ClientType::Background) or (CurrentClientType = ClientType::NAS) then begin    OrderDate := Today;    PostingDate := Today;  end;   //+   if (OrderDate = 0D) or (PostingDate = 0D) then     Error(MissingDatesErr);end;
Ok, preparation ready.
Now create a new “job queue entry” as above described and leave the date fields empty.
The job queue entry:
To run the report monthly on every 1st of the month set a dateformula in “Next Run Date Formula”, here use “CM+D1”.
cheers

EventSubscribers

EventSubscribers are a nice feature to add code to triggers in standard objects. It’s the replacement for changing the code directly in standard objects.

A sample:
add code at the end of trigger “Address 2”-OnValidate from page “Customer Card”. It’s a so called OnAfterValidate event. There are many events available in each standard object, which one can subscribe to.

the syntax for the EventSubscriber Attribute, that connects the custom procedure with the standard trigger:


for details goto here.

the code:
create a new codeunit or use an existing to add following code.
it’s needed that property EventSubscriberInstance is set in the codeunit.
for details goto here.

the result: