Update Vantage Using AuotIT - Business Objects

Hi Mark,



The engineers create the SolidWorks drawings and the estimators create
the jobs. Thank you for the link. I will take a look at that and see
if I can make any sense of it.



Linda



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Mark Wonsil
Sent: Wednesday, March 04, 2009 10:45 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Update Vantage Using AuotIT - Business Objects



Hi Linda,

> Thank you, but I'm not comfortable enough with vb.net customization to
> do that. There is no documentation and the Tools book is very basic.

There's a lot of help here on the list!

BTW, who actually loads your MOMs? Is it the designers or does someone
in
production use the export from your CAD system?

Mark W.





[Non-text portions of this message have been removed]
Hi Group,

Is anyone using AutoIT to automate data entry in Vantage and would be
willing to share a sample script to get me started?

Regards,
Linda
I sent Linda a script off list. If anyone else wants it, let me know.

Thom Rose
Controller
Electric Mirror LLC
HOTEL LUXURY

"The World Leader in Back-lit Mirrors & Mirror TV Technology"

T 425 776-4946
F 425 491-8200
A 11831 Beverly Park Rd, Bldg D, Everett, WA 98204 USA
www.electricmirror.com<http://www.electricmirror.com>


From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of lindalowney
Sent: Monday, March 02, 2009 10:19 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Update Vantage Using AuotIT


Hi Group,

Is anyone using AutoIT to automate data entry in Vantage and would be
willing to share a sample script to get me started?

Regards,
Linda



[Non-text portions of this message have been removed]
I would be very cautious about using GUI automation tools to "script"
UI actions in Vantage. I just spent two weeks unwinding a problem I
created for myself doing this exact thing.



Here's what happened.



