Back in November, I had an issue trying to get the address of Purchase Orders to match the address of the user’s plant (see Altering the address of a PO when a new PO header is requested - Vista/Vantage 8 - Epicor User Help Forum). I was able to accomplish this, with help from the folks on this forum. The method I used was to add new code to the PO.GetNewPOHeader’s Post-Processing section. The code I added was:
synchronously execute 4GL return record call, return
/* Assign plant address to PO header */
For each ttPOHeader,
each Plant where Plant.Company = ttPOHeader.Company and Plant.Plant = Cur-plant.
Message "In assign plant address" + string(ttPOHeader.PONum).
Assign ttPOHeader.ShipAddress1 = Plant.Address1
ttPOHeader.ShipAddress2 = Plant.Address2
ttPOHeader.ShipAddress3 = Plant.Address3
ttPOHeader.ShipCity = Plant.City
ttPOHeader.ShipState = Plant.State
ttPOHeader.ShipZip = Plant.Zip.
Find Country where Country.Company=Plant.Company and Country.CountryNum=Plant.CountryNum no-error.
If available Country Then do:
Assign ttPOHeader.ShipCountry = Country.ISOCode
ttPOHeader.ShipCountryNumDescription = Country.Description.
End.
End.
This worked and all new POs entered on the Purchase Order Entry screen have the correct address.
Now I need to do the same thing to handle POs created when the user goes to the New PO Suggestions screen and selects the Generate New PO action.
My issue is that I am not sure which Method Directive to add the code to. And once I get to Method Directive, how do I know which tables are available for me to work with?
If you have any knowledge in this area, I would appreciate a nudge in the right direction.
Forgive me, but I am working from very little documentation and basically just flying by the seat of my pants here.
How would I create a data directive for the POHeader table? When I enter the Method Directives screen, I see that I can do a search on “Method Code”, but “POHeader” does not appear in the entries in the Business Object drop down. The “Directive Group” dropdown only shows groups I have previously created.
What steps would I follow to be able to attach a directive to a table? (BTW: being able to attach a directive to a table sounds fantastic ! ! ! I could resolve a lot of other issues if I knew how to do this).
But how do I create one? I see no menu entries related to “Data Directives” and the Epicor Tools User Guide (pretty well the only documenatation I have), says nothing about them either.
The code that danbedwards posted will need to be put in a text file (with extension “.P”) an stored on the V8 server (I forget where I stored mine, it was in a sub-directory of the \server folder)
In the BAM, chose the file from above as the Alert Program.
It’s been 2 yrs since I’ve been on V8, so I might be off on some things.