function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MIKE_DAYMIKE_DAY 

APEX PAGE TO DISPLAY AN OBJECT AND RELATED LISTS

Help??!!

 

Hi, I have been attempting to develop an Apex page that will do the following from a button click on an opportunity but after several attempts got lost:

 

Display Current Opportunity details in a page block (I can do this part)

 Start a loop{

  Display Related Quotation Details in a block

    Start a Loop{

     Display Quotation Related Products within a block

    End the loop}

 End the loop}

Save as PDF and Email

 

The finished page should look something like this:

 

---- Opportunity Details ----

 

Opportunity Name: TestOppo1

Account: TestCompany

 

---- Quote1 Details ---

 

Quote Name: Quote1

Value: £1000.00

 

--- Quote 1 Line Items ---

 

Product Name: Product 1

QTY: 1

Price: 500

Product Name: Product 2

QTY 1

Price: 500

 

---- Quote2 Details ---

 

Quote Name: Quote2

Value: £1000.00

 

--- Quote 2 Line Items ---

 

Product Name: Product 1

QTY: 1

Price: 500

Product Name: Product 2

QTY 1

Price: 500

 

-- Opportunity Detail --

 

Value: £2000

Tax: 20%

Grand Total: £2400

 

If this makes sense to anyone and you have done this is a roundabout way with another object PLEASE let me know as I

am new to APEX and this will be my first page.

 

Please let me know if I haven't provided enough detail.

 

Mike

MikeGillMikeGill

Difficult to understand what it is you're trying to do.

 

It's sounds like you want to mash-up Opportunity  plus multiple Quotes & Quote Products into a single PDF?

 

What are you able to do so far?

 

Are you able to produce a PDF from a button for only the Opportunity?

 

You should also check this out

 

http://appexchange.salesforce.com/listingDetail?listingId=a0N300000016b7FEAQ

 

 

MIKE_DAYMIKE_DAY
Hi Mike

Thanks for the post. I checked out the app and it appears to do everything I need however given that I have 170 users is a bit expensive for us right now.

At the moment I have a button linked to an apex page, which has been rendered as a PDF. I am working on the send and email part which I found on a blog. I can list the opportunity detail and show the related lists but not on the grouping that I need. I have seen that I could use a loop within a class then call it into my page but with this being my first I am trying to make sense of it.

I may trial the app exchange and see how they do it but Does this explain it better?

Thanks

Mike
MikeGillMikeGill

The trial will allow you to test properly.

 

Not sure what blogs you have found - but here is a good list of the ones I have found

 

http://agentgill.wordpress.com/salesforce-blogs/

 

If you post your custom controller class I will try and help. Obviously this is accounts, but you will need to a number of getter methods I would guess e.g. one for Quotes

 

             List<Account> accounts;
				Boolean selected {get; set;}


        public List<Account> getAccounts() {

                if(accounts == null) accounts = [select name from account limit 10];

                return accounts;

        }

 

 

MikeGillMikeGill

Ignore the boolean line BTW