SOQL / Querying salesforce

Salesforce is a CRM tool that allows monitoring customer contacts. It also allows following leads. For back ground technicians, it is interesting to know that it is possible to query the data. The structure of the query language resembles a bit SQL. The structure “select fields from table”may sound familiar to our ears. However SOQL misses a join. Instead a different concept is provided. This can be shown with two examples:

SELECT lastname, BSN__c, (select Start_date_participation__c from Participations__r) FROM Contact where Lastname = 'Bont'

Select Id, Start_date_participation__c, End_date_participation__c, (select EntitlementType_Ent__c from Entitlements__r) from Participation__c where Id = 'a0Q6E0000078949UAA'

The structure is as follows. We recognise that within the field list, a separate sub query is formulated that uses the relationship name after the key word “from”, In the examples above, relations are called Participations__r and Entitlements__r. From that relation name, the query engine knows how to the link the data from the parent table with data from the child table. The child table is not shown – in stead the relationship is used.

Door tom