문제

I am getting error "unexpected token List " while compiling the following code

trigger Lead_Casecloseafter on Lead (after update) {
    // Collect ODST leads
    id vRecordTypeId = [select Id from RecordType where name='ODST_Leads'];
    set<id> vSetCaseId= new set<id>();

    for (Lead vLead:trigger.new)
    {
        if (vLead.RecordTypeId == vRecordTypeId && vLead.IsConverted == true)
            vSetCaseId.add (vLead.ODST_Case__c);
        }
    }

    // Looking up associated Case
    List <Case> vLstcase = new List ([select id,name,Case_Number__c,Status from            ODST_Case__c where ID IN:vSetCaseId]);

    for (Case vCase:vLstcase)
    {   
        vCase.Status == 'Closed';

        if(!vLstcase.isempty())
            update vLstcase; 
    }
}
도움이 되었습니까?

해결책

Judging by the rest of the code, it looks like you're missing an opening brace ({) after this line:

if (vLead.RecordTypeId == vRecordTypeId && vLead.IsConverted == true)

The closing brace immediately after the if closes the function (since there was no block opened for the if), causing the List line to be in an invalid context.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top