web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

One Source For All Integrations with Integration Manager?

(0) ShareShare
ReportReport
Posted on by 127

I am setting up my first integration in Integration Manager; I am using a .csv file as the source. I am exporting the .csv file from another application every time I need the data. First .csv source file was named "Test123", which I set the Integration up with.

Now if I have new records to integrate into GP tomorrow and I export the .csv source file calling it "Test124"; am I able to save it to the same file destination as the original .csv source file ("Test123") and rename "Test124" to "Test123"? So that Integration Manager will use this new .csv source file for the integration, without me having to go back through and adding a new source file every time I run an integration.

The new .csv source file will have the same column names, data types, and mappings as the original .csv source file. 

*This post is locked for comments

I have the same question (0)
  • Tim W Profile Picture
    2,925 on at

    Yes, that's how it would work and what you would need to do., you don't need to re-map in this case.

    More advanced users might write some VB Script to do a pre-integration archive then rename of new file and process but what you do is how I do it.  As a check, I usually will right click on the source file in IM and choose preview just so I can get the visual that the data is formatted properly and what I expect.

  • MG-16101311-0 Profile Picture
    26,225 on at

    Integration Manager uses fix data source names and you cannot really change those once you've created your DSN and source queries - or you can, but sort of defeat the purpose, although I wished this was possible. Hence, as you already found out, you must rename the exports each time to match what your initial file name.

  • Suggested answer
    L Vail Profile Picture
    65,271 on at

    I would use VB Script in an After Query event to rename the source file using a date component. This script is available in the script library that comes with Integration Manager. The script looks like this (from the script library)

    Renaming a Source File that Uses Today's Date in its Name

    How do I add an After Query script?

    Copies a file and renames it, but does not delete it. The new file name includes a date component, which is convenient for keeping backups from multiple dates. You could add a time component to the file name as well.

    This script assumes that the file that you want to copy is one of your source files. As a result, the script needs to be an AFTER QUERY script. (The reasoning for using an After Query script instead of an After Integration script is the After Integration script runs before the After Query script. As a result, when the integration ends, the query is still in use. If you try to rename or delete a source file in the After Integration script, it will fail because the file is still in use.)

    In order to keep this script relatively simple, error handling is not included. For example, if the destination directory does not exist or is unavailable, then you will see a message that the script did not run correctly. You can build intelligent error handling into the script, but if you choose not to do so, then be sure to inform all users as to what the above message means.

    Please note that this script requires that the FileSystemObject component be installed. On many Windows computers, the FileSystemObject will already be present, because it is installed as a component of some Microsoft products. If the FileSystemObject component is not present, you will see the following error: "ActiveX component can't create object."

    To install the FileSystemObject:

    -        Find a machine that has the file called SCRUN.DLL in its system32 directory. Copy this file to your system32 directory and register it using the REGSVR32 command.

    -        Or, install the Windows Scripting Host, which can be downloaded from msdn.microsoft.com/scripting.

    In this example, the source file is called "Orders.txt" and is in the C:\Integrate directory. It is to be copied to a subdirectory called "Done", and the name should be appended with the date, in the format "yyyymmdd". Hence, if this script is run on September 7, 2000, the Orders.txt will be copied and renamed as "Orders20000907.txt".

    -----------------------------------------------------------------------------------------------------------------------------------

    'Set the Path & Filename of the Source file and the Destination

    'file. In this example, the destination file is named "Done 20000829",

    'where "20000829" represents the system date, in the following

    'format:  yyyymmdd.

     sSourceFile = "C:\Integrate\Orders.txt"

     sDestinationFile = "C:\Integrate\Done\Orders & Year(Date) & Right("0" & Month(Date), 2) & Right("0" & Day(Date), 2) & ".txt"

    'Create a File System Object

     Dim pFSO

     Set pFSO = CreateObject("Scripting.FileSystemObject")

    'Copy and rename the file

    'The "True" parameter indicates that if the file already exists

    'in the destination, then it will be overwritten

     Call pFSO.CopyFile(sSourceFile, sDestinationFile, True

  • Clayton Ayers Profile Picture
    127 on at

    Is there something called a Pre-Query or Pre-Integration Query that I could write in VB, that would take a file they downloaded in the windows explorer and use that as the file to be renamed? After this file would be renamed it then would be used by IM for the integration into GP.  

  • iruser2 Profile Picture
    2,048 on at

    Hi Clayton

    Some very smart heavy hitters in the GP world have replied to you so with respect to them;

    No one asked you what the other application is.

    If you can query it via and ODBC connection you can bypass the text file and integration manager can make both simple and advanced ODBC connections and read the data directly.

    presumably some sort of query within the application is making the text file. If you can connect to it you can likely have IM make the same query.

  • Suggested answer
    L Vail Profile Picture
    65,271 on at

    Good point!

    As far as a pre-Query script and pre-Integration script, the answer is yes. I found this chart in the GP 2013 IM user guide explaining the scripts in IM and the order in which they run. Note that the phases described are not scripts. I highly recommend downloading the user manual from https://www.microsoft.com/en-us/download/details.aspx?id=36069

    The Before Query script would be the Before Source script. For what you are speaking of, you want to rename your file before the sources are set.

    IM-script-table.png

    Kind regards

    Leslie

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans