Printing Portal records

Hello,

I have two buttons. One prints closed records, one prints open records.  The Closed records button prints details of a record, but not the notes (which is based on a different table from record details), the open button prints notes, but not the records. I did base the scripts on layouts that use the correct table for notes, but I can't figure out what's not working. ;\

Any help would be much appreciated!

Astrid
_Astrid_Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Will LovingPresident, Dedication Technologies, Inc.Commented:
The problem was that the print layout, "All Opportunities List" was set to display as "Table" and what you needed was "Form". That's why the notes were showing up on the left as a column. I changed it to Form, set the View options for the layout to only allow Form and also tweaked the script a little bit.

The Notes area had Sliding Up applied to it but not "Reduce Size of Enclosing Part". It's sometimes better to set a field as a Merge field rather than an "object" field so I changed the Notes to be a Merge field in a text block and added the "NotesInfo" field below it. The entire text block is set to slide up and "Reduce Size of Enclosing Part" and the "Notes" field label is set to display only if it's the first Notes record so it's not repeated down the page.

You could probably tighten up the entire List Layout so that it fits easily on one page unless there are a large number of notes.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
_Astrid_Author Commented:
Thanks, Will! I'll take your advice and clean up the layouts.......as always, your help is much appreciated. Happy Wednesday!
0
Will LovingPresident, Dedication Technologies, Inc.Commented:
Thanks, Will. I 'm still having a problem though....in the version you posted, when I click the Print Closed Opportunities button on the Welcome Screen, I still only see Notes and not the info such as Date Closed, Date Opened, Opportunity Name in the Preview window for printing.

That script is using the Closed Opps List layout, which I had set up just like the All Open Opportunities layout (based on Notes), so it should work. I'm confused as to why it doesn't.

The same thing happened to the Print Open Opportunities button. It uses the Open Opportunities List, but in this case, it shows the info such as Date Opened, Opp Name but no notes. Confusing.....what am I missing here? Thanks

I must have misunderstood what you were trying to do. I modified the script attached to the "Print Report" button on the Opportunity Details layout. The Notes layout that it goes to there works correctly.

So, in order to figure out do this from the Welcome screen, you need to answer a couple of questions:

1. Are you wanting go print all "Open" or "Closed" Opportunities viewable in the portal?
2. Do you want them as a Continuous list or with Page Breaks between each "Opportunity"?
3. Is there any difference between the Open and Closed layouts? Meaning could you use the same layout as long as the correct word "Open" or "Closed" appeared in the title?

Also, your Closed layout is based on the correct table, Notes, but the Open one is based on "Opportunity Details". If, rather than placing the Notes in the right column where there will likely take up a lot of room and waste a lot of paper, you can have them listed full width below it would probably work better. The "All Opportunities" layout, which is the one I tweaked, shows this option.
0
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

_Astrid_Author Commented:
Hi Will,

1. I'd like to print out all "Open" or "Closed" opportunities using a specific layout, not the portal view.
2. I'm not sure....it depends on paper wastage. I would go for the option that wastes the least amount of paper.
3. There are a few fields that would differ between the two layouts, as well as "open" or "closed" being listed on the title.

I'll make tweaks tonight and see what I come up with!

Thanks,
Astrid
0
_Astrid_Author Commented:
Yeah, I'm not sure why I can't get those search results to print correctly. They look great out of Preview mode, but when you enter Preview mode, the results from the Opportunity table do not print for either of the two reports (open and closed).

I've created the new layouts for both Open and Closed printing from the home screen with the fields I need, following your directions for the Notes sections. It must be something easy......only the notes show up now for both results when you try to print. ;\
0
Will LovingPresident, Dedication Technologies, Inc.Commented:
That's actually how it's supposed to work and why there is a "Preview" mode. Sub-summary parts only show correctly when you use Preview so that's why it's included as a script step, unless of course you just need it to print in which case you don't actually need the Preview step because Printing has the same affect. Preview also makes the effects of "Sliding" options - left or up - visible whereas they are not in Browse Mode.

Some notes:

1. The reason your Sub-Summary was not appearing correctly, even in Preview was because your script lacked a Sort step. When you create a sub-summary, the dialog says "when sorted by" and then you select a field in this case, ID_Contact. However, your script lacks that step which needs to come before the Preview or Print step.

2. Your script also lacks a Print Setup step which must happen before the Preview or Print steps and is essential to establishing whether a layout prints in Portrait or Landscape. It also lacked a Preview step before the Pause. The order is important: Page Setup, Enter Preview Mode (no pause), Adjust Window (Resize to Fit) ; Pause Script

3. The Viewing area of your Opportunities List report was set to 11 inches wide but I'm assuming you wanted it to be Portrait. You can reset both it and Page/Print Setup if I'm wrong about that.

