So far I have
trigger defaultEntitlement on Case (Before Insert, Before Update) {
List <Entitlement> entls = [Select
e.StartDate, e.Id, e.EndDate, e.AccountId, e.AssetId
From Entitlement e
Where
e.AccountId in : acctIds and e.EndDate >=Today and e.StartDate <= Today];
if(entls.isEmpty()==false){
for(Case c : Trigger.New) {
if(c.EntitlementId == null && c.AccountId != null){
for(Entitlement e:entls){
if(e.AccountId== c.AccountId){
c.EntitlementId = e.Id;
if(c.AssetId==null && e.AssetId!=null)
c.AssetId=e.AssetId;
break;
}
I get Compile Error: Variable does not exist: acctIds. 2 questions really 1. will the above trigger do that 2. how do I fix the Variable does not exist error and is there any more I need to add.
답변 1개
This community is focus on salesforce administration relates stuffs. Please post your questions in developer forums such as to get quick response
http://developer.salesforce.com
http://salesforce.stackexchange.com
Anyway do you have the variable acctIds declared??
Please mark as best answer to close this thread