You need to sign in to do that
Don't have an account?
mukesh gupta
Attachment on record
Hi Expert,
I want to add attachment on record creation time in apex code, but in attachment custom code we need record Id, but record is not created. so how achive this functionality,
Example: when we fill any exam from then we can attachemtn or document, and then save the record.
Thanks
I want to add attachment on record creation time in apex code, but in attachment custom code we need record Id, but record is not created. so how achive this functionality,
Example: when we fill any exam from then we can attachemtn or document, and then save the record.
Thanks
Yes, you can achieve this functionality by using a trigger. You can use the trigger on sobject you want
to insert an attachment at creation time. In the Below Code, I have use Account as sobject and create a
new text attachment at the time of the creation of account.
And if you want to upload any file then the file should be in your org. You have first upload the file in
documents ----> select any folder you want to upload file ---> then query the file to insert to attachment.
Trigger ==>>> Handler Class ==>> I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha
www.kdeepali.com