Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.