We're using MultiCompany for centralized payables. We define our
vendors (and customers, but that's another story) in our CORP company,
mark them as Global and for Central Payment, and link them to the child
companies where they are used. When creating vendors on the fly as
you're going this works just fine, but if you're importing a bunch of
vendors via Service Connect, how do you get all of those new vendors
linked into the company where you actually want to use them? The
Epicor-provided workflows do not provide for this, nor does the
"Initialize MultiCompany Customer/Supplier/Part" routine do this (it
just initializes the GlobalVendor tables for any missing GlobalVendor
records, say if you've added a new external company and you need to
create a bunch of GlobalVendor records for your existing suppliers.



So I used Workspace Macro Pro
<http://www.tethyssolutions.com/macro-automation.htm> to automate two
sets of tasks: first, the marking of the imported vendors in CORP as
Global and to set the CPay flag, and then after MultiCompany created all
of the Global Vendor records, to link those Vendors into the target
company. We used this technique last summer when we went live with the
first half of our business without problems. However we discovered that
we created some problems for ourselves in our second phase of
implementation right before we went live.



The issue turned out to be that the GlobalVendor records that
Vantage/MultiCompany created had mismatched VendorIDs. The records were
properly linked (ABC Metals in CORP was really linked to ABC Metals in
the child company), but their IDs didn't match (however the ID was of
another vendor we also loaded). This led to further corruption as we
loaded Parts with PartPlant records pointing at those vendors with the
wrong IDs.



Getting Epicor support marshaled around this was challenging, both
because of the urgency of the issue for us and the bad timing, and the
fact that we used an "unsupported third-party tool". Even though we
were just looping through the mouse-clicks necessary to perform some
basic actions in the UI, this created uncertainty around our "support
status". There was also some confusion with support on the actual
behavior of MultiCompany in this respect (there's no reason the IDs
*have* to match, that's just your business requirement, etc.) I'm not
criticizing Epicor too heavily here - they did devote resources to
helping us solve the problem, and the fix program they supplied was
critical in getting us back up and running. It just wasn't a pleasant
experience.



Ultimately I was able to resolve the problem myself by removing the
PartPlant.VendorNum references in the child company, deleting the linked
vendors, un-Globaling and re-Globaling the vendors in the CORP company,
and letting MultiCompany recreate the GlobalVendor records. After
several hours of manually cleaning up the mess we're back where we
should have been two weeks ago.



Obviously another lesson learned here is that we should have had a
better process on our end to validate that the loaded data was correct.




My belief is that the problem is due to a race condition or similar
problem where it is possible to submit transactions faster than
MultiCompany/Sonic and/or the Vantage triggers can process them. The
issue wasn't in the linking, it was in the creation of the GlobalVendor
records in the first place. In my first round of implementation I used
ServiceConnect to mark the Vendors as Global and CPay, and the second
round I used the Workspace Macro Pro program. The reason I did this was
because I wasn't able to write a ServiceConnect workflow to handle the
linking (ran out of time and didn't need to do this again so why invest
the time), so I figured I would just "macro the whole thing".



Workspace MacroPro has an option called "SMART Macro High-Speed
Replay" which I think may have been the culprit.



I would just urge caution since if you create problems for yourself
you'll add an extra layer of potential uncertainty with Epicor support
if you mentioned you use a "third part tool" (even if that tool is just
exercising the Vantage client UI).



-bws



--

Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix /
Picometrix

bspolarich@... ~ 734-864-5618 ~
www.advancedphotonix.com



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of lindalowney
Sent: Monday, March 02, 2009 1:19 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Update Vantage Using AuotIT



Hi Group,

Is anyone using AutoIT to automate data entry in Vantage and would be
willing to share a sample script to get me started?

Regards,
Linda

.


<http://geo.yahoo.com/serv?s=97359714/grpId=20369/grpspId=1705007181/msg
Id=74893/stime=1236017925/nc1=3848584/nc2=4836040/nc3=5349276>





[Non-text portions of this message have been removed]
If you need to read data from the Vantage database for your automation,
Microsoft Access is also a solution. Below is a script for modifying
part classes we just wrote and are testing for Vantage 6.1. Recommend
testing your routine thoroughly in one of your test databases on the
machine you will use to update the live database (timing is extremely
critical). I also do these at night when nobody is logged in to ensure
I don't have a problem with locked records.





Public Function ChangePartClass()



Dim db As Database

Dim rs As Recordset



Set db = CurrentDb()

Set rs = db.OpenRecordset("qryAutomation")



'Ensure Part File Maintenance is open to display all parts

'Ensure the cursor is in the Part Number search field and it is
blank



AppActivate "Part File Maintenance", False

Wait 2 'Manually click your mouse in the Part Number search field
on the form to ensure it has the focus



While Not rs.EOF

SendKeys "{Delete}", True 'Delete anything highlighted in the
part number field

Wait 0.25 'Insert some waits because system is
too fast for the database

SendKeys rs!PartNum, True 'Insert the part number

Wait 0.25

SendKeys "{Enter}", True 'Execute the search

Wait 0.25

SendKeys "{Tab}", True 'Move the focus to the search
results

Wait 0.25

SendKeys "{Tab}", True

Wait 0.25

SendKeys "{Enter}", True 'Launch the Part Master form

Wait 0.25

SendKeys "{Tab}", True 'Move to the Part Class field

Wait 0.25

SendKeys "{Tab}", True

Wait 0.25

SendKeys "{Tab}", True

Wait 0.25

SendKeys "{Tab}", True

Wait 0.25

SendKeys "{Delete}", True 'Delete what's there

Wait 0.25

SendKeys rs!Description, True 'Insert the new part class
description

Wait 0.25

SendKeys "{F2}", True 'Save and close the form

Wait 1

rs.MoveNext

Wend



End Function



Sub Wait(PauseTime)



'slows down the sendkeys because it is too fast for Vantage



Dim Start



Start = Timer ' Set start time.



Do While Timer < Start + PauseTime

DoEvents ' Yield to other processes.

Loop



End Sub







________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of lindalowney
Sent: Monday, March 02, 2009 10:19 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Update Vantage Using AuotIT



Hi Group,

Is anyone using AutoIT to automate data entry in Vantage and would be
willing to share a sample script to get me started?

Regards,
Linda





[Non-text portions of this message have been removed]
Thank you.



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Butch Menge
Sent: Monday, March 02, 2009 2:31 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Update Vantage Using AuotIT



If you need to read data from the Vantage database for your automation,
Microsoft Access is also a solution. Below is a script for modifying
part classes we just wrote and are testing for Vantage 6.1. Recommend
testing your routine thoroughly in one of your test databases on the
machine you will use to update the live database (timing is extremely
critical). I also do these at night when nobody is logged in to ensure
I don't have a problem with locked records.

Public Function ChangePartClass()

Dim db As Database

Dim rs As Recordset

Set db = CurrentDb()

Set rs = db.OpenRecordset("qryAutomation")

'Ensure Part File Maintenance is open to display all parts

'Ensure the cursor is in the Part Number search field and it is
blank

AppActivate "Part File Maintenance", False

Wait 2 'Manually click your mouse in the Part Number search field
on the form to ensure it has the focus

While Not rs.EOF

SendKeys "{Delete}", True 'Delete anything highlighted in the
part number field

Wait 0.25 'Insert some waits because system is
too fast for the database

SendKeys rs!PartNum, True 'Insert the part number

Wait 0.25

SendKeys "{Enter}", True 'Execute the search

Wait 0.25

SendKeys "{Tab}", True 'Move the focus to the search
results

Wait 0.25

SendKeys "{Tab}", True

Wait 0.25

SendKeys "{Enter}", True 'Launch the Part Master form

Wait 0.25

SendKeys "{Tab}", True 'Move to the Part Class field

Wait 0.25

SendKeys "{Tab}", True

Wait 0.25

SendKeys "{Tab}", True

Wait 0.25

SendKeys "{Tab}", True

Wait 0.25

SendKeys "{Delete}", True 'Delete what's there

Wait 0.25

SendKeys rs!Description, True 'Insert the new part class
description

Wait 0.25

SendKeys "{F2}", True 'Save and close the form

Wait 1

rs.MoveNext

Wend

End Function

Sub Wait(PauseTime)

'slows down the sendkeys because it is too fast for Vantage

Dim Start

Start = Timer ' Set start time.

Do While Timer < Start + PauseTime

DoEvents ' Yield to other processes.

Loop

End Sub

________________________________

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of lindalowney
Sent: Monday, March 02, 2009 10:19 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Update Vantage Using AuotIT

Hi Group,

Is anyone using AutoIT to automate data entry in Vantage and would be
willing to share a sample script to get me started?

Regards,
Linda

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]
My first attempt at automation was a disaster. We used Macro Scheduler to
try to load part numbers. We encountered the same issue as Brian, any
"sendkeys" kind of solution is not smart enough to wait until input is
required and eventually the datastream gets out of sequence with what you're
trying to do. If you want to script, use the Business Objects directly. They
enforce all Vantage/Epicor business-logic and don't get tripped up on timing
issues.

Mark W.
I got excited, Mark, when I first read your suggestion a couple of weeks ago to use the Business Objects directly. However, things did not work out as well as I had hoped.

I started a VB project (VB 2008 Express Edition), and set references to a couple of Business Objects dll's (Epicor.Mfg.AD.APInvoice.dll and Epicor.Mfg.AD.APInvGrp.dll). I had expected to be able to go into the object browser and see a little more about what I was getting. The object browser for those items is blank, though. Nothing is being exposed. Can you suggest a good place to get started, perhaps some different Business Objects to look at to get a better idea about how to work with these things?

Thom Rose
Controller
Electric Mirror LLC
HOTEL LUXURY

"The World Leader in Back-lit Mirrors & Mirror TV Technology"

T 425 776-4946
F 425 491-8200
A 11831 Beverly Park Rd, Bldg D, Everett, WA 98204 USA
www.electricmirror.com<http://www.electricmirror.com>

Note: The information contained in the e-mail, including any attachments, is legally privileged and confidential. If you are not the intended recipient you are hereby notified that any reading, use or dissemination of this message is strictly prohibited. If you have received this message in error, please immediately notify us by telephone at 425-776-4946 and delete this message from your system. Even though this e-mail and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free, and no responsibility is accepted by Electric Mirror LLC for any loss or damage arising in any way from its use


From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Mark Wonsil
Sent: Tuesday, March 03, 2009 5:04 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Update Vantage Using AuotIT


My first attempt at automation was a disaster. We used Macro Scheduler to
try to load part numbers. We encountered the same issue as Brian, any
"sendkeys" kind of solution is not smart enough to wait until input is
required and eventually the datastream gets out of sequence with what you're
trying to do. If you want to script, use the Business Objects directly. They
enforce all Vantage/Epicor business-logic and don't get tripped up on timing
issues.

Mark W.



[Non-text portions of this message have been removed]
Hi Thom,

> I started a VB project (VB 2008 Express Edition), and set references to a
> couple of Business Objects dll's (Epicor.Mfg.AD.APInvoice.dll and
> Epicor.Mfg.AD.APInvGrp.dll). I had expected to be able to go into the
> object browser and see a little more about what I was getting. The object
> browser for those items is blank, though. Nothing is being exposed. Can
> you suggest a good place to get started, perhaps some different Business
> Objects to look at to get a better idea about how to work with these
> things?

