Attachment should be accessable from any system

ranjityadavranjityadav Member Posts: 92
Dear All,

As you all aware of document Attachment,
My Client require if any guy is attaching the document in sales order that will be seen to all and anyone can open that attachment frm any system.

Pls help how can we do that.

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    You'll have to write code in the Insert-trigger of table "Record Link" to copy the attachment to a shared folder, and to change the Path.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • ranjityadavranjityadav Member Posts: 92
    THanx for ur reply.
    that all i know and done that but how to transfer the file from one location to other in navision.
    i can do that by using .bat file. any other option u hav can u plz share.
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Use FILE.COPY to copy your file from one location to another.

    From on-line help:
    COPY (File)
    Use this function to copy a file.

    [Ok :=] File.COPY(FromName, ToName)
    Ok

    Data type: boolean

    This optional return parameter tells you whether or not the file was copied.

    FromName

    Data type: text or code

    The name of the file you want to make a copy of, including its path. When you enter the path, keep in mind these shortcuts:

    You can...
    If the file is located...

    Omit the drive designation
    On the current drive

    Omit the full path
    In the current directory

    Enter only the subdirectory name
    In a subdirectory of the current directory


    ToName

    Data type: text or code

    The name you want to assign to the copy, including its path. See the shortcuts outlined above concerning how to enter the path.

    Comments
    If you do not use the return value, and the file cannot be copied (for any reason at all), a run-time error will occur. If you do include the return value in your code, you are supposed to handle any errors yourself.

    Examples
    To copy a file on your c: drive named oldfile to a file called newfile on drive a:, you would use the function as shown below:

    File.COPY('c:\data\oldfile','a:\newfile')

    If the system cannot copy the file, a run-time error will occur. You avoid this by using the return value like this:

    if File.COPY('c:\data\oldfile', 'a:\newfile') then

    ... // continue your program

    else

    ... // else handle the error
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • matttraxmatttrax Member Posts: 2,309
    Why do you need to copy it? If the user has access to the shared drive, and the file on the shared drive, they can save their own copy after they open it.
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    matttrax wrote:
    Why do you need to copy it? If the user has access to the shared drive, and the file on the shared drive, they can save their own copy after they open it.
    If the file is on the shared drive, and one is attaching this file in NAV, then there is no need to copy the file.
    If the file is on a local drive however, and one is attaching this file in NAV, then you need to copy this file to the shared drive, if you want to achieve that everyone can access it.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • ranjityadavranjityadav Member Posts: 92
    No No this copy file works only in one system.

    I want the file which is on local system should be copied from local system to Server.

    Why required this because the file is also safe in server and all documents are organised.
Sign In or Register to comment.