function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kiran2000kiran2000 

document link on visualforce page

Hi All,

 

 


On upload of document  to content we are creating records on custom object with a field containing the link to document and we are displaying the field on visualforce page.But the issue is some users try to delete the document from content and the link still shows up on visualforce page as the link doesn't gets deleted from the field.(custom object)

  

 

Thanks

Best Answer chosen by Admin (Salesforce Developers) 
Arun MKArun MK

 

 

Hi, 

 

You cannot write a triiger on Document to update the link on the Custom Object. What you can do is, write a batch apex and schedule it to check if all the links on the Custom object exist as document. If it exitss, leave it, If it doesn't change the link to blank and update the record.

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

 

Regards,

Arun.

All Answers

Peter_sfdcPeter_sfdc
Can you please take some time and provide some additional details on this problem? What you've described is a bit vague and difficult to know exactly what you're trying to do, and why.
kiran2000kiran2000

I have updated it.

Arun MKArun MK

 

 

Hi, 

 

You cannot write a triiger on Document to update the link on the Custom Object. What you can do is, write a batch apex and schedule it to check if all the links on the Custom object exist as document. If it exitss, leave it, If it doesn't change the link to blank and update the record.

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

 

Regards,

Arun.

This was selected as the best answer