We have created an apex class which generate pdf once the order has been created and the pdf get automatically get attached to the Opportunity's Notes & Attachments. It is working fine but it didn't executed one time in between, what cud be the reason?
Opportunity opp;
Boolean flag=false;
Try{
opp=[SELECT Id,(Select id from Attachments) From Opportunity];
if(opp.Attachments.Size()>0){
for(Attachment att:opp.Attachments){
if(att.Name=='AttName') //AttachmentName Given Name check
flag=true
}
else if(flag==false){
//Create Pdf Logic and attach here
}
}
}Catch(Exception e){
}
Thanks for the reply, I had incorporated this code in the apex class, issue is its working for all the opportunities but it didn't work in case of one of the opportunity order and i am looking for the possible reason for such exception to occur.
For Ex
Let me know if this helps.
Thanks for the reply, I had incorporated this code in the apex class, issue is its working for all the opportunities but it didn't work in case of one of the opportunity order and i am looking for the possible reason for such exception to occur.