December 30, 2019

[LogicApps/Flow] Odata operators for Odata query

[Updated on September 8, 2020]
Hi Folks,

While working on Logic apps and Flow we need to apply a different filter on Odata query to get the desired data from an Odata entity. Below are the most used operators to use in an Odata query with example. 

The operators supported in the expression language are shown in the following table.

Operator
Description
Example
Logical Operators
Eq
Equal
/Suppliers?$filter=Address/City eq 'Redmond'
Ne
Not equal
/Suppliers?$filter=Address/City ne 'London'
Gt
Greater than
/Products?$filter=Price gt 20
Ge
Greater than or equal
/Products?$filter=Price ge 10
Lt
Less than
/Products?$filter=Price lt 20
Le
Less than or equal
/Products?$filter=Price le 100
And
Logical and
/Products?$filter=Price le 200 and Price gt 3.5
Or
Logical or
/Products?$filter=Price le 3.5 or Price gt 200
Not
Logical negation
/Products?$filter=not endswith(Description,'milk')
Arithmetic Operators
Add
Addition
/Products?$filter=Price add 5 gt 10
Sub
Subtraction
/Products?$filter=Price sub 5 gt 10
Mul
Multiplication
/Products?$filter=Price mul 2 gt 2000
Div
Division
/Products?$filter=Price div 2 gt 4
Mod
Modulo
/Products?$filter=Price mod 2 eq 0
Grouping Operators
( )
Precedence grouping
/Products?$filter=(Price sub 5) gt 10

For details refer below link 


-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

This post is referring to https://www.odata.org/.


December 21, 2019

QuickFix-9: Dynamics 365 Talent: Attract and Dynamics 365 Talent

Dynamics 365 Talent is now Dynamics 365 Human Resources

New updates are on the way for D365 Talent, checkout below links

Building a more successful workforce with Dynamics 365 Human Resources

Announcing changes to Dynamics 365 Talent

-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

December 19, 2019

[Logic Apps] Define parameter null-able.

Hi Folks,

When we define parameters in a Logic apps by default they need a value to be passed by calling object. If you want to make a parameter to accept null value as well then define them as below.

default declaration:

{
    "properties": {
        "packageName": {
            "type": "string"
        }
"type": "object"
}
}

Allow null value:

{
    "properties": {
        "packageName": {
           "type":["string", "null"]
        }
"type": "object"
}
}

-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

October 24, 2019

Create and save a csv/text file in D365FO (x++ code sample)

Hi Folks,

Let's see how to create a CSV or TXT file through X++ code and later save that on local folder.




In code there is the full syntax of File::SendStringAsFileToUser method with all parameters. However, not all of them are mandatory but it's nice if you can explore them for your solution, for eg. changing the file encoding.

-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

September 23, 2019

[Solved] The server did not received a response from an upstream server

Hi Folks,

