Created
September 16, 2018 21:39
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global with sharing class AssessCustomerStatus { | |
@InvocableMethod | |
public static List<Results> GetStatus (List<Requests> requests) | |
{ | |
//this operates off the current User | |
Id userId = UserInfo.getUserId(); | |
User curUser = [select name, RevenueTier__c, contactid, contact.accountid from user where id = :userid]; | |
Integer severeCaseCount = [SELECT COUNT() | |
FROM Case, Case.Contact | |
WHERE Contact.Name = :curUser.name AND Priority = 'High' | |
]; | |
Results curResult = new Results(); | |
curResult.severeCaseCount = severeCaseCount; | |
curResult.revenueTier = curUser.RevenueTier__c; | |
List<Results> resultsList = new List<results>(); | |
resultsList.add(curResult); | |
return resultsList; | |
} | |
global class Requests { | |
@InvocableVariable | |
global String curUserId; | |
} | |
global class Results { | |
@InvocableVariable | |
global Integer severeCaseCount; | |
@InvocableVariable | |
global Decimal revenueTier; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment