0

We were trying to create a way to avoid having to upload and add 'notes/attachments' to all related Opportunities. Most of Opportunities need the same Note or Attachment on each new Opp created under that account and adding these to each new Opp created manually can be a very tiresome process when there are at least 5 or more documents that need to be on each Opp.

We needed a way to have one central location to input all Notes/Attachments and for them to copy to all related Opps that are created. We tried using the below VF page to display but the functionality did not work properly. I've included the code below in case it helps for review:

<apex:page standardController="Opportunity" showHeader="false" tabStyle="Opportunity" 
showQuickActionVfHeader="false" showChat="false"> 
<apex:tabPanel > 
<apex:tab label="Account Notes"> 
<apex:relatedList subject="{!Opportunity.Account}" list="CombinedAttachments"/> 
</apex:tab> 
<apex:tab label="Account Contacts"> 
<apex:relatedList subject="{!Opportunity.Account}" list="Contacts"/> 
</apex:tab> 
</apex:tabPanel> 
</apex:page>
0

So, do you want to have a placeholder for notes/attachments and then automatically attach them to your opps, right?.

You are saying that the notes/attachments are the same, at least most of them. The relation is the opps' account, right? .... Well, I will first select the notes/attachments I need to add to the opps based on the accounts and add them to my static resources.

Then, look for a logic that will help you, like account recordtype, address, account owner..etc. The idea is to come up with a logic that will help you to determinate which notes/attachments you need to add to the opps based on the account type. Later you need to code an APEX trigger on the opportunity object that will insert the correct notes an attachments based on the account logic every time you insert or update an opp.

This is an idea on how to start building your solution.

|improve this answer|||||

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.