It's the same process as working with Service Connect, except that you
eliminate the all of the overhead of the web services.

First, you turn on tracing and watch what objects are called and what
parameters are getting passed around. Next, you mimic the calls in your
program adding your own error logic.

How about a real world problem that we could try for an example?

Mark W.
Okay, here is one that would be big for me. Our commission structure does not fit into the Vantage/Vista structure. I have an external program that figures out what the commissions are and we then key enter the commissions payable into our accounts payable system. I would like to be able to automatically load the commissions invoices into accounts payable.

Thom Rose
Controller
Electric Mirror LLC
HOTEL LUXURY

"The World Leader in Back-lit Mirrors & Mirror TV Technology"

T 425 776-4946
F 425 491-8200
A 11831 Beverly Park Rd, Bldg D, Everett, WA 98204 USA
www.electricmirror.com<http://www.electricmirror.com>

Note: The information contained in the e-mail, including any attachments, is legally privileged and confidential. If you are not the intended recipient you are hereby notified that any reading, use or dissemination of this message is strictly prohibited. If you have received this message in error, please immediately notify us by telephone at 425-776-4946 and delete this message from your system. Even though this e-mail and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free, and no responsibility is accepted by Electric Mirror LLC for any loss or damage arising in any way from its use


From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Mark Wonsil
Sent: Tuesday, March 03, 2009 6:27 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Update Vantage Using AuotIT - Business Objects


