Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, July 6, 2025 
 
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!
 Architect Forums - SalesLogix Scripting & Customization
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.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Insert File Attachment
Amer
Posts: 10
 
Insert File AttachmentYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Aug 08 11:18 AM
I need to invoke the Insert:File Attachment funciton. The same one shown in the insert menu.

The difference is that I need to invoke it from a button instead of the menu?

Seems simple but I haven't been able to figure it out? Any clues?

Basically, here is my goal:

1) Insert file into attachment tab from another form using a button
2) Once its inserted, show on the same form that the file is attached using a flag like "Attached". If its not attached, do not show the word "Attached"

Can someone give me the steps as how this can be achieved please?

Thanks
[Reply][Quote]
Steve Robertson
Posts: 146
 
Re: Insert File AttachmentYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Aug 08 12:05 PM
Hi Amer,

The following will launch the insert file attachment function:

Application.BasicFunctions.DoInvoke "Function", "Insert:FileAttachment"

Once the file is attached it will be visible under the Attachment tab.

I think this form is hard coded so you cannot access it to add/change your flag - unless you code for this yourself which would mean a new form, menu etc...

Cheers,

Steve

[Reply][Quote]
Stefan Held
Posts: 18
 
Re: Insert File AttachmentYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Aug 08 1:21 AM
Hi Amer,
I've had a similar problem, I needed some extra information about my attachments (like Categories, Original Path etc..)
So I've created an ATTACHMENT_EXT table that stores the information and a new attachment form where the information is shown.

To create a new attachment, I simply create a new entry in the ATTACHMENT and ATTACHMENT_EXT table, then combine the attachID and original filename to create the SLX internal filename, finally copy the file with the new name to the SLX documents folder.
This way, you can even store your files in a subfolder of the documents folder, you just have to include the subfolder name and backslash in the FILENAME field of the ATTACHMENT row in the database. After copying the file, you can check if the file is actually there (using the standard Windows Scripting methods) and set your flag.

Just let me know if you need more info on this...

Stefan
[Reply][Quote]
Amer
Posts: 10
 
Re: Insert File AttachmentYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 27 Aug 08 7:56 AM
Thanks for you responses.

Steve, your code worked perfectly. Much appreciated.

As for the flag situation, I decided to go with a data grid that gives the last updated date of the file. I modified the sql within the grid to relay this info.

Thanks.
[Reply][Quote]
Lucien
Posts: 20
 
Re: Insert File AttachmentYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Feb 09 2:43 AM
Hi

I've also tried that code on a button but i get the following message box:
Unable to add an attachment to this entity because the KeyFieldName APPLICATIONID
does not exist in the Attachment table.
[Reply][Quote]
Stainless Steel Snake
Posts: 32
 
Re: Insert File AttachmentYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Feb 09 7:58 AM
If you wanna add an attachment for custom entity (in your case it is Application), then you should add custom field to ATTACHMENT table. This field must have same name as key field name of your entity (in your case it is APPLICATIONID). Do this with SLX Database Manager.
[Reply][Quote]
Lucien
Posts: 20
 
Re: Insert File AttachmentYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Feb 09 2:01 AM
cool, it works... so whenever i try attaching a file, i should make sure that the keyfield that its looking, exists in the attachment table?
[Reply][Quote]
Stainless Steel Snake
Posts: 32
 
Re: Insert File AttachmentYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Feb 09 2:41 PM
Yes
[Reply][Quote]
Georgiy.Celovansky
Posts: 13
 
Re: Insert File AttachmentYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 26 Nov 10 2:42 AM

I've tried to add own keyfield to attachment table, but in DB manager it's forbidden(add field button inactive for this table).


 


Is it some way to get attachmentid after file had been saved to DB with Application.BasicFunctions.DoInvoke "Function", "Insert:FileAttachment" ?

[Reply][Quote]
 Page 1 of 1 
  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!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 7/6/2025 4:05:07 AM