Hi, If you mean notes and attachment as a related list for custom object then First make sure notes and attachment are enabled for that custom object. Then in your VF page code, use this:
Hi Narender , I want to restrict other user to edit and delete option means i want to hide these two options for other user . so this is the only one option to create a visualforce page.
Hi I have add one Button to create New Attachment just like standard related list functionality. I have implement but after add file and click to done it will throw an below message. but the file is attach correctly against that record but why this message display
Data Not Available The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. If you know the data is not deleted but cannot access it, please look at our supportpage.
That's because my handledelete function only queries on Notes object, not on Attachment object. Create another function to delete the attachment by querying the record.
I have created custom related list called Active Quotes for Opportunities. For this to happen, I have created a lookup field in quote in relation to opportunity and added list button called New Quote for Active Quotes custom related list
In lightening, if New Quote button of custom related list which has url as below is clicked, backgroud got screwed up and on Edit Screen of Quote, it is not populating Opportunity and related account.
Use this code:
Let me know if it helps.
Thanks.
All Answers
If you mean notes and attachment as a related list for custom object then
First make sure notes and attachment are enabled for that custom object.
Then in your VF page code, use this:
<apex:relatedList subject="{!account}" list="CombinedAttachments" />
I have requirement of create a Visualforce Related List to display Notes and Attachment Details in Contact object with Edit and Delete Actions.
I want to restrict other user to edit and delete option means i want to hide these two options for other user .
so this is the only one option to create a visualforce page.
Use this code:
Let me know if it helps.
Thanks.
can we add Edit and Delete action against Notes and Attachment Records
Yes we can.
If my previous answer helped you, please mark it as the best answer so that others with similar requirement can benefit from this post.
Thanks.
Can you please help to complete above requirement
Thanks
Use this code:
I have add one Button to create New Attachment just like standard related list functionality. I have implement but after add file and click to done it will throw an below message. but the file is attach correctly against that record but why this message display
Data Not Available
The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. If you know the data is not deleted but cannot access it, please look at our supportpage.
Below is my code-:
I suggest you post your error as a new query, I can only guess why you are getting this error(never encountered it).
Its working now the url will be wrong
PageReference pageRef = new PageReference('/p/attach/NoteAttach?pid='+Transactionid+'&parentname='+TransactionName+'&retURL=%2F'+TransactionID);
Your HandleDelete function not work when I delete attachment it will throw an error List has no rows for assignment to SObject
I have created custom related list called Active Quotes for Opportunities. For this to happen, I have created a lookup field in quote in relation to opportunity and added list button called New Quote for Active Quotes custom related list
In lightening, if New Quote button of custom related list which has url as below is clicked, backgroud got screwed up and on Edit Screen of Quote, it is not populating Opportunity and related account. As I am passing opportunity id to quote, it doesn't show up opportunity and account related to it and background gets screwed up.
Please check images before button click and after click to find background gto screwed up.
In Salesforce Classic, it is working as expected.
Could you please help how to fix it.