1

I have a requirement for a custom app I am building to open an attachment on the parent record in a new window on create of a child record.

I have parent object Quality_Assessment__c with child object Chart_Review__c. Quality_Assessment__c has a PDF attached to it in the Notes & Attachments section. When a user clicks to create a new Chart_Review__c record I need to have the PDF attachment on the Quality_Assessment__c record open in a new tab as well as the record create page for the Chart_Review__c record. Looking for help in generating the needed javascript for a custom button to accomplish this.

The 'Quality_Assessment__c' record will have a PDF file attached to it prior to the user clicking the 'New Chart Review' button.

My use case is to have users open the 'Quality_Assessment__c' record and perform what we call a Chart Review. To perform the Chart Review the user would click on a custom button called 'New Chart Review' which would do two things.

  1. create a new 'Chart_Review__c' record displaying the new record edit page
  2. open the PDF attachment from the related 'Quality_Assessment__c' record.

Preferably on click of the button the new record page would open in existing tab and a new tab with the PDF would open simultaneously.

  • 1
    can you update this question with some more details. 1. is it SFDC app. 2. are you creating record using any api? 3. are you trying to achieve this using force.com visualforce page and apex class. because what you are asking is quite simple thing. – Himanshu Dec 15 '15 at 19:08
  • Hi Himanshu, yes this is a SFDC app. I am not using any APIs to do this, just two custom objects and most likely a custom button with some javascript to perform the action I need. Programming is not my forte, I am sure it is something simple, just not sure how to go about it. – J Tanner Cannon Dec 15 '15 at 21:36
  • @JTannerCannon I understand some what. but when user click on Chart_Review__c new button I need to have the PDF attachment on the Quality_Assessment__c record open in a new tab as well as the record create page for the Chart_Review__c record what do you mean pls clarify? – Ratan Paul Dec 16 '15 at 17:33
  • @Ratan - The 'Quality_Assessment__c' record will have a PDF file attached to it prior to the user clicking the 'New Chart Review' button. My use case is to have users open the 'Quality_Assessment__c' record and perform what we call a Chart Review. To perform the Chart Review the user would click on a custom button called 'New Chart Review' which would do two things. 1 - create a new 'Chart_Review__c' record displaying the new record edit page 2 - open the PDF attachment from the related 'Quality_Assessment__c' record. – J Tanner Cannon Dec 16 '15 at 17:38
  • @JTannerCannon, both action should should happen at a time. means new record edit page open in new tab and current tab open pdf file ? – Ratan Paul Dec 16 '15 at 17:42

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.