aguest Posted January 19, 2015 Posted January 19, 2015 Hi, Â I am creating a school db and I want to ability to email a record to some colleagues. The send email bit works fine, it attaches a pdf as required to the email prior to sending. Â The bit that's gone a bit wrong (or maybe not!) is the actual PDF has only got the layour design on there, the data hasn't been added. I'm getting a header and name of the layout and then a blank screen. Â I've attached my script. Any help / direction is greatly appreciated. Â Thanks Ann
Wim Decorte Posted January 19, 2015 Posted January 19, 2015 looks like the "find matching" is not working as expected. You probably don't need it because you are switching layouts but stay on the same table; so you'll stay on the same record by default.
bcooney Posted January 19, 2015 Posted January 19, 2015 How are the tables "TeacherEvaluation_tbl_Subject" and "tbl_TeacherEvaluationForm" related. Perhaps by the teacher's primary id, "__Pk_"? If so, use Go to Related Records, match current record, to jump from one context to the other. I find your table naming convention difficult to follow. You might wish to post a diagram of your tables and how they are related, because having the correct data model is crucial to a successful solution.
aguest Posted January 20, 2015 Author Posted January 20, 2015 HI, Thank you for your help. I've attached a copy of the relationships so you can see how the tables are related.  I've got a slide control on the layout I want to save to pdf. Will this cause a problem.  Many Thanks Ann Â
bcooney Posted January 20, 2015 Posted January 20, 2015 Ann, It looks like you're relating an evaluation form to the subject table incorrectly. I see __fk_Subject = SubjectDescription, rather than __fk_Subject=__pK__ Also, whenever I have people related to an entity, I use this data model: People>Team<Entity So, in your case, rather than all the separate relationship from the Evaluation Form to Staff, all you'd need is one relationship. The Team table would have the foreign keys for the Evaluation form and the Person, and a RoleID. Create a RoleType table. All you need is RoleID and Description. Then, on the Evaluation form, place a portal to the Team table and allow the user to add Team members and select their role. Back to the original problem: On what layout is the "Send Evaluation" button. I realize now that I have no idea where you're starting. You want to send a specific evaluation to a teacher, correct? "I want to ability to email a record to some colleagues." Or, are you looking to send all the evaluations that you have for a specific teacher to him? btw, your naming conventions are overly complicated. But, if your comfortable with them, then that's your decision. imho, there is no need to include tbl in a table name.
Wim Decorte Posted January 20, 2015 Posted January 20, 2015 what is the Table Occurrence that you are on when you start this process?
bcooney Posted January 20, 2015 Posted January 20, 2015 LOL, Wim. Do you want to take on this one? I'm onsite all day, so that's the last bit of time I have for this. (Wish me luck on External Authentication and a FMS12 server upgrade!).
aguest Posted January 20, 2015 Author Posted January 20, 2015 Thanks BCooney. I missed that error. In answer to your questions, the Send Email button is on a layout based on the TeacherEvaluationForm table. It's on the last slide control so once the observer has entered all the information they can then email a copy of it to the teacher they have just evaluated. I only want it to send the current record that they are looking at. Wim, I am on the main table as per the diagram above. Thanks Ann
Wim Decorte Posted January 20, 2015 Posted January 20, 2015 Ok, instead of using "find matching records", do the file explicitly by using Enter Find Mode Set Field <you want to search on> = <what you want to find> Perform Find set variable [ $error = get(lasterror) ] If[ $error <> 0] show custom dialog] $error ] End if I'm pretty sure you'll see that the find request errors out
aguest Posted January 21, 2015 Author Posted January 21, 2015 Hi Wim, Thanks for that. The script doesn't seem to be erroring, however, even with the above changes when it creates the pdf it's blank. I check it with another layout and it worked fine. The difference in the layouts is I have a slide control on the one that comes out blank and nothing on the other layout. I think I'll have to create a view layout without the slide control to get it to work, unless there is another way? Thanks for your help. Its greatly appreciated. Ann
Wim Decorte Posted January 21, 2015 Posted January 21, 2015 If you go to a layout with a tab panel or slide control, it will default to the default tab/panel. So if your stuff is not on that default panel you will need to do a "go to object" to activate the right tab/panel
Recommended Posts
This topic is 3593 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now