Hi Thom,

> I started a VB project (VB 2008 Express Edition), and set references to a
> couple of Business Objects dll's (Epicor.Mfg.AD.APInvoice.dll and
> Epicor.Mfg.AD.APInvGrp.dll). I had expected to be able to go into the
> object browser and see a little more about what I was getting. The object
> browser for those items is blank, though. Nothing is being exposed. Can
> you suggest a good place to get started, perhaps some different Business
> Objects to look at to get a better idea about how to work with these
> things?

It's the same process as working with Service Connect, except that you
eliminate the all of the overhead of the web services.

First, you turn on tracing and watch what objects are called and what
parameters are getting passed around. Next, you mimic the calls in your
program adding your own error logic.

How about a real world problem that we could try for an example?

Mark W.



[Non-text portions of this message have been removed]
Hi Mark,



What I am trying to do is open a job, move to the operations screen and
import operations from Excel, then move to the materials screen and
import the materials from Excel. We have an Excel spreadsheet that gets
the operations and materials from Solidworks.



Regards,

Linda



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Mark Wonsil
Sent: Tuesday, March 03, 2009 9:27 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Update Vantage Using AuotIT - Business Objects



Hi Thom,

> I started a VB project (VB 2008 Express Edition), and set references
to a
> couple of Business Objects dll's (Epicor.Mfg.AD.APInvoice.dll and
> Epicor.Mfg.AD.APInvGrp.dll). I had expected to be able to go into the
> object browser and see a little more about what I was getting. The
object
> browser for those items is blank, though. Nothing is being exposed.
Can
> you suggest a good place to get started, perhaps some different
Business
> Objects to look at to get a better idea about how to work with these
> things?

It's the same process as working with Service Connect, except that you
eliminate the all of the overhead of the web services.

First, you turn on tracing and watch what objects are called and what
parameters are getting passed around. Next, you mimic the calls in your
program adding your own error logic.

How about a real world problem that we could try for an example?

Mark W.





[Non-text portions of this message have been removed]
Hi Linda,

> What I am trying to do is open a job, move to the operations screen and
> import operations from Excel, then move to the materials screen and
> import the materials from Excel. We have an Excel spreadsheet that gets
> the operations and materials from Solidworks.

In your case, I would be inclined to do this as a customization and pull the
operations and materials from the spreadsheet from the Job Entry screen. You
can manipulate the DataView to add your logic. OTOH, if the engineers are
the ones who open jobs and release them to the floor then follow the outline
I sent in the previous post to Thom.

Mark W.
Hi Thom,

> Okay, here is one that would be big for me. Our commission structure does
> not fit into the Vantage/Vista structure. I have an external program that
> figures out what the commissions are and we then key enter the commissions
> payable into our accounts payable system. I would like to be able to
> automatically load the commissions invoices into accounts payable.

