Can you show us your script?
post the file.
My guess is that your script is trying to send from a context (layout) that does not have access to the fields you think it does
The script is a simple one:
1. Go to Layout ["EmailList" (EmailList) ]
2. Perform Find [Restore]
3. Send Mail [ Send via SMTP Server; No Dialog ; To: EmailList::EmailAddress ; Subject: EmailList::SubjectEmail ; Message; EmailList::FlySheetSend]
4. Go To Layout [ "SalesAdminItems" (Issues Tracking) }
The fields SubjectEmail is a calculation: "New Order Notification for "& Issues Tracking::Customer & "WO#: " & Issues Tracking::Work Order Number
and the field of EmailList:: FlysheetSend is also a calculation:
"New Order Notification for " & Issues Tracking::Customer & "¶¶"&
"Part Description: " & Issues Tracking::Part Description & "¶¶"
& "Part Number: " & Issues Tracking::CAD_PartNumber & ", Quantity of: " & Issues Tracking::Order QTY & "¶¶" &
"Purchase Order Number: " & Issues Tracking::Purchase Order &"¶¶" &
"Purchase Order Due Date: " & Issues Tracking::Customer Delivery Dates &"¶¶" &
"This job is for the " & Issues Tracking::Location & " Location"
Do all these fields need to be in the same table or something? I've tried that also, but still didn't work. The only thing appearing is the straight text field.
Thanks for the help, really, you have no idea how much I appreciate it.
Yes they all need to be in or related to the table from the layout EmailList.
That were you sent the mail from.
If you put the fields on the layout EmailList do they have value then?
Are your calculation fields a text or a number field? (should be text)
Can you show us your relationship graph?
Yes, both calculations are text results.
If I put the other fields on the EmailList layout, they do not show. However, the 2 tables are related, as above, by a "WO" field.
It's basically, an email table, names and email addresses with a plant location. From there, I want to find a particular plant, to get those email addresses, then sent to those, the current record only with the fields selected from the Issues Tracking table. - these are the ones noted in the message body above. I wouldn't think it should be this difficult, LOL.
Hope this info helps!
Do you have the plant number in the issues tracking table and do you have the plant number in the emaillist table?
Can there be multiple emaillist records for one issue tracking record?
Is the issue tracking table also your work order table?
The plant name is in the EmailList. The fields in the EmailList are: Name, Email Address and Plant location.
I can do a find on a plant name and get those records I want to send the email to, that works fine.
Yes, there are always multiple email address getting the same issue tracking record. Its just a new order has arrived notification. So one issue tracking record to many email addresses.
Yes the Issue Tracking table is the main, large table, the Work Order table. It's related to the EmailList by WO number. - doesn't have to be, I don't think it really matters what the relationship is.
Your relationships are important.
The work ordernumber in the issues table has the same value as the work order number in the email list table?
Are they both numbers?
If the fields are empty in your layout, they will be empty in your script also.
So thats the easy part
Yes, the WO number in both tables are the same - as text. (sometimes they have -'s or letters in them).
Maybe this is why it's not working? I don't really have a layout for emails. I have a table with email addresses and people's names, and a plant location. I guess I am not understanding how I could have customer records on an email table. (WO number, customer name, address, etc..) where there are many of them, and also many email addresses.
What would match up to what? If the script is just calling for these variables from the current record, and the tables are related, I don't understand why it can't grab them from the current record, and place them where I have noted.
Maybe this is something I need to do a join table for?
Just throwing some thoughts out there... thanks again for the help.
if you are sending from a layout based on the EmailList table then the only reason that EmailAddress, SubjectEmail or Flysheetsend would be empty are if the calculations were wrong OR your perform find puts you in a found set of zero records.
The calculations rely on a relationship between the Issues Tracking table occurence and EmailList table occurence so you have to make sure the relationship is right on the graph and that the data is there in the linked fields to produce a match.
To check the second condition...
Go to Layout ["EmailList" (EmailList) ]
Perform Find [Restore]
If FoundCount > 0
Send Mail [ Send via SMTP Server; No Dialog ; To: EmailList::EmailAddress ; Subject: EmailList::SubjectEmail ; Message; EmailList::FlySheetSend]
Custom Dialog message
Go To Layout [ "SalesAdminItems" (Issues Tracking)
Furthermore inserting a join table without thought nor reason suggests that you need to understand your data better and how it fits best in an RDBMS. Google normalization and data modeling to begin the learning process. You dont want to add an axle to your car when all you have is a flat tire.