Preventing Shipments Which Would Create Credit Problems

Hi Brian,

I don't really know the answers to your questions. What I've gathered from my playing around is:

* Can one reference anything in the system?
Yes, AFAIK you can link any tables you want, using whatever links you want - even link tables between different companies - and access the data.

* What parts of the 4GL environment are usable in a BPM?
Never pushed it very far. I do know that because we only have a read-only licence for Progress (as supplied by Epicor), you can't "officially" write data to the database. You get around this restriction by using "Run lib\UpdateTableBuffer.p(input BUFFER (Table):HANDLE, '(Field)',(Value))". So you may not be able to insert or delete rows - haven't tried yet.
I've used 4GL in BAMs to change the data included in emails/the subject/recipients and I've seen 4GL code to export data to csv files.
Based on that I'd say most of the 4GL environment is usable.

* What is required in a BPM query vs. in a BPM 4GL action? What's possible?
A BPM query *is* 4GL, i.e.: "for every ttOrderHed where ttOrderHed.Date01 < TODAY, every OrderDtl where OrderDtl.Company = ttOrderHed and OrderDtl.OrderNum = ttOrderHed.OrderNum"
You can always link your tables by creating a Business Activity Query and then copy the code - at least I think that works. But AFAIK it has to start with "for each/every...".

* Is there some Epicor documentation on this that I'm missing?
The only documentation I know about is the Tools manual. It gives a good example of creating a BPM to allow automatic substitute parts on Sales Orders. There a bit in the Help as well, but not much.

HTH,

Nigel.

