Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Div
idmain_content_override

Using a contact's ID to select ContactWorld agent's ID

Using the contact's ID, which is stored in an existing data source, the SOQL subquery selects the IDs of the owners of the cases relating to that ID.

The main query returns the ID of the ContactWorld agent who owns the first case.

SOQL query
Data sources
Code Block
languagesql
themeEclipse
SELECT NVMContactWorld__NVM_Agent_Id__c
FROM User
WHERE Id IN
(
    SELECT OwnerId
    FROM Case          
    WHERE contactID = '$(Contact|ID)'
) LIMIT 1

User|NVM Agent Id

Using a contact's name to get a count of open cases that the contact has reported

Using the contact's id, which you have previously retrieved and stored in an existing data source, the SOQL query returns the number of unique open cases.

SOQL query
Data sources
Code Block
languagesql
themeEclipse
SELECT COUNT_DISTINCT(CaseNumber)
FROM Case
WHERE
	Contact.Id = '$(Contact|Id)' AND
	Status != 'Closed'

Case|Case Number|Count Distinct

Using an account's id to get the average opportunity amount

Using the account name, which you have previously retrieved and stored in an existing data source, the SOQL query returns the average time to resolve a case for the account in the last quarter.

SOQL query
Data sources
Code Block
languagesql
themeEclipse
SELECT AVG(Amount)
FROM Opportunity
WHERE
	Account.Id='$(Account|Id)'

Opportunity|Amount|Avg

Style
div#children-section.pageSection
{
display:none;
}
 
#main_content_override .codeContent, #main_content_override .syntaxhighlighter {
	overflow:hidden!important;
}