We are using Lightning.

Context URL https://stiyej--sdsd.lightning.force.com/lightning/r/ContentDocument/0690D00000sdsdRQAS

We want to get the conten id from the url in Apex. Is there any way we could get it ?

We are not using lightning component. Basically we are using data grid. So we want to know if it is possible directly in Apex to get the id from the context URL.

  • 0690D00000sdsdRQAS this is the content document id, which you can get using URL.getSalesforceBaseUrl().toExternalForm(). Can you please explain a bit more and what you have done so far ? – Mahmood Feb 10 at 11:47
  • How are you using a data grid without using a Lightning component? In what context is your code exposed? – David Reed Feb 10 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.