I'll leave the commission calculation to you but I started the trace
(Options | Tracing Options and enable Write Full Datasets and Write
Changes).

This seems to be the BO methods called for a single misc invoice with one
line:

Check to see if group exists:
APInvGrp.GetByID(cGroupID)

If not:
APInvGrp.GetNewAPInvGrp(dsAPInvGrpDataSet)

Save the group:
APInvGrp.Update(dsAPInvGrpDataSet)

Start a new Invoice Header:
APInvoice.GetNewAPInvHedInvoice(dsAPInvoiceDataSet, cGroupID)

Set the vendor ID:
APInvoice.ChangeVendorID(proposedVendorID, dsAPInvoiceDataSet)

Set the Invoice Date:
APInvoice.ChangeInvoiceDate(proposedInvoiceDate, dsAPInvoiceDataSet)

Set the Invoice Header Amount:
APInvoice.ChangeInvoiceVendorAmt(proposedInvoiceVendorAmt,
dsAPInvoiceDataSet)

Set the Terms Code:
APInvoice.ChangeTermsCode(proposedTermsCode, dsAPInvoiceDataSet)

Update:
APInvoice.PreUpdate(dsAPInvoiceDataSet, requiresUserInput)
APInvoice.CheckCPayBeforeUpdate(dsAPInvoiceDataSet, opMessage) <- Check
opMessage for errors!)
APInvoice.Update(dsAPInvoiceDataSet)

Get a Misc Invoice Misc PO Set:
dsAPInvPOMiscDataSet = APInvoice.GetAPInvPOMisc(inVendorNum, inInvoiceNum)

Refresh the Group:
dsAPInvGrpDataSet = APInvGrp.GetByID(cGroupID)

Get a new Misc Invoice Line:
APInvoice.GetNewAPInvDtlMiscellaneous(dsAPInvoiceDataSet, iVendorNum,
cInvoiceNum)

Set the part number:
APInvoice.ChangePartNum(proposedPartNum, dsAPInvoiceDataSet)

Set the Qty:
APInvoice.ChangeVendorQty(proposedVendorQty, dsAPInvoiceDataSet)

Set the Unit Cost
APInvoice.ChangeUnitCost(proposedUnitCost, dsAPInvoiceDataSet)

Update:
APInvoice.PreUpdate(dsAPInvoiceDataSet, requiresUserInput)
APInvoice.CheckCPayBeforeUpdate(dsAPInvoiceDataSet, opMessage) <- Check
opMessage for errors!)
APInvoice.CheckRevChrgBeforeUpdate(dsAPInvoiceDataSet, opMessage)
APInvoice.Update(dsAPInvoiceDataSet)

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

OK, that's a lot of steps (and I'm not sure about the getAPInvPOMisc
section) for a single invoice with a single line but you should be able to
see how to add more invoices/lines.

Now, to set up your project, you'll need to add your references:

Epicor.Mfg.Core.Session
Epicor.Mfg.Core.BLConnectionPool
Epicor.Mfg.AD.xxx
Epicor.Mfg.BO.xxx
Epicor.Mfg.IF.Ixxx

Where xxx is for each business object that you're using, like Part, etc.

The next step is to create a connection to the appServer in the beginning of
your program:

Dim objSess as Epicor.Mfg.Core.Session

objSess = New Epicor.Mfg.Core.Session("manager", "manager",
"AppServerDC://Vantage:8321", Epicor.Mfg.Core.Session.LicenseType.Default)

Note that this uses one of your full licenses. I haven't tried any of the
other license types. Change your username, password, and AppServer URL as
needed.

Once you have the session object, you can create other objects from it.

// The business object
APInvoice = new Epicor.Mfg.BO.APInvoice(objSess.ConnectionPool)

// The datasets
dsAPInvoiceDataSet = new Epicor.Mfg.BO.APInvoiveDataSet

You should always wrap your calls in a try - catch block to check for errors
but some objects also return messages in parameters (like the opMessage in
the preUpdate* methods shown above), so make sure to check that variable
too.

Going back to the trace, look at the dataset changes to see which fields get
updated before each call. I use the Item property to set the field names:

dsAPInvoiceDataSet.APInvGrp.Item(itm).Company = 'VN10T'
dsAPInvoiceDataSet.APInvGrp.Item(itm).GroupID = 'Paygroup'
....

