I have a custom object Call2_vod__c
which is detail to Account.
It has a Signature_vod__c
field that is in encoded base64 format.
Now for one Account, I can create an attachment from any of the calls associated with it (Account:Call2_vod__c=1:many).
I am getting a limit exception with my below code. Can someone please help me?
Apex Class:` global class Account_chk { WebService static void method1(Id i) { List a= new List(); List p=new List (); List exist=new List (); exist=[select ParentId,id from Attachment];
Map existMap = new Map(); Map signMap = new Map();
for (Attachment att : exist) { existMap.put(att.ParentId, att); }
for (Call2_vod__c call: [select Name,Id,Signature_vod__c,Signature_Date_vod__c,Account_vod__c from Call2_vod__c where Signature_Date_vod__c !=Null and Account_vod__c not in :existMap.keySet()])
{
Attachment record = new Attachment(Name = Call.Id ,ParentId = call.Account_vod__c , Body = EncodingUtil.base64Decode(call.Signature_vod__c), ContentType = 'image/jpeg');
if (record.parentId !=Null && existMap.get(record.ParentId).Id == null) {
p.add(record);
}
}
try { insert(p);
} catch(System.DMLException e){
System.debug('The following exception has occurred: ' + e.getMessage());
}
} }`
Please find the error currently I am facing with the code:
Failed to execute 'send' on 'XMLHttpRequest':Failed to load 'https://cs18.salesforce.com/services/Soap/package/Account_chk'