Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5295 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

The situation is this.

We have an "Enterprise FM solution" which was developed here and is now being shared with our factory in china. We use mac and china is on windows.

It contains a FM email system and has been is use for quite awhile.

Users here send PDF's, jpg, png files to china for a variety of rquirements.

As far as I know there haven't been any problems with the email system and attachments, that is until this week.

For some reason or other they can nolonger save PDF attachments. There haven't been any changes made to the email script for along time.

I ran some tests signing on as a user in china through RDC and found that as soon as I tried to save a PDF attachment FM went Not Responding mode. If the attachment was a jpg it was save without issue.

We have setup a script that checks the user file path and applies it to any exports. This hasn't change since we finally got it working.

The code that runs the download is....


018 Download Attachment 

If [ IsEmpty ( MondettaMail_Attachments::MMA_Attachment ) = 1  // No attachment bail on script ] 

Exit Script [  ] 

End If 

Set Error Capture [ On ] 

Set Variable [ $filepath; Value:Case ( 

Middle( Get (DesktopPath);2;1) = "U" ; "filemac:/" ; 

Middle( Get (DesktopPath);2;1) = "M" ; "filemac:/" ; 

Middle( Get (DesktopPath);2;1) = "m" ; "filemac:/" ; 

Middle( Get (DesktopPath);2;1) = "C" ; "filewin://DEEPTHOUGHT/" ) 

& "MondettaEnterprise/Groups/ERP/Documents/Programs/" 

& MondettaMail::MMB_ID_Program_Number & "/" 

& MondettaMail::MMB_ID_Program_Number & "_Mail_Attachments/" 

& Middle ( GetValue ( MondettaMail_Attachments::MMA_Attachment_Path ; 1 ) ; 6 ; 999 ) ] 

//  Set Variable [ $filepath; Value:Case ( 

Middle( Get (DesktopPath);2;1) = "U" ; "filemac:"  & Middle ( MondettaMail_Attachments::MMA_Bottom_Line  ; 10 ; 999 ) ; 

Middle( Get (DesktopPath);2;1) = "M" ; "filemac:" & Middle ( MondettaMail_Attachments::MMA_Bottom_Line  ; 10 ; 999 ) ; 

Middle( Get (DesktopPath);2;1) = "m" ; "filemac:" & Middle ( MondettaMail_Attachments::MMA_Bottom_Line  ; 10 ; 999 ) ; 

Middle( Get (DesktopPath);2;1) = "C" ; "filewin:/" & Middle ( MondettaMail_Attachments::MMA_Bottom_Line  ; 10 ; 999 ) ) ] 

//  Show Custom Dialog [ Title: "Filepath"; Message: $filepath; Buttons: “OK” ] 

Go to Field [ MondettaMail_Attachments::MMA_Attachment ] 

# 

Insert File [ MondettaMail_Attachments::MMA_Attachment; “$filepath” ] 

# 

//  Set Field [ MondettaMail_Attachments::MMA_Attachment; $filepath ] 

# 

Export Field Contents [ MondettaMail_Attachments::MMA_Attachment ] 

Initially the "Insert File" statement contained "Reference" so we were holding only the file location and not the file itself, a wish from the higher ups who didn't want to clog the DB pictures etc. With "reference" in the statement FM would hang on download PDF. Without it it downloads.

This script works on the Mac side with or without "reference".

Thanks

Michael

Posted

OK. So, the overall flow is the user Saves as PDF a report, and it is stored in a container field. Then the email script uses export to attach this file to an outgoing email.

I'd like to see the Save as PDF script and email script. You do not need all this filepath case statements, imho, if you have the attachment in a container. Just export to temporarypath and then attach. Then, clear the container.

Posted

Actually it only stores a reference to the file.

The multitude of files paths are there because some people are on laptops, others are on iMacs, and for some reason they have different setups.

Not sure why this is, before my time here.

The add attachment script....


017 Mondetta Mail Attachments Reference 

Set Error Capture [ On ] 

Go to Field [ MondettaMail_Attachments::MMA_Attachment ] 

Insert File [  ] 

[ Reference ] 

Set Variable [ $filepath; Value:Case ( 

Middle( Get (DesktopPath);2;1) = "U" ; "filemac:/" ; 

Middle( Get (DesktopPath);2;1) = "M" ; "filemac:/" ; 

Middle( Get (DesktopPath);2;1) = "m" ; "filemac:/" ; 

Middle( Get (DesktopPath);2;1) = "C" ; "filewin://DEEPTHOUGHT/" ) 

& "MondettaEnterprise/Groups/ERP/Documents/Programs/" 

& MondettaMail::MMB_ID_Program_Number & "/" 

& MondettaMail::MMB_ID_Program_Number & "_Mail_Attachments/" 

& Middle ( GetValue ( MondettaMail_Attachments::MMA_Attachment_Path ; 1 ) ; 6 ; 999 ) ] 

Export Field Contents [ MondettaMail_Attachments::MMA_Attachment; “$filepath” OR “filemac: 

/Groups/ERP/Documents/Programs/PGRM00031/PGRM00031_Mail_Attachments/PGRM00031_MM012539_Mail_Attach_1.jpg” ] 

Clear [ MondettaMail_Attachments::MMA_Attachment ] 

[ Select ] 

Go to Field [ MondettaMail_Attachments::MMA_Attachment ] 

Insert File [ MondettaMail_Attachments::MMA_Attachment; “$filepath” OR “filewin: 

//fsserver2/groups/ERP/Documents/Programs/PGRM00031/PGRM00031_Mail_Attachments/PGRM00031_MM002280_Mail_Attach_14.jpg” OR “filemac: 

/Groups/ERP/Documents/Programs/PGRM00031/PGRM00031_Mail_Attachments/PGRM00031_MM002384_Mail_Attach_5.” ] 

[ Reference ] 

Set Field [ MondettaMail::MMB_Attachment_Count; MondettaMail::MMB_Attachment_Count + 1 ] 





The send mail script......



070 Send Draft Message Converting it to Open 

Set Error Capture [ On ] 

Freeze Window 

Commit Records/Requests 

[ Skip data entry validation; No dialog ] 

Set Variable [ $new; Value:"New" ] 

#We set the status in the message to "Open" 

Set Field [ MondettaMail::MMB_Status; "Open" ] 

#We timestamp it so it's fresh on the send. 

Set Field [ MondettaMail::MMB_Date; Get ( CurrentTimeStamp ) ] 

#We set the status in the To/cc list of the creator of the message to "Sent" 

Go to Related Record [ From table: “MondettaMail_To_CC”; Using layout: “440 > Data: To cc” (MondettaMail_To_CC) ] 

[ Show only related records; New window ] 

Go to Layout [ “440 > Data: To cc” (MondettaMail_To_CC) ] 

Go to Record/Request/Page 

[ First ] 

//  Loop 

//  Go to Field [ MondettaMail_To_CC::ToCC_Status ] 

Replace Field Contents [ MondettaMail_To_CC::ToCC_Status; Replace with calculation: "New" ] 

[ No dialog ] 

//  Set Field [ MondettaMail_To_CC::ToCC_Status; $new ] 

//  Go to Record/Request/Page 

[ Next; Exit after last ] 

//  End Loop 

#Now we need to set the statuses of all the To/cc list to "New" so they can see the message. 

Set Field [ MondettaMail_Current_User::ToCC_Status; "Sent" ] 

Close Window [ Name: "temp"; Current file ] 

Close Window [ Current Window ] 

Go to Layout [ “210 > List: To cc: New” (MondettaMail_To_CC) ] 

Perform Script [ “00702 Refresh Window” from file: “Main” ] 

Posted

"Initially the "Insert File" statement contained "Reference" so we were holding only the file location and not the file itself, a wish from the higher ups who didn't want to clog the DB pictures etc. With "reference" in the statement FM would hang on download PDF. Without it it downloads. "

...that's why I assumed the PDF is not referenced, but embedded.

Can you post the Save as PDF script?

If anyone wants to chime in, feel free. I'm swamped this week.

BTW: I'm starting to think that this isn't really an email system. The last script doesn't have any Send (no evidence of a plugin either). Is this just setting an "email" record up to view in a dedicated "New Mail" list view?

Posted

Man totally forgot about this.

This issue happens not only with PDFs the user saves but also when the user faxes as a PDF to themselves and then drops it into the FM "email" system.

The following is just one part of our PDF create and save......


Print & PDF 6: Care Label (New School) 

#Get Multiple Script Parameters. 

If [  not IsEmpty ( Style_Main::Style_Care_Content_Label_Final ) ] 

Set Variable [ $ChineseOrnot; Value:GetValue ( Get ( ScriptParameter ) ; 1 ) ] 

Set Variable [ $PrintSingleOrMultiple; Value:GetValue ( Get ( ScriptParameter ) ; 2 ) ] 

Set Variable [ $printcount; Value:GetValue ( Get ( ScriptParameter ) ; 3 ) ] 

Go to Related Record [ From table: “Style_Main”; Using layout: “2050 Print 6: Care Content Label” (Style_Main) ] 

[ Show only related records; New window ] 

Print Setup [ Orientation: Landscape; Paper size: 8.26" x 11.69"; Scaling: 90% ] 

[ Restore; No dialog ] 

#Check for appending (single PDF or Multiple PDF's) 

If [ $PrintSingleOrMultiple = "Spec Pac" ] 

Set Variable [ $filename; Value:Style_Main::Style_ID_Style_Code & "(" & $printcount & "_SpecPac).pdf" ] 

Set Variable [ $pcdesktop; Value:Case ( 

Left ( Get ( DesktopPath ) ; 2 ) = "/C" ; 

"filewin:" &  Get ( DesktopPath ) & "Style PDFS/" & $filename & "¶" & 

"filewin:" &  Get ( DesktopPath ) & $filename ; 

Left ( Get ( DesktopPath ) ; 2 ) = "/U" ; 

 Get ( DesktopPath ) & "/" & "Style PDFS/" & $filename & "¶" & 

 Get ( DesktopPath ) & "/" & $filename ; 

Left ( Get ( DesktopPath ) ; 2 ) = "/M" ; 

 Get ( DesktopPath ) & "Style PDFS/" & $filename & "¶" & 

 Get ( DesktopPath ) & $filename ) ] 

Save Records as PDF [ File Name: “$pcdesktop”; Current record ] 

[ Document -  Compatibility: Acrobat 5 and later ] 

[ Pages -  Number Pages From: 1; Include: All pages ] 

[ Security -  Printing: High Resolution; Editing: Any except extracting pages; Enable copying; Enable Screen Reader ] 

[ Initial View -  Show: Pages Panel and Page; Page Layout: Single Page; Magnification: 100% ] 

[ Restore; Append; No dialog ] 

Else 

Set Variable [ $filename; Value:Style_Main::Style_ID_Style_Code & "(" & $printcount & "_Care_Label).pdf" ] 

Set Variable [ $pcdesktop; Value:Case ( 

Left ( Get ( DesktopPath ) ; 2 ) = "/C" ; 

"filewin:" &  Get ( DesktopPath ) & "Style PDFS/" & $filename & "¶" & 

"filewin:" &  Get ( DesktopPath ) & $filename ; 

Left ( Get ( DesktopPath ) ; 2 ) = "/U" ; 

 Get ( DesktopPath ) & "/" & "Style PDFS/" & $filename & "¶" & 

 Get ( DesktopPath ) & "/" & $filename ; 

Left ( Get ( DesktopPath ) ; 2 ) = "/M" ; 

 Get ( DesktopPath ) & "Style PDFS/" & $filename & "¶" & 

 Get ( DesktopPath ) & $filename ) ] 

Save Records as PDF [ File Name: “$pcdesktop”; Current record ] 

[ Document -  Compatibility: Acrobat 5 and later ] 

[ Pages -  Number Pages From: 1; Include: All pages ] 

[ Security -  Printing: High Resolution; Editing: Any except extracting pages; Enable copying; Enable Screen Reader ] 

[ Initial View -  Show: Pages Panel and Page; Page Layout: Single Page; Magnification: 100% ] 

[ Restore; No dialog ] 

End If 

Close Window [ Name: "PDF"; Current file ] 

End If 

Thanks

Michael

This topic is 5295 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.