where itm is the record number - starting with zero.

Now you have all of the basics, you need to just wrap your logic into it. In
your case, I would just create the pay-group and use the Edit List to check
your work and manually post it once you know it's good. Maybe you want to
create just one invoice per Order and one line for each sales order line
with the commission calculation there for all to see.

Mark W
Wow! Thanks. This is going to take me some time to work through, but you have given me a huge leg up on getting where I need to be. You are the master!

Thom Rose
Controller
Electric Mirror LLC
HOTEL LUXURY

"The World Leader in Back-lit Mirrors & Mirror TV Technology"

T 425 776-4946
F 425 491-8200
A 11831 Beverly Park Rd, Bldg D, Everett, WA 98204 USA
www.electricmirror.com<http://www.electricmirror.com>

Note: The information contained in the e-mail, including any attachments, is legally privileged and confidential. If you are not the intended recipient you are hereby notified that any reading, use or dissemination of this message is strictly prohibited. If you have received this message in error, please immediately notify us by telephone at 425-776-4946 and delete this message from your system. Even though this e-mail and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free, and no responsibility is accepted by Electric Mirror LLC for any loss or damage arising in any way from its use


From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Mark Wonsil
Sent: Tuesday, March 03, 2009 8:31 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Update Vantage Using AuotIT - Business Objects


Hi Thom,

> Okay, here is one that would be big for me. Our commission structure does
> not fit into the Vantage/Vista structure. I have an external program that
> figures out what the commissions are and we then key enter the commissions
> payable into our accounts payable system. I would like to be able to
> automatically load the commissions invoices into accounts payable.

I'll leave the commission calculation to you but I started the trace
(Options | Tracing Options and enable Write Full Datasets and Write
Changes).

This seems to be the BO methods called for a single misc invoice with one
line:

Check to see if group exists:
APInvGrp.GetByID(cGroupID)

If not:
APInvGrp.GetNewAPInvGrp(dsAPInvGrpDataSet)

Save the group:
APInvGrp.Update(dsAPInvGrpDataSet)

Start a new Invoice Header:
APInvoice.GetNewAPInvHedInvoice(dsAPInvoiceDataSet, cGroupID)

Set the vendor ID:
APInvoice.ChangeVendorID(proposedVendorID, dsAPInvoiceDataSet)

Set the Invoice Date:
APInvoice.ChangeInvoiceDate(proposedInvoiceDate, dsAPInvoiceDataSet)

Set the Invoice Header Amount:
APInvoice.ChangeInvoiceVendorAmt(proposedInvoiceVendorAmt,
dsAPInvoiceDataSet)

Set the Terms Code:
APInvoice.ChangeTermsCode(proposedTermsCode, dsAPInvoiceDataSet)

Update:
APInvoice.PreUpdate(dsAPInvoiceDataSet, requiresUserInput)
APInvoice.CheckCPayBeforeUpdate(dsAPInvoiceDataSet, opMessage) <- Check
opMessage for errors!)
APInvoice.Update(dsAPInvoiceDataSet)

Get a Misc Invoice Misc PO Set:
dsAPInvPOMiscDataSet = APInvoice.GetAPInvPOMisc(inVendorNum, inInvoiceNum)

Refresh the Group:
dsAPInvGrpDataSet = APInvGrp.GetByID(cGroupID)

Get a new Misc Invoice Line:
APInvoice.GetNewAPInvDtlMiscellaneous(dsAPInvoiceDataSet, iVendorNum,
cInvoiceNum)

Set the part number:
APInvoice.ChangePartNum(proposedPartNum, dsAPInvoiceDataSet)

Set the Qty:
APInvoice.ChangeVendorQty(proposedVendorQty, dsAPInvoiceDataSet)

Set the Unit Cost
APInvoice.ChangeUnitCost(proposedUnitCost, dsAPInvoiceDataSet)

Update:
APInvoice.PreUpdate(dsAPInvoiceDataSet, requiresUserInput)
APInvoice.CheckCPayBeforeUpdate(dsAPInvoiceDataSet, opMessage) <- Check
opMessage for errors!)
APInvoice.CheckRevChrgBeforeUpdate(dsAPInvoiceDataSet, opMessage)
APInvoice.Update(dsAPInvoiceDataSet)

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

