Could someone describe how SemQL function any...has(something=something) works? What is difference when has is replaced with have? What are the supported parameters in this function? What else should I know when using this any..has(..) function?
Best Answer
C
Cédric BLANC
said
over 2 years ago
The any/all SemQL syntax allows you to query child entities records.
"any" means at least one record from the child entity follows the condition.
"all" means all records from the child entity follow the condition.
"has" and "have" behave exactly the same, they exist only for the expression to be grammatically correct, but you may use one or the other interchangeably.
A good tip is to use 1=1 as a condition when the goal is just to check child records existence without any other specific criteria. For example, either of these will return true if at least one contact exists for the parent record:
"any" means at least one record from the child entity follows the condition.
"all" means all records from the child entity follow the condition.
"has" and "have" behave exactly the same, they exist only for the expression to be grammatically correct, but you may use one or the other interchangeably.
A good tip is to use 1=1 as a condition when the goal is just to check child records existence without any other specific criteria. For example, either of these will return true if at least one contact exists for the parent record:
Cédric BLANC
Could someone describe how SemQL function any...has(something=something) works? What is difference when has is replaced with have? What are the supported parameters in this function? What else should I know when using this any..has(..) function?
The any/all SemQL syntax allows you to query child entities records.
any/all <child_entity_role> have/has ( <condition_on_child_entity> )
"any" means at least one record from the child entity follows the condition.
"all" means all records from the child entity follow the condition.
"has" and "have" behave exactly the same, they exist only for the expression to be grammatically correct, but you may use one or the other interchangeably.
A good tip is to use 1=1 as a condition when the goal is just to check child records existence without any other specific criteria. For example, either of these will return true if at least one contact exists for the parent record:
ANY Contact HAS (1=1)
ANY Contact HAS ( ID IS NOT NULL )
More details and examples in this documentation.
Cédric BLANC
The any/all SemQL syntax allows you to query child entities records.
any/all <child_entity_role> have/has ( <condition_on_child_entity> )
"any" means at least one record from the child entity follows the condition.
"all" means all records from the child entity follow the condition.
"has" and "have" behave exactly the same, they exist only for the expression to be grammatically correct, but you may use one or the other interchangeably.
A good tip is to use 1=1 as a condition when the goal is just to check child records existence without any other specific criteria. For example, either of these will return true if at least one contact exists for the parent record:
ANY Contact HAS (1=1)
ANY Contact HAS ( ID IS NOT NULL )
More details and examples in this documentation.
-
Extend a model with new entities or attributes
-
Data types in xDM
-
Effective date on entities
-
Search using wild cards
-
Export a model from production and import on a development environment
-
"Allow Delete" vs "Allow Removal" privileges
-
LOV label in Named Query
-
Select location on a map and save coordinates
-
Is there a way to set up a master-detail relationship on browse mode?
-
Choose Either a Stepper or A Workflow Based on The User Privileges
See all 276 topics