4. If you want each "Opportunity" to print on it's own page then the Sub-Summary Part needs to have the "Page Break before each Occurrence" option checked. If not, the leave it unchecked but you might want to put a horizontal rule at the top of the Sub-Summary part to separate it from the next "Opportunity" listing.

5. The "Found Count" will display All records found in the current found set, rather than just for the Opportunity. To limit it, create a calculation field in Opportunity Details:

CountNotes = Count( Notes::NotesID )

And then put this related field in the Header. It will show the correct number of Notes for each Opportunity

6. You use a Go to Related Records in your script but then also perform a Find that presumably gives the exact same result. You can use a GTRR step or New Window, Go to Layout and then a Find. However, there are problem with your Sort Results Home Page relationship, so the GTRR doesn't really work and you should use the New Window approach until you fix the relationship.

The Sort Results relationship has six predicates, all of which are Cartesian Joins ( X ) which means that every record is related to every other record. Since even one Cartesian join relates all records to each other, you should only need one. What you are really doing all the display work in your Portal Filter which should work fine but should not need all those extra Cartesian predicates.

7. Be careful about your Layout naming. You now have two separate layouts with the exact same name, "Closed Opportunities List". Always name your layouts explicitly and set their order to avoid any confusion down the road.

Finally, you can actually just use a single script and a single Layout for both the Open and Close Reports by passing a different parameter from each Welcome screen button, "Open" or "Closed". At the start of the script, extract the Parameter into a Global Variable, e.g. $$ReportType and embed that on the layout as a Merge field in the Title, e.g. <<$$ReportType>>

The only that then differentiates the two scripts is the GTRR or the Find, whichever you use. Everything else is the same including the Sort.
0
_Astrid_Author Commented:
Awesome! Thanks so much, Will. I made all these changes, and added to the script to change layouts depending on the search and everything works!

My only small issue: the found count for the total records found isn't accurate. It's picking up the Notes as well since it's using two tables (I presume). I'm using ({{FoundCount}}). What can I use to accurately display an actual found record count? Thanks!!
0
Will LovingPresident, Dedication Technologies, Inc.Commented:
See previous comment:

5. The "Found Count" will display All records found in the current found set, rather than just for the Opportunity. To limit it, create a calculation field in Opportunity Details:

CountNotes = Count( Notes::NotesID )

And then put this related field in the Header. It will show the correct number of Notes for each Opportunity
0
_Astrid_Author Commented:
Hi Will,

I may not be understanding or explaining correctly. I'd like to reference the actual number of records found in the found set (opened opps or closed opps), not the amount of notes per opportunity. Is that possible from a calculation field? Thanks!! :)
0
Will LovingPresident, Dedication Technologies, Inc.Commented:
Since you are working from the Notes table, which is the most efficient way to present and unknown number Notes (using the Body part and sliding up) you'll need to find out and capture the number of Opportunities related to and unknown number of Notes.

Since your saved "Find" criteria in your script are already using the related DateOpen and DateClosed fields in Opportunity Details, the easiest thing would be to do the following:

1. Make the initial layout for the Find be one based on Opportunity Details
2. Perform the Find
3. Capture the FoundCount to a Global Variable, e.g. $$OpportunityCount = Get ( FoundCount )
4. Use a GTRR script step to get to the Notes layout using the "Match Found Set" option
5. Add $$OpportunityCount as a Merge Variable at the top of the layout.

Set VariableGo To Related RecordScript changes
0
_Astrid_Author Commented:
Hi Will,

Thanks for this update! I have gone through the steps and the changes worked for Open opportunities, but for closed opportunities, it's still showing my full record count instead of just closed records.

If I understood you correctly, this script would work for both Closed and Opened opps? I see that you have two Perform Finds in the script, I'm assuming that one is for Open and the other is for Closed opps even though this script uses the Closed Opps layout (which I would need a different layout for Open opps).

Thanks!
0
Will LovingPresident, Dedication Technologies, Inc.Commented:
See point 7 in the comment above, especially the last two paragraphs. You can use the same layout for both by using the $$ReportType variable on the layout to indicate which it is.

With regard to using a single script for both Open and Closed, I gave you the screen shot above, but I did not change the script in the file that was uploaded previousl. You'll need to edit the script in your file and test it.
0
_Astrid_Author Commented:
I was able to fix the Closed opps record count, so now both are working. Yay! But the variable that passes the Report Type isn't working now for Open opps....so I'm looking into what that could be. Thanks for your time!
0
_Astrid_Author Commented:
Got it! It's all working now. Thank you, Will!
0
Will LovingPresident, Dedication Technologies, Inc.Commented:
You're welcome  :-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
FileMaker Pro

From novice to tech pro — start learning today.