Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Scripting Problem


Onesimus

Recommended Posts

Please download the file called MASTER.zip. Username and p/word is abc.

 

My database has 5 colourful students. Click any red button.

 

The yellow "History" button is a summary of the 3 buttons to the left of it. However, when it is clicked, it does not show the correct student - only the 1st student in the database (Jesse).

 

3 scripts are affected : Preview/Print - SummaryAP/AX/AZ.

 

Could someone please help make these scripts show the correct student. I am interested in knowing what has been done.

 

Many thanks!

 

Onesimus

Link to comment
Share on other sites

I have looked at this and followed your instructions above and the preview mode shows the first page of the first student and then a further 9 pages (making two pages per student all told) I assume that you only want one particular student to show up - the one whose record you are browsing? To make this happen in Preview mode you have to have a found set consisting of that one student (a common practice with a single user database is the sequence of Find All, omit, show omitted so you could add this to your script before running the preview)

 

However, if you are printing the report it will not be a problem as printing Current record all pages will just give you the one record.

Link to comment
Share on other sites

Actually, the History scripts show all of the students in the found set, as should be expected. Your starting layouts are based on Main. Your report layouts are also based on Main. So changing the found set in one also changes the others. Your GTRR step has no effect in this case, since the current layouts are not based on Infringements or the other tables.

 

You need to add a step before the existing GTRR one to go to the related records based on the portal relationship, and then go to the related Main records from there. Also, the Go to Field [relationship::PortalField] step is unnecessary.

 

Alternately, you can isolate the current record and simply Go to Layout [Report Layout] without using any GTRR steps.

Link to comment
Share on other sites

Thanks SlimJim & -Queue- for your quick responses! Using Q's idea of Go To Layout[name] worked - as simple as that!

 

Thanks, again, from the Land Downunder!

 

Onesimus

Link to comment
Share on other sites

Sorry for being a pain in the backside, but can I trouble you for a bit more scripting advice.

 

I started off simply using:

 

Go To Layout["SummaryA" (Main)]

 

& it showed the correct student.

 

However, adding the script:

 

Perform Script["PreviewPrint]

 

to allow for preview and/or printing of this layout (based on the selection from the drop-down menu at the bottom of the portal on each student's record) led to the first record being displayed (Jesse's). Clicking the Continue btn showed the layout of the student I actually wanted to preview &/or print but there was no preview and/or print ability.

 

Two points:

 

1. Why does the line Perform Script ["PreviewPrint"] cause this strange problem

 

2. How can I get back to the original layout after a preview and/or print - the one that had the History btn!

 

I am sure I am missing something from your posts - at this stage of my FMP learning, I seem to understand the solution better when scripts are provided with answers!

 

Again, thanks for your help!

 

Onesimus

Link to comment
Share on other sites

The "isolate" solution may be the best so whenever you want to preview and print just one record add the following to the beginning of the script:

 

Show All Records

Omit Record

Show Omitted Only

 

This will produce a found set with just the current record and then the rest of the script should work OK

 

On a different topic I have always wondered about the pronunciation of onesimus is it one-simus or o-nes-imus or something else altogether.

Link to comment
Share on other sites

Dear SlimJim,

 

No, Onesimus is not my real name! Apparently, Onesimus was a slave returned by St Paul to his master. I thought that it was a rather unique name to use! I like to think that the pronunciation is on-es-simus!

 

Again, thanks for your help!

 

Onesimus

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...

Important Information

Terms of Use