- [Instructor] If you want to harness
the full power of the Integration Manager module,
you need to understand Integration Scripts.
Let's take a look at an Integration
that I wrote to import vendors into Dynamics GP.
It's called "VendorImport."
I have a source file that I can right-click
on Vendor File, which is my source,
and preview it and you see, right there,
it's three vendors that I'm importing.
I'm going into the Vendor Card, is my destination,
and in my mapping, I'm simply mapping those fields.
So, it's going to import vendors from a text file.
Now, say that after I do this,
I want to have some other action happen,
such as that file being renamed,
or moved somewhere else and backed up,
maybe to an archive, or other things,
processing that has to happen on that file before it's run,
or logging into a different company
so that the vendors can be imported
into more than one company, and so forth.
Once it gets complicated, that's when you need Scripting.
So, let's look at where is that Scripting.
How do you get to that?
Well, you can click on your Integration
and select the Properties button,
and then there's a Scripts tab.
And you see that it's event-driven.
You can run the Script before the Integration begins,
or you can keep running the Script repeatedly
before every single document,
or you can run a Script when there's a warning
or an error on the document.
Well, what kind of Scripts can you run?
Let's look at a "Before Integration" Script.
We click on that and we click "Open,"
and, well, what do we type here?
This has its own syntax and it's not really that easy
to know what to do if you have no help.
And, you see, there is help.
Under the Script menu, there's a Script Library,
and if you click on that,
you'll see that they give you a lot of Scripts.
Double-click on General Purpose Scripts
and you can see there's a lot of sample code.
How do you delete the source file
after a successful Integration, for instance?
What to do on document errors,
and, if you click on these,
you see they're giving you some sample code here
so you can cut and paste that code into the Script
and be able to affect what happens
to your Integration before and after it runs.