--- In vantage@yahoogroups.com, "Brian W. Spolarich " <bspolarich@...> wrote:
>
> Nigel, this worked perfectly, at least so far in my testing. If I stage an order and try to ship it, I get the warning when I
>
> I really, *really* appreciate your generousity in offering this working solution.
>
> I may follow up directly with some specific questions.
>
> I suspect I'm not the only one who has some coding skills/experience, but is just not sure how to leverage the 4GL environment in Vantage. How does one know what is in-scope and available, for example, in the 4GL BPM code. Clearly the temp tables listed are part of the transaction, but can one reference anything in the system?
>
> What parts of the 4GL environment are usable in a BPM?
>
> What is required in a BPM query vs. in a BPM 4GL action? What's possible?
>
> Is there some Epicor documentation on this that I'm missing?
>
> -bws
>
> --
> Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix / Picometrix
> Â Â Â Â bspolarich@... ~ 734-864-5618 ~ www.advancedphotonix.com
>
>
> -----Original Message-----
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Nigel Kerley
> Sent: Sunday, April 26, 2009 9:12 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Re: Preventing Shipments Which Would Create Credit Problems
>
> Anyway:
> 2. With your existing programming experience you're most of the way there to coding in 4GL. The principles are the same: conditions/loops/etc, so it's just a matter of picking up the syntax.
>
> There are two books that you can download from the Progress website: "Progress 4GL Reference" and "Progress 4GL Handbook".
>
> I learnt 4GL through samples posted on this group and then trial & error. I only know the simple stuff but it's enough for our needs.
>
> To get you started (I haven't tested this code):
> Create a pre-processing directive on the CustShip.Update BO.
> Condition: number of rows in the 'query' is equal to 1.
> Query: for each ttShipHead where ReadyToInvoice=True
>
> Actions: execute 4GL code
> Code:
> find first ttShipHead where ttShipHead.RowMod = 'A' or ttShipHead.RowMod='U' no-lock no-error.
> if available ttShipHead then do:
> DEFINE VARIABLE ShipValue AS DECIMAL NO-UNDO.
> ShipValue = 0.
>
> /* Loop through each line in the shipment to calculate it's value */
> for each ShipDtl where ttShipHead.Company = ShipDtl.Company and ttShipHead.PackNum = ShipDtl.Packnum no-lock:
> find OrderDtl where OrderDtl.Company = ShipDtl.Company and OrderDtl.OrderNum = ShipDtl.OrderNum and OrderDtl.OrderLine = ShipDtl.OrderLine no-lock no-error.
> if available OrderDtl then do:
> ShipValue = ShipValue + OrderDtl.UnitPrice * ShipDtl.OurInventoryShipQty.
> end.
> end.
>
> /* Find the current o/s invoices for this customer */
> find first GlbCustCred where GlbCustCred.Company = ttShipHead.Company and GlbCustCred.CustNum = ttShipHead.CustNum no-lock no-error.
> if available GlbCustCred then do:
> /* Find the current credit limit for this customer */
> find first Customer where Customer.Company = ttShipHead.Company and Customer.CustNum = ttShipHead.CustNum no-lock no-error.
> if available Customer then do:
> if GlbCustCred.ARTotal + ShipValue > Customer.CreditLimit then do:
> {lib/PublishEx.i &ExMsg = "'Customer Credit limit will be exceeded. Shipment is not allowed.'"}
> {&THROW_PRIVATE}.
> end.
> end.
> end.
> end.
>
>
> There may well be shorter or easier ways to accomplish it, but the above should work. Feel free to come back to me if you want explainations for any of the code.
>
>
> Nigel.
>
>
> --- In vantage@yahoogroups.com, "Brian W. Spolarich " <bspolarich@> wrote:
> >
> > Nigel, thanks for the reply.
> >
> > A couple of questions:
> >
> > 1. The "include open sales orders in credit checking" doesn't work for our business. We have customers that might have a large sales order with many releases throughout the year. In order to accommodate that scenario we would need to extend credit to the customer to include the value of their open sales orders in order to ship them anything. That doesn't make sense to us.
> >
> > 2. I'm feeling pretty hampered by the 4GL piece of Vantage since I don't have any way to exploit it. I'm a pretty experience Perl/VB/C# programmer, but I'm not sure how I would generate the procedure code to handle this. I'd love to figure it out! Suggestions?
> >
> > -bws
> >
> > --
> > Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix / Picometrix
> > Â Â Â Â bspolarich@ ~ 734-864-5618 ~ www.advancedphotonix.com
> >
> >
> > -----Original Message-----
> > From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Nigel Kerley
> > Sent: Thursday, April 23, 2009 7:19 AM
> > To: vantage@yahoogroups.com
> > Subject: [Vantage] Re: Preventing Shipments Which Would Create Credit Problems
> >
> > Hi Brian,
> >
> > Sales Orders can also be included in the customer's credit checking. So if a user enters an order that would put the customer above their limit, the account and all open orders go on credit hold preventing them being shipped.
> >
> > This setting in on Customer Maintenance | Billing | Credit | Credit Detail.
> >
> > If this doesn't suit you then, yes, a BPM could work. A pre-processing directive on the CustShip.Update BO with 4GL code looping through the shipment lines, looking up the SO price and totting up the value. Then look up the customer record in GlbCustCred, field DocARTotal, add on the new shipment and compare it with Customer.CreditLimit.
> >
> > Nigel.
> >
> > --- In vantage@yahoogroups.com, "Brian W. Spolarich " <bspolarich@> wrote:
> > >
> > > Looking for some advice here.
> > >
> > >
> > >
> > > We're finding that the shipping/invoicing credit model doesn't work
> > > well for us. We want to prevent shipment against orders where the
> > > shipment would put the customer well over their open credit limit.
> > >
> > >
> > >
> > > Since it is the invoice generation event that puts the customer on
> > > hold, we have situations where we wind up shipping product to customers
> > > who are too extended with us, and we lose our leverage with them. But
> > > they're not yet on hood.
> > >
> > >
> > >
> > > My understanding is that Vantage is "working as designed" but it seems
> > > like a BPM could address this.
> > >
> > >
> > >
> > > Suggestions and examples?
> > >
> > >
> > >
> > > Thanks,
> > >
> > >
> > >
> > > -bws
> > >
>
>
>
>
> ------------------------------------
>
> Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have already linked your email address to a yahoo id to enable access. )
> (1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.
> (2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
> (3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links
>
Looking for some advice here.



We're finding that the shipping/invoicing credit model doesn't work
well for us. We want to prevent shipment against orders where the
shipment would put the customer well over their open credit limit.



Since it is the invoice generation event that puts the customer on
hold, we have situations where we wind up shipping product to customers
who are too extended with us, and we lose our leverage with them. But
they're not yet on hood.



My understanding is that Vantage is "working as designed" but it seems
like a BPM could address this.



Suggestions and examples?



Thanks,



-bws



--

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

bspolarich@...
<mailto:bspolarich@...> ~ 734-864-5618 ~
www.advancedphotonix.com <http://www.advancedphotonix.com>





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

Sales Orders can also be included in the customer's credit checking. So if a user enters an order that would put the customer above their limit, the account and all open orders go on credit hold preventing them being shipped.

This setting in on Customer Maintenance | Billing | Credit | Credit Detail.

If this doesn't suit you then, yes, a BPM could work. A pre-processing directive on the CustShip.Update BO with 4GL code looping through the shipment lines, looking up the SO price and totting up the value. Then look up the customer record in GlbCustCred, field DocARTotal, add on the new shipment and compare it with Customer.CreditLimit.

Nigel.

--- In vantage@yahoogroups.com, "Brian W. Spolarich " <bspolarich@...> wrote:
>
> Looking for some advice here.
>
>
>
> We're finding that the shipping/invoicing credit model doesn't work
> well for us. We want to prevent shipment against orders where the
> shipment would put the customer well over their open credit limit.
>
>
>
> Since it is the invoice generation event that puts the customer on
> hold, we have situations where we wind up shipping product to customers
> who are too extended with us, and we lose our leverage with them. But
> they're not yet on hood.
>
>
>
> My understanding is that Vantage is "working as designed" but it seems
> like a BPM could address this.
>
>
>
> Suggestions and examples?
>
>
>
> Thanks,
>
>
>
> -bws
>
>
>
> --
>
> Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix /
> Picometrix
>
> bspolarich@...
> <mailto:bspolarich@...> ~ 734-864-5618 ~
> www.advancedphotonix.com <http://www.advancedphotonix.com>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
Nigel, thanks for the reply.

A couple of questions:

1. The "include open sales orders in credit checking" doesn't work for our business. We have customers that might have a large sales order with many releases throughout the year. In order to accommodate that scenario we would need to extend credit to the customer to include the value of their open sales orders in order to ship them anything. That doesn't make sense to us.

2. I'm feeling pretty hampered by the 4GL piece of Vantage since I don't have any way to exploit it. I'm a pretty experience Perl/VB/C# programmer, but I'm not sure how I would generate the procedure code to handle this. I'd love to figure it out! Suggestions?

-bws

--
Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix / Picometrix
    bspolarich@... ~ 734-864-5618 ~ www.advancedphotonix.com


-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Nigel Kerley
Sent: Thursday, April 23, 2009 7:19 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Preventing Shipments Which Would Create Credit Problems

Hi Brian,

Sales Orders can also be included in the customer's credit checking. So if a user enters an order that would put the customer above their limit, the account and all open orders go on credit hold preventing them being shipped.

This setting in on Customer Maintenance | Billing | Credit | Credit Detail.

If this doesn't suit you then, yes, a BPM could work. A pre-processing directive on the CustShip.Update BO with 4GL code looping through the shipment lines, looking up the SO price and totting up the value. Then look up the customer record in GlbCustCred, field DocARTotal, add on the new shipment and compare it with Customer.CreditLimit.

Nigel.

--- In vantage@yahoogroups.com, "Brian W. Spolarich " <bspolarich@...> wrote:
>
> Looking for some advice here.
>
>
>
> We're finding that the shipping/invoicing credit model doesn't work
> well for us. We want to prevent shipment against orders where the
> shipment would put the customer well over their open credit limit.
>
>
>
> Since it is the invoice generation event that puts the customer on
> hold, we have situations where we wind up shipping product to customers
> who are too extended with us, and we lose our leverage with them. But
> they're not yet on hood.
>
>
>
> My understanding is that Vantage is "working as designed" but it seems
> like a BPM could address this.
>
>
>
> Suggestions and examples?
>
>
>
> Thanks,
>
>
>
> -bws
>
>
>
> --
>
> Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix /
> Picometrix
>
> bspolarich@...
> <mailto:bspolarich@...> ~ 734-864-5618 ~
> www.advancedphotonix.com <http://www.advancedphotonix.com>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>




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

Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links
Hi Brian,

1. I know where you're coming from, but we have found that it's a lot easier to stop the "shipment" at order entry than after it's been picked & packed, maybe even produced/manufactured specifically, maybe transport arranged. At that stage it's "why didn't the paper-pushers tell us before we did all this work".

We are small enough that we can include sales orders in credit control and have the customer service user go to Credit Control with each order that goes on credit hold. Credit Control then decide whether or not to release that specific order (using AR | Customer Credit Control) while maybe leaving the customer on overall credit hold. We also have automatic emails going to Credit Control whenever a customer goes on credit hold.


Anyway:
2. With your existing programming experience you're most of the way there to coding in 4GL. The principles are the same: conditions/loops/etc, so it's just a matter of picking up the syntax.

There are two books that you can download from the Progress website: "Progress 4GL Reference" and "Progress 4GL Handbook".

I learnt 4GL through samples posted on this group and then trial & error. I only know the simple stuff but it's enough for our needs.

To get you started (I haven't tested this code):
Create a pre-processing directive on the CustShip.Update BO.
Condition: number of rows in the 'query' is equal to 1.
Query: for each ttShipHead where ReadyToInvoice=True

Actions: execute 4GL code
Code:
find first ttShipHead where ttShipHead.RowMod = 'A' or ttShipHead.RowMod='U' no-lock no-error.
if available ttShipHead then do:
DEFINE VARIABLE ShipValue AS DECIMAL NO-UNDO.
ShipValue = 0.

/* Loop through each line in the shipment to calculate it's value */
for each ShipDtl where ttShipHead.Company = ShipDtl.Company and ttShipHead.PackNum = ShipDtl.Packnum no-lock:
find OrderDtl where OrderDtl.Company = ShipDtl.Company and OrderDtl.OrderNum = ShipDtl.OrderNum and OrderDtl.OrderLine = ShipDtl.OrderLine no-lock no-error.
if available OrderDtl then do:
ShipValue = ShipValue + OrderDtl.UnitPrice * ShipDtl.OurInventoryShipQty.
end.
end.

/* Find the current o/s invoices for this customer */
find first GlbCustCred where GlbCustCred.Company = ttShipHead.Company and GlbCustCred.CustNum = ttShipHead.CustNum no-lock no-error.
if available GlbCustCred then do:
/* Find the current credit limit for this customer */
find first Customer where Customer.Company = ttShipHead.Company and Customer.CustNum = ttShipHead.CustNum no-lock no-error.
if available Customer then do:
if GlbCustCred.ARTotal + ShipValue > Customer.CreditLimit then do:
{lib/PublishEx.i &ExMsg = "'Customer Credit limit will be exceeded. Shipment is not allowed.'"}
{&THROW_PRIVATE}.
end.
end.
end.
end.


There may well be shorter or easier ways to accomplish it, but the above should work. Feel free to come back to me if you want explainations for any of the code.


Nigel.


--- In vantage@yahoogroups.com, "Brian W. Spolarich " <bspolarich@...> wrote:
>
> Nigel, thanks for the reply.
>
> A couple of questions:
>
> 1. The "include open sales orders in credit checking" doesn't work for our business. We have customers that might have a large sales order with many releases throughout the year. In order to accommodate that scenario we would need to extend credit to the customer to include the value of their open sales orders in order to ship them anything. That doesn't make sense to us.
>
> 2. I'm feeling pretty hampered by the 4GL piece of Vantage since I don't have any way to exploit it. I'm a pretty experience Perl/VB/C# programmer, but I'm not sure how I would generate the procedure code to handle this. I'd love to figure it out! Suggestions?
>
> -bws
>
> --
> Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix / Picometrix
> Â Â Â Â bspolarich@... ~ 734-864-5618 ~ www.advancedphotonix.com
>
>
> -----Original Message-----
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Nigel Kerley
> Sent: Thursday, April 23, 2009 7:19 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Re: Preventing Shipments Which Would Create Credit Problems
>
> Hi Brian,
>
> Sales Orders can also be included in the customer's credit checking. So if a user enters an order that would put the customer above their limit, the account and all open orders go on credit hold preventing them being shipped.
>
> This setting in on Customer Maintenance | Billing | Credit | Credit Detail.
>
> If this doesn't suit you then, yes, a BPM could work. A pre-processing directive on the CustShip.Update BO with 4GL code looping through the shipment lines, looking up the SO price and totting up the value. Then look up the customer record in GlbCustCred, field DocARTotal, add on the new shipment and compare it with Customer.CreditLimit.
>
> Nigel.
>
> --- In vantage@yahoogroups.com, "Brian W. Spolarich " <bspolarich@> wrote:
> >
> > Looking for some advice here.
> >
> >
> >
> > We're finding that the shipping/invoicing credit model doesn't work
> > well for us. We want to prevent shipment against orders where the
> > shipment would put the customer well over their open credit limit.
> >
> >
> >
> > Since it is the invoice generation event that puts the customer on
> > hold, we have situations where we wind up shipping product to customers
> > who are too extended with us, and we lose our leverage with them. But
> > they're not yet on hood.
> >
> >
> >
> > My understanding is that Vantage is "working as designed" but it seems
> > like a BPM could address this.
> >
> >
> >
> > Suggestions and examples?
> >
> >
> >
> > Thanks,
> >
> >
> >
> > -bws
> >
Nigel, this worked perfectly, at least so far in my testing. If I stage an order and try to ship it, I get the warning when I

I really, *really* appreciate your generousity in offering this working solution.

I may follow up directly with some specific questions.

I suspect I'm not the only one who has some coding skills/experience, but is just not sure how to leverage the 4GL environment in Vantage. How does one know what is in-scope and available, for example, in the 4GL BPM code. Clearly the temp tables listed are part of the transaction, but can one reference anything in the system?

What parts of the 4GL environment are usable in a BPM?

What is required in a BPM query vs. in a BPM 4GL action? What's possible?

Is there some Epicor documentation on this that I'm missing?

-bws

--
Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix / Picometrix
    bspolarich@... ~ 734-864-5618 ~ www.advancedphotonix.com


-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Nigel Kerley
Sent: Sunday, April 26, 2009 9:12 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Preventing Shipments Which Would Create Credit Problems

Anyway:
2. With your existing programming experience you're most of the way there to coding in 4GL. The principles are the same: conditions/loops/etc, so it's just a matter of picking up the syntax.

There are two books that you can download from the Progress website: "Progress 4GL Reference" and "Progress 4GL Handbook".

I learnt 4GL through samples posted on this group and then trial & error. I only know the simple stuff but it's enough for our needs.

To get you started (I haven't tested this code):
Create a pre-processing directive on the CustShip.Update BO.
Condition: number of rows in the 'query' is equal to 1.
Query: for each ttShipHead where ReadyToInvoice=True

Actions: execute 4GL code
Code:
find first ttShipHead where ttShipHead.RowMod = 'A' or ttShipHead.RowMod='U' no-lock no-error.
if available ttShipHead then do:
DEFINE VARIABLE ShipValue AS DECIMAL NO-UNDO.
ShipValue = 0.

/* Loop through each line in the shipment to calculate it's value */
for each ShipDtl where ttShipHead.Company = ShipDtl.Company and ttShipHead.PackNum = ShipDtl.Packnum no-lock:
find OrderDtl where OrderDtl.Company = ShipDtl.Company and OrderDtl.OrderNum = ShipDtl.OrderNum and OrderDtl.OrderLine = ShipDtl.OrderLine no-lock no-error.
if available OrderDtl then do:
ShipValue = ShipValue + OrderDtl.UnitPrice * ShipDtl.OurInventoryShipQty.
end.
end.

/* Find the current o/s invoices for this customer */
find first GlbCustCred where GlbCustCred.Company = ttShipHead.Company and GlbCustCred.CustNum = ttShipHead.CustNum no-lock no-error.
if available GlbCustCred then do:
/* Find the current credit limit for this customer */
find first Customer where Customer.Company = ttShipHead.Company and Customer.CustNum = ttShipHead.CustNum no-lock no-error.
if available Customer then do:
if GlbCustCred.ARTotal + ShipValue > Customer.CreditLimit then do:
{lib/PublishEx.i &ExMsg = "'Customer Credit limit will be exceeded. Shipment is not allowed.'"}
{&THROW_PRIVATE}.
end.
end.
end.
end.


There may well be shorter or easier ways to accomplish it, but the above should work. Feel free to come back to me if you want explainations for any of the code.


Nigel.


--- In vantage@yahoogroups.com, "Brian W. Spolarich " <bspolarich@...> wrote:
>
> Nigel, thanks for the reply.
>
> A couple of questions:
>
> 1. The "include open sales orders in credit checking" doesn't work for our business. We have customers that might have a large sales order with many releases throughout the year. In order to accommodate that scenario we would need to extend credit to the customer to include the value of their open sales orders in order to ship them anything. That doesn't make sense to us.
>
> 2. I'm feeling pretty hampered by the 4GL piece of Vantage since I don't have any way to exploit it. I'm a pretty experience Perl/VB/C# programmer, but I'm not sure how I would generate the procedure code to handle this. I'd love to figure it out! Suggestions?
>
> -bws
>
> --
> Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix / Picometrix
> Â Â Â Â bspolarich@... ~ 734-864-5618 ~ www.advancedphotonix.com
>
>
> -----Original Message-----
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Nigel Kerley
> Sent: Thursday, April 23, 2009 7:19 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Re: Preventing Shipments Which Would Create Credit Problems
>
> Hi Brian,
>
> Sales Orders can also be included in the customer's credit checking. So if a user enters an order that would put the customer above their limit, the account and all open orders go on credit hold preventing them being shipped.
>
> This setting in on Customer Maintenance | Billing | Credit | Credit Detail.
>
> If this doesn't suit you then, yes, a BPM could work. A pre-processing directive on the CustShip.Update BO with 4GL code looping through the shipment lines, looking up the SO price and totting up the value. Then look up the customer record in GlbCustCred, field DocARTotal, add on the new shipment and compare it with Customer.CreditLimit.
>
> Nigel.
>
> --- In vantage@yahoogroups.com, "Brian W. Spolarich " <bspolarich@> wrote:
> >
> > Looking for some advice here.
> >
> >
> >
> > We're finding that the shipping/invoicing credit model doesn't work
> > well for us. We want to prevent shipment against orders where the
> > shipment would put the customer well over their open credit limit.
> >
> >
> >
> > Since it is the invoice generation event that puts the customer on
> > hold, we have situations where we wind up shipping product to customers
> > who are too extended with us, and we lose our leverage with them. But
> > they're not yet on hood.
> >
> >
> >
> > My understanding is that Vantage is "working as designed" but it seems
> > like a BPM could address this.
> >
> >
> >
> > Suggestions and examples?
> >
> >
> >
> > Thanks,
> >
> >
> >
> > -bws
> >




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

Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have already linked your email address to a yahoo id to enable access. )
(1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.
(2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
(3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links
Hi Brian,

I don't really know the answers to your questions. What I've gathered from my playing around is:

* Can one reference anything in the system?
Yes, AFAIK you can link any tables you want, using whatever links you want - even link tables between different companies - and access the data.

* What parts of the 4GL environment are usable in a BPM?
Never pushed it very far. I do know that because we only have a read-only licence for Progress (as supplied by Epicor), you can't "officially" write data to the database. You get around this restriction by using "Run lib\UpdateTableBuffer.p(input BUFFER (Table):HANDLE, '(Field)',(Value))". So you may not be able to insert or delete rows - haven't tried yet.
I've used 4GL in BAMs to change the data included in emails/the subject/recipients and I've seen 4GL code to export data to csv files.
Based on that I'd say most of the 4GL environment is usable.

* What is required in a BPM query vs. in a BPM 4GL action? What's possible?
A BPM query *is* 4GL, i.e.: "for every ttOrderHed where ttOrderHed.Date01 < TODAY, every OrderDtl where OrderDtl.Company = ttOrderHed and OrderDtl.OrderNum = ttOrderHed.OrderNum"
You can always link your tables by creating a Business Activity Query and then copy the code - at least I think that works. But AFAIK it has to start with "for each/every...".

* Is there some Epicor documentation on this that I'm missing?
The only documentation I know about is the Tools manual. It gives a good example of creating a BPM to allow automatic substitute parts on Sales Orders. There a bit in the Help as well, but not much.

HTH,

Nigel.


--- In vantage@yahoogroups.com, "Brian W. Spolarich " <bspolarich@...> wrote:
>
> Nigel, this worked perfectly, at least so far in my testing. If I stage an order and try to ship it, I get the warning when I
>
> I really, *really* appreciate your generousity in offering this working solution.
>
> I may follow up directly with some specific questions.
>
> I suspect I'm not the only one who has some coding skills/experience, but is just not sure how to leverage the 4GL environment in Vantage. How does one know what is in-scope and available, for example, in the 4GL BPM code. Clearly the temp tables listed are part of the transaction, but can one reference anything in the system?
>
> What parts of the 4GL environment are usable in a BPM?
>
> What is required in a BPM query vs. in a BPM 4GL action? What's possible?
>
> Is there some Epicor documentation on this that I'm missing?
>
> -bws
>
> --
> Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix / Picometrix
> Â Â Â Â bspolarich@... ~ 734-864-5618 ~ www.advancedphotonix.com
>
>
> -----Original Message-----
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Nigel Kerley
> Sent: Sunday, April 26, 2009 9:12 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Re: Preventing Shipments Which Would Create Credit Problems
>
> Anyway:
> 2. With your existing programming experience you're most of the way there to coding in 4GL. The principles are the same: conditions/loops/etc, so it's just a matter of picking up the syntax.
>
> There are two books that you can download from the Progress website: "Progress 4GL Reference" and "Progress 4GL Handbook".
>
> I learnt 4GL through samples posted on this group and then trial & error. I only know the simple stuff but it's enough for our needs.
>
> To get you started (I haven't tested this code):
> Create a pre-processing directive on the CustShip.Update BO.
> Condition: number of rows in the 'query' is equal to 1.
> Query: for each ttShipHead where ReadyToInvoice=True
>
> Actions: execute 4GL code
> Code:
> find first ttShipHead where ttShipHead.RowMod = 'A' or ttShipHead.RowMod='U' no-lock no-error.
> if available ttShipHead then do:
> DEFINE VARIABLE ShipValue AS DECIMAL NO-UNDO.
> ShipValue = 0.
>
> /* Loop through each line in the shipment to calculate it's value */
> for each ShipDtl where ttShipHead.Company = ShipDtl.Company and ttShipHead.PackNum = ShipDtl.Packnum no-lock:
> find OrderDtl where OrderDtl.Company = ShipDtl.Company and OrderDtl.OrderNum = ShipDtl.OrderNum and OrderDtl.OrderLine = ShipDtl.OrderLine no-lock no-error.
> if available OrderDtl then do:
> ShipValue = ShipValue + OrderDtl.UnitPrice * ShipDtl.OurInventoryShipQty.
> end.
> end.
>
> /* Find the current o/s invoices for this customer */
> find first GlbCustCred where GlbCustCred.Company = ttShipHead.Company and GlbCustCred.CustNum = ttShipHead.CustNum no-lock no-error.
> if available GlbCustCred then do:
> /* Find the current credit limit for this customer */
> find first Customer where Customer.Company = ttShipHead.Company and Customer.CustNum = ttShipHead.CustNum no-lock no-error.
> if available Customer then do:
> if GlbCustCred.ARTotal + ShipValue > Customer.CreditLimit then do:
> {lib/PublishEx.i &ExMsg = "'Customer Credit limit will be exceeded. Shipment is not allowed.'"}
> {&THROW_PRIVATE}.
> end.
> end.
> end.
> end.
>
>
> There may well be shorter or easier ways to accomplish it, but the above should work. Feel free to come back to me if you want explainations for any of the code.
>
>
> Nigel.
>
>
> --- In vantage@yahoogroups.com, "Brian W. Spolarich " <bspolarich@> wrote:
> >
> > Nigel, thanks for the reply.
> >
> > A couple of questions:
> >
> > 1. The "include open sales orders in credit checking" doesn't work for our business. We have customers that might have a large sales order with many releases throughout the year. In order to accommodate that scenario we would need to extend credit to the customer to include the value of their open sales orders in order to ship them anything. That doesn't make sense to us.
> >
> > 2. I'm feeling pretty hampered by the 4GL piece of Vantage since I don't have any way to exploit it. I'm a pretty experience Perl/VB/C# programmer, but I'm not sure how I would generate the procedure code to handle this. I'd love to figure it out! Suggestions?
> >
> > -bws
> >
> > --
> > Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix / Picometrix
> > Â Â Â Â bspolarich@ ~ 734-864-5618 ~ www.advancedphotonix.com
> >
> >
> > -----Original Message-----
> > From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Nigel Kerley
> > Sent: Thursday, April 23, 2009 7:19 AM
> > To: vantage@yahoogroups.com
> > Subject: [Vantage] Re: Preventing Shipments Which Would Create Credit Problems
> >
> > Hi Brian,
> >
> > Sales Orders can also be included in the customer's credit checking. So if a user enters an order that would put the customer above their limit, the account and all open orders go on credit hold preventing them being shipped.
> >
> > This setting in on Customer Maintenance | Billing | Credit | Credit Detail.
> >
> > If this doesn't suit you then, yes, a BPM could work. A pre-processing directive on the CustShip.Update BO with 4GL code looping through the shipment lines, looking up the SO price and totting up the value. Then look up the customer record in GlbCustCred, field DocARTotal, add on the new shipment and compare it with Customer.CreditLimit.
> >
> > Nigel.
> >
> > --- In vantage@yahoogroups.com, "Brian W. Spolarich " <bspolarich@> wrote:
> > >
> > > Looking for some advice here.
> > >
> > >
> > >
> > > We're finding that the shipping/invoicing credit model doesn't work
> > > well for us. We want to prevent shipment against orders where the
> > > shipment would put the customer well over their open credit limit.
> > >
> > >
> > >
> > > Since it is the invoice generation event that puts the customer on
> > > hold, we have situations where we wind up shipping product to customers
> > > who are too extended with us, and we lose our leverage with them. But
> > > they're not yet on hood.
> > >
> > >
> > >
> > > My understanding is that Vantage is "working as designed" but it seems
> > > like a BPM could address this.
> > >
> > >
> > >
> > > Suggestions and examples?
> > >
> > >
> > >
> > > Thanks,
> > >
> > >
> > >
> > > -bws
> > >
>
>
>
>
> ------------------------------------
>
> Useful links for the Yahoo!Groups Vantage Board are: ( Note: You must have already linked your email address to a yahoo id to enable access. )
> (1) To access the Files Section of our Yahoo!Group for Report Builder and Crystal Reports and other 'goodies', please goto: http://groups.yahoo.com/group/vantage/files/.
> (2) To search through old msg's goto: http://groups.yahoo.com/group/vantage/messages
> (3) To view links to Vendors that provide Vantage services goto: http://groups.yahoo.com/group/vantage/linksYahoo! Groups Links
>