OK, that's a lot of steps (and I'm not sure about the getAPInvPOMisc
section) for a single invoice with a single line but you should be able to
see how to add more invoices/lines.

Now, to set up your project, you'll need to add your references:

Epicor.Mfg.Core.Session
Epicor.Mfg.Core.BLConnectionPool
Epicor.Mfg.AD.xxx
Epicor.Mfg.BO.xxx
Epicor.Mfg.IF.Ixxx

Where xxx is for each business object that you're using, like Part, etc.

The next step is to create a connection to the appServer in the beginning of
your program:

Dim objSess as Epicor.Mfg.Core.Session

objSess = New Epicor.Mfg.Core.Session("manager", "manager",
"AppServerDC://Vantage:8321", Epicor.Mfg.Core.Session.LicenseType.Default)

Note that this uses one of your full licenses. I haven't tried any of the
other license types. Change your username, password, and AppServer URL as
needed.

Once you have the session object, you can create other objects from it.

// The business object
APInvoice = new Epicor.Mfg.BO.APInvoice(objSess.ConnectionPool)

// The datasets
dsAPInvoiceDataSet = new Epicor.Mfg.BO.APInvoiveDataSet

You should always wrap your calls in a try - catch block to check for errors
but some objects also return messages in parameters (like the opMessage in
the preUpdate* methods shown above), so make sure to check that variable
too.

Going back to the trace, look at the dataset changes to see which fields get
updated before each call. I use the Item property to set the field names:

dsAPInvoiceDataSet.APInvGrp.Item(itm).Company = 'VN10T'
dsAPInvoiceDataSet.APInvGrp.Item(itm).GroupID = 'Paygroup'
....

where itm is the record number - starting with zero.

Now you have all of the basics, you need to just wrap your logic into it. In
your case, I would just create the pay-group and use the Edit List to check
your work and manually post it once you know it's good. Maybe you want to
create just one invoice per Order and one line for each sales order line
with the commission calculation there for all to see.

Mark W



[Non-text portions of this message have been removed]
Mark, you should make a sample Visual Studio project for this and post
that to the files section.



You indeed are a generous man!



-brian



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Mark Wonsil
Sent: Tuesday, March 03, 2009 11:31 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Update Vantage Using AuotIT - Business Objects



Hi Thom,

> Okay, here is one that would be big for me. Our commission structure
does
> not fit into the Vantage/Vista structure. I have an external program
that
> figures out what the commissions are and we then key enter the
commissions
> payable into our accounts payable system. I would like to be able to
> automatically load the commissions invoices into accounts payable.

I'll leave the commission calculation to you but I started the trace
(Options | Tracing Options and enable Write Full Datasets and Write
Changes).

This seems to be the BO methods called for a single misc invoice with
one
line:

Check to see if group exists:
APInvGrp.GetByID(cGroupID)

If not:
APInvGrp.GetNewAPInvGrp(dsAPInvGrpDataSet)

Save the group:
APInvGrp.Update(dsAPInvGrpDataSet)

Start a new Invoice Header:
APInvoice.GetNewAPInvHedInvoice(dsAPInvoiceDataSet, cGroupID)

Set the vendor ID:
APInvoice.ChangeVendorID(proposedVendorID, dsAPInvoiceDataSet)

Set the Invoice Date:
APInvoice.ChangeInvoiceDate(proposedInvoiceDate, dsAPInvoiceDataSet)

Set the Invoice Header Amount:
APInvoice.ChangeInvoiceVendorAmt(proposedInvoiceVendorAmt,
dsAPInvoiceDataSet)

Set the Terms Code:
APInvoice.ChangeTermsCode(proposedTermsCode, dsAPInvoiceDataSet)

Update:
APInvoice.PreUpdate(dsAPInvoiceDataSet, requiresUserInput)
APInvoice.CheckCPayBeforeUpdate(dsAPInvoiceDataSet, opMessage) <- Check
opMessage for errors!)
APInvoice.Update(dsAPInvoiceDataSet)

Get a Misc Invoice Misc PO Set:
dsAPInvPOMiscDataSet = APInvoice.GetAPInvPOMisc(inVendorNum,
inInvoiceNum)

Refresh the Group:
dsAPInvGrpDataSet = APInvGrp.GetByID(cGroupID)

Get a new Misc Invoice Line:
APInvoice.GetNewAPInvDtlMiscellaneous(dsAPInvoiceDataSet, iVendorNum,
cInvoiceNum)

