You need to sign in to do that
Don't have an account?
Naitik Rai
How can we Insert Note Under Opportunity?
Hi Friends
I want to Insert Note under related list of Opportunity
using Apex Code Script.
Can Someone Please Help me to acheive this task.
Any help would be appreciated.
I want to Insert Note under related list of Opportunity
using Apex Code Script.
Can Someone Please Help me to acheive this task.
Any help would be appreciated.
this is file (content document object), use below code to insert Notes in opportunity : Kindly mark this as solved if this will helps you
Thanks
All Answers
Sorry for this issue you are encountering.
I assume you are talking about adding the text from that notes field into the note&attachement section of opportunity record. You can do so by using the below code. find more info here
- http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_note.htm#topic-title
In your case what you should do is, first insert the opportunity and then take the opportunity id and then insert the note.Please let us know if this helps.
Kindly mark this as solved if the information was helpful.
Thanks,
Nagendra
But i have already tried this and it is inserting in Notes & Attachment.
But i want to insert record in 'Note' shown in Screenshot
There could be two reasons -
1. Probably the Note is custom object and you need to insert records in the custom object associating it with Opportunity.
2. Attachment are being replaced with Salesforce files (https://help.salesforce.com/articleView?id=Attachments-are-not-returned-in-Lightning-Experience-search&language=en_US&type=1)so that could be a reason the that It's not showing the attachment option. So use following code to attach Note to Opportunity. Hope this would resolves your issue.
Happy Coding!
this is file (content document object), use below code to insert Notes in opportunity : Kindly mark this as solved if this will helps you
Thanks