2015-02-09 56 views
0

是否有人使用Salesforce開發人員工具箱新框?該文檔對Auth的工作方式非常粗略,我收到一個錯誤,返回的方法是「無法使用默認憑據來調出框。」有任何想法嗎?Salesforce開發人員工具箱授權框問題

public void onAfterInsert(List<Claimant__c> newClaimants, Map<Id, Claimant__c> newClmtMap) { 

     box.Toolkit boxToolkit = new box.Toolkit(); 

     for(Claimant__c aClaimant : newClaimants){ 
     String claimantFolderId = boxToolkit.createFolderforRecordId(aClaimant.Id, aClaimant.Last_Name__c + ', ' + aClaimant.First_Name__c, true); 

     boxToolkit.commitChanges(); 

     //debug code - mf 
     string clmfld = [SELECT folderId__c from Claimant__c where id =: aclaimant.id].folderId__c; 
     system.debug('-->CFolderID: ' + clmfld); 
    } 

}//end onAfterInsert 

回答

3

如果您在觸發器上下文中使用此方法,則應該使用@future(callout = true)對其進行定義。 Apex觸發器只能執行來自異步方法的標註。