Vinso,
On a related note, you can also rename the attachment name at the
database level. Below is a stored procedure in SQL Server format that
is called from workflow. I find it useful to rename the filename in two
circumstances: when the filename is originally generated from workflow
using a GUID, and to simply remove the full path.
This may have been fixed in later releases, but with the version of ARS
6.3 I was using 2 years ago when a file was attached from a folder that
was later removed, ARS would pop up an error message when attempting to
open the attachment.
I use GUIDs for filenames that are created on the server to prevent
other users or processes from overwriting each other. These temp files
are attached to an attachment field. Then the temp file is deleted from
the server, and finally the attachment is renamed by calling this SP.
Many of these processes send Excel reports to managers, and they would
like to see a filename such as 'Remedy Report - <report name>.xls'
instead of 'ID000423ABC104cK4KRgdR2REQ2x8A.xls'.
CREATE PROCEDURE [dbo].[usp_RenameAttachmentFieldFilename]
(
@FormName VARCHAR(60),
@FieldName VARCHAR(60),
@RequestID VARCHAR(15),
@NewName VARCHAR(250)
)
AS
SET NOCOUNT ON
IF @RequestID IS NULL OR RTRIM(ISNULL(@RequestID,'')) = '' OR
RTRIM(ISNULL(@NewName,'')) = ''
RETURN
DECLARE @TableName VARCHAR(15)
DECLARE @Command NVARCHAR(400)
SELECT @TableName = 'B' + CAST(a.SchemaID AS VARCHAR),
@FieldName = 'C' + CAST(b.FieldID AS VARCHAR)
FROM arschema a
JOIN [field] b
ON a.SchemaID = b.SchemaID
WHERE a.[name] = @FormName
AND b.FieldName = @FieldName
SET @Command = 'UPDATE ' + @TableName + ' SET ' + @FieldName + ' = ' +
'''' + @NewName + '''' + ' WHERE C1 = ' + '''' + @RequestID + ''''
EXEC sp_executesql @Command
HTH
Stephen
-----Original Message-----
From: Action Request System discussion list(ARSList)
[mailto:[EMAIL PROTECTED] On Behalf Of Vinson
Sent: Wednesday, April 04, 2007 7:00 AM
To: [email protected]
Subject: Re: how to get the file name of an attachment field
Michiel,
I create 3 filters as you suggested and use goto action. Now it works
like a charm...
Thanks for great help.
On Apr 4, 4:26 pm, Michiel Beijen <[EMAIL PROTECTED]>
wrote:
> Create a set fields action to a characterfield Use workflow which
> searches for the first \ character and use the right part of the
> string.
> Then re-start this workflow, either by using a filter guide or a goto
> action, until there is not a \ character left in the string.
> This is not as easy as you would like it to be, but it will work great
this way.
>
> --
> Met vriendelijke groet / Kind regards
> Michiel Beijen
> ______________________________________________________
> MANSOLUTIONS
> Energieweg 60-62
> 3771 NA Barneveld
> The Netherlands
> Tel. +31-(0)612968592
> Mail [EMAIL PROTECTED]
> Internethttp://bsm.mansolutions.nl
>
> On 4/4/07, Vinson <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I want to design a filter to notify my user when afileis upload to
> > anattachmentfield. I've try to use $attachmentfieldname$ in the
> > email to get thefilenamebut it is included with path that I want to
> > remove.
>
> > How can I get thefilenamewithout the path of theattachmentfield?
>
> > Thanks.
>
> > ____________________________________________________________________
> > _______-____ UNSUBSCRIBE or access ARSlist Archives
> > atwww.arslist.orgARSlist:"Where the Answers Are"
>
> ______________________________________________________________________
> _____-____ UNSUBSCRIBE or access ARSlist Archives
> atwww.arslist.orgARSlist:"Where the Answers Are"
________________________________________________________________________
_______
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where
the Answers Are"
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the
Answers Are"