Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Integration manager scripts 1

Status
Not open for further replies.

barbola

Technical User
Feb 27, 2003
1,132
CA
Does anyone know where I can find help with writing scripts for IM? Our VAR said to search for "scripts". Nice response from them!

I am at my wits end trying to figure this out on my own. I need help and can't find any anywhere.

I recently finished a 2 year VB course, so I understand how to write a script but I don't know how to do it in an integration manager query to get it to do what I need it to do.
 
Whatcha trying to do? Here is a site that will tell you about VB Script (which is REALLY what you want). I am in a similar boat here, but have made some things work the way want it to.

I am still trying to decifer someone's answer to a question I had about IM earlier in the week. Just 'write a script' is not quite what I wanted. PLUS when you are in the script editor there are SOME samples, but they do things I would not
 
Here are some 'easy' samples of things I have done

concat several fields for one output (put in script for destination mapping) - it is getting the 5 areas of our GL code togeather

Code:
CurrentField=SourceFields("VisaTechOOP.Account")&SourceFields("VisaTechOOP.Region")&SourceFields("VisaTechOOP.Employee")&SourceFields("VisaTechOOP.Customer")&SourceFields("VisaTechOOP.Project")

Pull one field instead of another (also in the destination mapping)

Code:
If IsNull(SourceFields("VisaTechOOP.TransactionDescription")) Then
	CurrentField=Left(SourceFields("VisaTechOOP.Vendor"),30)
Else
	CurrentField=Left(SourceFields("VisaTechOOP.TransactionDescription"),30)
End If

I wanted some text in with the abbreviation for the month for a batch ID (placed this in the 'before' script for the whole integration)

Code:
Dim strIMDateTime 'Declare the variable that will store the system date and time
Dim LastMonth
LastMonth=DateAdd("m", -1, Date)
SetVariable "Last Month", LastMonth
StrIMDateTime=Left(MonthName(DatePart("m",DateAdd("m", -1, Date))),3)+"-"+Right(cstr(DatePart("yyyy",DateAdd("m", -1, Date))),2)'CStr(Date)+"-"+Left(CStr(Time),5) 'Set the variable to the system date and time
SetVariable "Batch ID", Left("Visa OOP " + strIMDateTime,30) ' Place the variable value into a variable to read by IM

any of these short examples get you started???
 
The link will be useful, but I also need a better understanding of how IM reads the data, and what it does with it, in what order.

I was trying to add some values in different records and put the total in another record, and I think the for..each..next might work but not sure of the proper syntax for IM.

Example:
Invoice Amount Type Purchases
ABC 50.00 P 0
ABC 20.00 T 0
ABC 5.00 P 0
XYZ 20.00 P 0
XYZ 10.00 P 0

I would like it to add up Amount for each Invoice where Type = P or C and store the total in Purchases.

So ABC Purchases amount would be 55.00. The way my integration is working now, puts $75 in the Purchases and then adds the $20 tax again.

I have to return my vendor's call today, but hopefully they will not just write me the script but help me learn this.

thanks.

 
if you post the code today I can take a look at it and see if I can see anything
 
Well that's the thing. I don't have any code because I don't know where to start.
 
Okay, after 2 hrs on the phone with our VAR he finally figured out what I already knew. And, at the end of our conversation, he said "you might want to try this..."

and he pointed me to the "Before Document" script...which I never knew existed, and is EXACTLY what I was looking for....sort of.

So, I wrote the following script:

Code:
If SourceFields("PM-Detail.DistType") = "V" then
   sPurchase = sPurchase + SourceFields("PM-Detail-Amount")
End If

I am assuming this will add up the amounts for the document and save them in a variable called sPurchase. I haven't quite figured out how I-M stores variables though.

So now I want to put a field script in my payables Purchase Amount to be this value, but I don't know how to call it from the Before document script.

Something like CurrentField = sPurchase? but I know that won't work.

thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top