Set the part number:
APInvoice.ChangePartNum(proposedPartNum, dsAPInvoiceDataSet)

Set the Qty:
APInvoice.ChangeVendorQty(proposedVendorQty, dsAPInvoiceDataSet)

Set the Unit Cost
APInvoice.ChangeUnitCost(proposedUnitCost, dsAPInvoiceDataSet)

Update:
APInvoice.PreUpdate(dsAPInvoiceDataSet, requiresUserInput)
APInvoice.CheckCPayBeforeUpdate(dsAPInvoiceDataSet, opMessage) <- Check
opMessage for errors!)
APInvoice.CheckRevChrgBeforeUpdate(dsAPInvoiceDataSet, opMessage)
APInvoice.Update(dsAPInvoiceDataSet)

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

OK, that's a lot of steps (and I'm not sure about the getAPInvPOMisc
section) for a single invoice with a single line but you should be able
to
see how to add more invoices/lines.

Now, to set up your project, you'll need to add your references:

Epicor.Mfg.Core.Session
Epicor.Mfg.Core.BLConnectionPool
Epicor.Mfg.AD.xxx
Epicor.Mfg.BO.xxx
Epicor.Mfg.IF.Ixxx

Where xxx is for each business object that you're using, like Part, etc.

The next step is to create a connection to the appServer in the
beginning of
your program:

Dim objSess as Epicor.Mfg.Core.Session

objSess = New Epicor.Mfg.Core.Session("manager", "manager",
"AppServerDC://Vantage:8321",
Epicor.Mfg.Core.Session.LicenseType.Default)

Note that this uses one of your full licenses. I haven't tried any of
the
other license types. Change your username, password, and AppServer URL
as
needed.

Once you have the session object, you can create other objects from it.

// The business object
APInvoice = new Epicor.Mfg.BO.APInvoice(objSess.ConnectionPool)

// The datasets
dsAPInvoiceDataSet = new Epicor.Mfg.BO.APInvoiveDataSet

You should always wrap your calls in a try - catch block to check for
errors
but some objects also return messages in parameters (like the opMessage
in
the preUpdate* methods shown above), so make sure to check that variable
too.

Going back to the trace, look at the dataset changes to see which fields
get
updated before each call. I use the Item property to set the field
names:

dsAPInvoiceDataSet.APInvGrp.Item(itm).Company = 'VN10T'
dsAPInvoiceDataSet.APInvGrp.Item(itm).GroupID = 'Paygroup'
....

where itm is the record number - starting with zero.

Now you have all of the basics, you need to just wrap your logic into
it. In
your case, I would just create the pay-group and use the Edit List to
check
your work and manually post it once you know it's good. Maybe you want
to
create just one invoice per Order and one line for each sales order line
with the commission calculation there for all to see.

Mark W





[Non-text portions of this message have been removed]
Hi Mark,



Thank you, but I'm not comfortable enough with vb.net customization to
do that. There is no documentation and the Tools book is very basic.



Regards,

Linda



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Mark Wonsil
Sent: Tuesday, March 03, 2009 11:36 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Update Vantage Using AuotIT - Business Objects



Hi Linda,

> What I am trying to do is open a job, move to the operations screen
and
> import operations from Excel, then move to the materials screen and
> import the materials from Excel. We have an Excel spreadsheet that
gets
> the operations and materials from Solidworks.

In your case, I would be inclined to do this as a customization and pull
the
operations and materials from the spreadsheet from the Job Entry screen.
You
can manipulate the DataView to add your logic. OTOH, if the engineers
are
the ones who open jobs and release them to the floor then follow the
outline
I sent in the previous post to Thom.

Mark W.





[Non-text portions of this message have been removed]
Hi Again Linda,

> Thank you, but I'm not comfortable enough with vb.net customization to
> do that. There is no documentation and the Tools book is very basic.

I noticed that Solid Works can also expose itself as .Net objects. You may
be able to eliminate the spreadsheet altogether.

http://www.solidworks.com/sw/support/APIDownloads.html

Mark W.
Hi Linda,

> Thank you, but I'm not comfortable enough with vb.net customization to
> do that. There is no documentation and the Tools book is very basic.

There's a lot of help here on the list!

BTW, who actually loads your MOMs? Is it the designers or does someone in
production use the export from your CAD system?

Mark W.