I am capturing image from webcam and storing the image in record attachment by a managed package app. I have a text field in record detail page path__C where i need to capture inserted image (in attachment) path url. Can anyone help me in that.
I have tried writing down the trigger. I need a small help in this. Below is my trigger . In this i want to filter out those attachments whose name is 'Default.png' and then update. Please help.
trigger SetIdToAttachment on Attachment (after insert) {
String Title;
Id pId;
for(Attachment att: trigger.new){
Title=att.Id;
pId=att.ParentId;
}
List<Devotee_Details__c> c=[select Id , GnD__c from Devotee_Details__c where Id=:pId];
//assuming one record is fetched.
c[0].GnD__c=Title;
update c[0];
}