Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

How to create data entity with range and "or" condition ?

(1) ShareShare
ReportReport
Posted on by 954
Hello,
 
When we create data entity, how to add range but with 'OR' condition. Is this possible ?
The data entity is for OData, and I want to fixed it into certain condition.
 
For example I've created new data entity for Sales Table like this:
 
I have condition in CustGroup to be /MEMBER/:
 
and IncTax to be Yes:
 
When checking in SSMS, I found the condition created is /AND/
 
Is it possible to have 'OR' condition ?
Similarly if I want the OR condition is between 2 data source in this data entity. So for example I'll added other table relates to SalesTable. So, 1 range in Sales Table, and 1 range in this other table, but it is 'OR condition.
Thanks.
 
 
  • Kevin Xia Profile Picture
    Kevin Xia Microsoft Employee on at
    How to create data entity with range and "or" condition ?
    Hi,
    I've helped you mark this as solved.
    Best regards,
    Kevin
  • Kevin Xia Profile Picture
    Kevin Xia Microsoft Employee on at
    How to create data entity with range and "or" condition ?
    Hi,
    You can refer to this official documentation: Data entities overview - Finance & Operations | Dynamics 365 | Microsoft Learn.This article defines and provides an overview of data entities. It includes information about the capabilities of data entities, the scenarios that they support, the categories that are used for them, and the methods for creating them.
    Best regards,
    Kevin
  • Voltes Profile Picture
    Voltes 954 on at
    How to create data entity with range and "or" condition ?
    Sorry I cannot Mark this as solved -> "Does this answer your question" check box since it is always freezing, endless processing.
    I wonder why with this new UI, it is difficult to operate. 
     
    Btw, I tried both:
    - with Andre suggestion... it is easier but to trace back is harder because someone else may not aware there's a range condition.
    - with Layan suggestion... it is more complex, but because there is a visible column, it is easy to trace back later.
     
    I want to check both. Thanks.
  • Voltes Profile Picture
    Voltes 954 on at
    How to create data entity with range and "or" condition ?
    Thank you, both.
     
    It works. 
  • Verified answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,391 Super User 2024 Season 2 on at
    How to create data entity with range and "or" condition ?
    Hi Tony,
     
    You can include the Record ID field as range and use an SQL expression for defining the OR condition in the range value. You can read more on this page: Advanced filtering and query syntax - Finance & Operations | Dynamics 365 | Microsoft Learn
     
    Instead of the documentation example
     
    ((AccountNum LIKE "US*") && (DirPartyTable.Name LIKE "Cont*"))
     
    you can use
     
    ((AccountNum LIKE "US*") || (DirPartyTable.Name LIKE "Cont*"))
  • Verified answer
    Layan Jwei Profile Picture
    Layan Jwei 7,349 Super User 2024 Season 2 on at
    How to create data entity with range and "or" condition ?
    Hi Tony,

    For complex entity ranges, you can create a computed column that returns 0 or 1.
    So i think what you are trying to achieve is sth like this:

     if (SalesTable.CustGroup = 'Member' OR SalesTable.InclTax = Yes OR Table1.Field = sth)
    so this computed column should return 1 if the above condition is met, else it should return 0

    https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/data-entities/data-entity-computed-columns-virtual-fields#example-create-a-computed-field
     
     
    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future. You can do this by ticking the box "Does this answer your question"

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans