8/28/2025 3:27:10 PM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
|
|
|
|
Drag and drop emails with attachments
Posted: 02 Apr 09 3:12 PM
|
Hi, Is there a way to "disable" the popup confirmation window that always asks if the user would like to import the attachments, and just automatically bring in the attachments?
We are using 7.01
Thanks for any suggestions or hints - I have searched through all my plugins I think, and can't find this popup anywhere... |
|
|
|
Re: Drag and drop emails with attachments
Posted: 03 Apr 09 12:36 PM
|
if you want to do it automatically, here is how I do it:
'there is no way to bypass the user interaction when calling this function 'strAttachID = Application.BasicFunctions.InsertFileAttachmentEx(strFileName, strFileName) & "" 'to silent save the attachment: '1) I get/set the {AccountID}, {ContactID}, and {SLXUserID} that I need. '2) I make a call to slx_dbids("FILEATTACH") to get the new ATTACHMENTS table {KEY}. '3) I export or copy the file to \\{server}\{attachments share}\ with the name ! and {KEY} and {filename} '4) I insert to the ATTACHMENTS table (ATTACHID, ATTACHDATE, ACCOUNTID, CONTACTID, DESCRIPTION, DATATYPE, FILESIZE, FILENAME, USERID) the values ({KEY}, Now, {AccountID}, {ContactID}, {the name I want the file to show in the ATTACHMENTS grid}, "R" (don't ask me why), io.Filestream(filename, io.filemode.open).length, {full server filepath and filename in attachments directory}, {SLXUserID})
dim strUserID dim strAttachmentFileName
strUserID = Application.BasicFunctions.CurrentUserID strAttachID = Application.BasicFunctions.GetIDFor("Attachment") strAttachmentFileName = "!" & strAttachID & strFileDesc 'input param
Set fs = CreateObject("Scripting.FileSystemObject") fs.CopyFile strFileName, Application.BasicFunctions.GetAttachmentPath & strAttachmentFileName set f = fs.GetFile(strFileName) intFileLen = f.Size
'insert into attachment table set objRS = CreateObject("ADODB.Recordset") set objRS.ActiveConnection = Application.GetNewConnection
with objRS .CursorType = adOpenStatic .CursorLocation = adUseClient .LockType = adLockBatchOptimistic .Open = "SELECT * FROM ATTACHMENT WHERE 1 = 2" .AddNew
.Fields("AttachID").Value = strAttachID .Fields("AttachDate").Value = now() .Fields("Description").Value = Left(strFileDesc, len(strFileDesc) - 4) .Fields("DataType").Value = "R" .Fields("FileSize").Value = intFileLen .Fields("FileName").Value = strAttachmentFileName .Fields("UserID").Value = strUserID .Fields("ESI_EquipmentID").Value = strEquipmentID
.UpdateBatch end with
'cleanup ... |
|
|
|
Re: Drag and drop emails with attachments
Posted: 03 Apr 09 2:07 PM
|
I am so sorry, I just re-read my original post and I left out a critical piece of information, I think. This is when a user is performing an email drag and drop of an email into the system (notes/history tab).
With the above code, perhaps I am not reading it correctly, but does this apply to that situation? If so, where would I even put that code? |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|