Here we come to our second post on Logic app troubleshooting. Check this link (if you haven't yet) for the previous post.

Error: 

  "error": {
    "code": "NoResponse",
    "message": "The server did not received a response from an upstream server. Request tracking id '#########'."


Possible reason: 

Well, there is not an issue in your logic app, it's running fine. There must be some issue with data.

Solution: 

As its a data related issue and to see more details on the error, navigate to data management in FO and see the execution history of this export/Import. You must get detail of error and once you fix them you must be able to run successful next time. Also, I would recommend adding an extra action on your logic app to handle this error.

Another thing you can try to do import same file manually and if you found the issue, fix that and try again with Logic app.

-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

PS: Logic apps can be used for multiple purposes. In most of my post, I'll be dealing with in #MSD365FO  related issues.

September 02, 2019

Set up MT940 format for bank reconciliation #MSD365FO

Hi Folks,

In D365FO advance bank reconciliation is a feature to import bank statement file and automatically reconcile with related bank accounts. There are many formats which a bank commonly used i.e. ISO20022, MT940, BAI2.

In this post, we will see how to set up the MT940 format which is commonly used in most banks nowadays.

Let's get started.

Step 1: Get sample entity template and transformation files
To transform the source file into FnO format, you need few files and these are available under 'Resources' node of AOT. Files names are as below



Step 2: Create an import project
Under Data management workspace, create an import project with name MT940. Add a new file with below details
I. Entity Name: Bank statements
II. Upload file name: SampleBankCompositeEntity (which you got from Resource node)



Once file successfully uploaded, click on view map. On next screen select BankStatementDocumentEntity from the list and click on 'View Map' and go to 'Transformation' tab. Click new and click upload file, select different XLST file one by one, in the sequence shown in below image.



Step 3: Setup Bank statement format
Navigate to Cash and Bank management > Setup > Advance bank reconciliation setup > Bank statement format.
Here create a new record as below



Step 4: Configure the bank account to use Advance reconciliation option
Navigate to Cash and Bank management  > Bank accounts. Select a Bank account to view details. Under Reconciliation tab,
I. Set the 'Advance bank reconciliation' option to 'yes'. This is a one-time setup, the system doesn't allow to undo/change once set to yes.


II. Set Statement format field to format which we have created in step 3 i.e. MT940




Step 5: Testing
Navigate to Cash and Bank management  > Bank accounts. On Reconcile tab click on Bank statements.
On the next screen click on Import statement. A dialog will pop up. Fill/select details as below

I. Import statement for multiple bank account in all entities. : Set this as Yes if your file contains more than one bank accounts.
II. Bank Account: If the source file contains a single bank, select that bank here.
III. Statement Format: Select your statement format here it must be MT940.
IV: Bank statement file import: Select source file and click upload.
V: Click ok and it must import transaction in the current form.

Note: After every DB refresh you need to redo import project. DB will break the links and you need to remove the entity from your import project and add upload the transformation files accordingly.

-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

PS: This post referred to MS documentation. 

August 23, 2019

QuickFix-7: Feature management in D365FO

Feature management OR Flighting is a new concept introduced by Microsoft from D365FO version 10.0 that allows turning on new features, which are delivered but not activated by default.
Some of these “hidden” new functionalities are: 
  1. ·        Client alert notifications by email
  2. ·        Manage access to network printers across legal entities
  3. ·        Business events
Check these links for more details





-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta


August 18, 2019

How to increase font size in BizTalk schema/Map editor

Hi Folk,

Now when Logic apps are all over around the integration of D365FO, I am sure you have seen BizTalk editor once in a while. The default editor's font size is so small, you may need a magnifier glass. And I really mean it.

I searched for some solution around the web but didn't found much of the help. Well, here I am sharing my finding with the possible solution or I would say most suitable solution as of now.

Here is a screenshot of the default font size.



To fix this issue, Go to

Setting > Display setting > Advance Display setting > Advance Sizing of text and other Items

Above navigate should give you below screen





















here click on 'set a custom scaling level'. and set the scale to 300%

























Once you have done this, re-login into the system and see the changes. Below is the new appearance of the same map.









































For more details on BizTalk check below link,

https://docs.microsoft.com/en-us/biztalk/core/using-biztalk-editor

Cheers!!!
-Harry
 Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

August 04, 2019

[Solved] Error in Logic app. Status: 403

Hi Folks,

Logic comes a long way for most of the integration thing in Dynamics 365 FO. Its provides a good set of connectors to develop inbound/outbound integration process. While troubleshooting any error is not so easy while it comes to the logic app for new people. I will be sharing some the common error which I faced during development and hopefully, that will helpful for you guys too.

Error: 
"status": 403,
  "message": "{\r\n  \"Message\": \"An error has occurred.\",\r\n  \"ExceptionMessage\": \"Forbidden\",\r\n  \"ExceptionType\": \"System.ServiceModel.Web.WebFaultException`1[[System.ComponentModel.Win32Exception, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=######]]\",\r\n  \"StackTrace\": \"   at Microsoft.Dynamics.Ax.Services.ServicesSessionProvider.ThrowSessionCreationException(ServicesSessionCreationErrorCode exceptionCode)\\r\\n   at Microsoft.Dynamics.Ax.Services.ServicesSessionProvider.GetSession(Boolean isILSession, Boolean bypassAuthentication, String issuer, String company, String language, String partitionKey, ClaimsIdentity claimsIdentity)\\r\\n   at Microsoft.Dynamics.Ax.Services.ServicesSessionManager.InitThreadSession(Boolean ilSession, SessionType sessionType, Boolean bypassAuthentication, String authIssuer, String company, String language, String partitionKey, ClaimsIdentity claimsIdentity)\\r\\n   at Microsoft.Dynamics.Platform.Integration.Common.SessionManagement.ServicesAosSessionManager.InitializeSession(Boolean bypassAuthentication, String authIssuerThumbprint, ClaimsIdentity claimsIdentity)\\r\\n   at Microsoft.Dynamics.Platform.Integration.Common.SessionManagement.OwinRequestSessionProvider.CreateSession(ClaimsIdentity claimsIdentity)\\r\\n   at Microsoft.Dynamics.Platform.Integration.Common.SessionManagement.ServicesRequestSessionHelper.EnsureRequestSession(IServicesRequestSessionProvider servicesRequestSessionProvider, ClaimsIdentity claimsIdentity)\\r\\n   at Microsoft.Dynamics.Platform.Integration.Common.SessionManagement.EnsureServicesRequestSessionHandler.EnsureServicesRequestSession(HttpRequestMessage request, IApplicationEnvironment applicationEnvironment)\"\r\n}\r\nclientRequestId: ##########",
  "source": "########Dynamics.cloudax.dynamics.com",

  "errors": []

Possible reason: 
You have used certain users in Logic apps while creating API connections. while that users don't have access to target AX system.

Solution: 
Check the used in target/Source AX system if the user doesn't exist import the same with admin or proper access. If the user exists then check its access.

I will keep posting any error which I faced with a solution that works for me and I hope that may work for you as well. If you are getting other error, put that in the comment section and I will try to find a solution for you.

Cheers!!!
-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

August 01, 2019

QuickFix-6: How to check if code is running on batch server

If you want to check if the code is running either on the batch or locally, call below method.

1. For sysOperation framework: this.isExecutingInBatch().
2. RunBase batch: this.isInBatch()

both methods will return a boolean.

-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

July 19, 2019

QuickFix-5: X++ string runtime functions

Here is a quick link that describes all the string run time functions in x++.

X++ string runtime functions


-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

Object compare in #MSD365FO

How to compare an AOT object in D365FO.

If you received a project export (.axpp file) and you want to see what's the changes between this file and your current code. While importing this project (from Dynamic 365 menu in VS), right-click on the object and you will get the option to compare this object from your current metadata.





















It will open a compare window




















where
1 is a model store or your current metadata.
2 is Target file or file from import project
3 is a menu bar with 'Next', 'Previous', 'Expand all' and 'compare code' options.


when you click on 'compare code' option it will open this compare file in the visual studio itself, similar to other compare option.






















-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

July 08, 2019

[Solved] Issue with default app in Windows 10, TWINUI bug

Known Bug in Windows 10,

Error:
All sudden all my default app have been changed to TWINUI and I am not even able to change it.

























Solution: 
Open Power shell as admin and run below command,
Get-AppXPackage | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register “$($_.InstallLocation)\AppXManifest.xml”}






























That's it, now check the default apps again

























Also, you can Try below steps for Photo/Images
  1. Press Windows button + R.
  2. Type:%appdata%\..\Local\Packages\Microsoft.Windows.Photos_8wekyb3d8bbwe\LocalState
  3. Delete all the contents of that folder.
  4. Restart the computer and check if the issue persists.

Thanks





-Harry
Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

July 03, 2019

Working with Data entities in D365FO- Part II

Add new fields on DataEntities/Form from the user interface


Hi Folks,

In this post, I am going to share one new feature which comes with the latest update in #MSD365FO. Now you can add any custom field from the user interface, you don't need to add that in AOI, however, there are some limitation on this but having this option is good where user wants to add some fields on a form/entity which doesn't have any metadata dependency/Relation to other tables. Earlier this feature was limited to talent only now with recent version Microsoft bring this to Dynamics 365 FO as well.

For today’s post lets take an example customer group, You want to add a new field on customer group form. Let's call it ‘SPOC person’. Now to add a new field on a form, you need to personalize the form.
Open Customer group form, go Option menu, ‘select personalize this form’ option.

















It will give you another pop-up window, select ‘Add Field’ and grid in the form where you want to add a new field(s).



on the next screen, click on ‘Create new field’























When you click on ‘Create new field’ a new form will open (kind of designer form). First, choose the table where you want to add this field. Select Customer Group here.
























and fill other details as below, and hit the save button.

























The system will ask for another confirmation












now, this field available to add on the form,






















Once you insert this field, it will appear on the form,












Now go to  System Administrator > setup > custom field. Select table from the dropdown list. In the entity tab, select data entity where you want to add this new field. The system will show all the entity where the CustGroup table used.



Now go to data management > Framework parameter >  Entity Setting and refresh entity list.

Go to Customer groups entity and click on modify target mapping. Here generate the mapping. On successful completion, your custom field must available in mapping.

















Here you go…. that all.

-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta