Topic
SOQL Tags not populating in the Field Tagger.
Additionally - SOQL Tags containing an Aggregate or Group By function are not populating in the document or Field Tagger
Additional information
- First, Ensure the API Names are correct and the SOQL runs in the Salesforce Developer Console
- SOQL Tags may not populate or be correct in a relationship containing an Aggregate or Group By - This is due to how a field can be described:
- From the Salesforce documentation: "You can't use child relationship expressions that use the __r syntax in a query that uses a GROUP BY clause." https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_group_by_considerations.htm
Resolution
This can be worked around by including an alias for the reference field.
Example: Alias = "RecipientName"
SELECT Recipient__r.Name RecipientName FROM Opportunity GROUP BY Recipient__r.Name
- With no field alias: <<Signer1.Recipient_Name>> - This may not populate data.
- With the field alias: <<Signer1_RecipientName>> - This will populate as expected.
Steps to Manage going forward:
1. Create an alias for the SOQL field. Ex: "Name" or "Recipient"
Salesforce Documentation: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_groupby_alias.htm
2. Create an alias on the Relationship - "Signer1"
3. Then the Tag logic would be <<Signer1_{AliasFieldName}>> ; <<Signer1_RecipientName>>
4. Note that aliased fields may not show in the field tagger but can be used following the above logic.
