For internal documents in Connectivity studio, the Custom query feature enhances the standard query capabilities of D365 F&SCM. It provides you with an advanced method to query data. Compared to the standard D365 F&SCM query, you can create more complex queries with greater flexibility and control over data selection. The Custom query is compatible with existing Connectivity studio and D365 F&SCM processes.
The Custom query feature offers an alternative approach to data retrieval. Unlike the standard query, with the Custom query, you can:
Join data across different companies.
Control queries more precisely wit the Group by function.
Limit the selection to the first record only for complex queries.
Use fields from ancestor records in record relations.
The standard D365 F&SCM query remains available.
If you use the:
General advice: Try to use the standard query unless the standard query does not give the desired results. So, only use the custom query if required to get a specific query result.
For internal documents, you can choose between these query types:
Standard (default behavior)
Custom (advanced option)
You can do so, on the document header, in the Advanced section, in the Query type field.
With the Custom query, you can join tables across companies in the same D365 F&SCM environment.
To get table data from another company, for a document record:
A document record can result in a selection of several matching records. In some case, you only want to select one record for a document record. With the Custom query, you can use the Select first record function. Selecting only one record improves the performance.
Example: Several addresses are stored for a customer. However, you only want to select the first address.
To only select the first matching record:
With the Custom query, for internal documents, you can use Group by to summarize, condense, and analyze data during export.
Group by has several types of functions:
To apply the Group by function:
With the Custom query, you can set up a field relation with a field of an ancestor document record.
If the Custom query feature is active for a document, for a document record, on the relations tab, the Parent record ID field becomes available. You can use this field to define a relation to an ancestor document record of the current document record.
Note:
In general, a Custom query runs slower than a standard query. Reason, the custom query runs several separate smaller queries, one for each document record.
Cross-company data joins can reduce performance. So, only use it when necessary.
Use the group by and related aggregation functions carefully. Excessive grouping can reduce performance.
Test your custom query and its performance before you deploy it in a live D365 F&SCM environment.
Related to | Notes |
---|---|
Add document record fields - Internal documents |
  |
Check relations |
  |
Add document records - Internal document |
  |
Set up document - D365 F&SCM |
  |
Set up document - Inventory journal |
  |
Set up document - Ledger journal |
  |
Set up document - Trade agreement journal |
  |
Set up document - Other journals |
  |
Set up document - Staging |
  |