You can link your comments to the project using your Project Number, and then use this relationship to view the related emails, you can even place a portal on the Project layout to view a list of the emails in the project file.
Assuming you already have the Comments file setup in the External Data Sources, as you would need this to open the file from Projects if your using the Open File script step. What you need to do is go into Define Database and under the Relationships tab click on the New Table Occurrence [TO] button which is towards the bottom left of the window, and in teh dialog that pops up select your comment file from the pop-up menu item next to 'Data Sources' and then highlight the table that holds the emails and click 'OK'
Now a new TO will appear on the graph, what you want to do is from the Projects TO grab and drag the Project Number field across to the Project Number field in the Comments TO, this will create your relationship.
Now once this is done to get the button to only view the related emails go into the script you run to open the file and change it from Open File to Go to Related Record and set the following:
Get related records from = Comments
Tick the option for 'Use external table's layouts'
Show records using layout = Then you email layout
Then under 'Result Options' tick 'Show only related records' and 'Match current record only'
And click 'OK'
And now your button will go to all the related record in your comments file.
To add the portal to display all the related records you want to go into Layout Mode on your Projects layout and click on the Portal Tool and draw the area you want to list all the emails and then a dialog will appear and set it to the following:
Show related records from = Comments
If you want it sorted by any particular value in the comment table, i.e. date click on the 'Specify...'
and tick 'Show vertical scroll bar'
and then click 'OK' and another dialog will appear with a list of field from the comments table, select the ones you want to display in your portal and ether double click on them or press the 'Move' button.
Once your done click 'OK' and the portal is created
I hope this helps
Thanks for the detailed help. It worked straight away and was quite simple thanks to the step by step explanation
Glad I could help mike_k