I get a validation error (Unable to understand after "RUN") on the line:
RUN GetNewAPInvGrp IN APInvGrpProc({&input-output_dataset_APInvGrpDataSet}).
Thom Rose
Controller
Electric Mirror LLC
HOTEL LUXURY
"The World Leader in Back-lit Mirrors & Mirror TV Technology"
T 425 776-4946
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 Mike Anstey
Sent: Friday, October 15, 2010 10:40 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Call Business Object Method from a BPM
RUN GetNewAPInvGrp IN APInvGrpProc("101015th") won't work. It does not
match the signature of the method
Also you can't look for a record before you find it.
You need to use:
RUN GetNewAPInvGrp IN APInvGrpProc
({&input-output_dataset_APInvGrpDataSet})
FIND FIRST ttAPInvGrp WHERE ttAPInvGrp.Rowmod = "A" NO-ERROR.
IF AVAIL ttAPInvGrp THEN
DO:
ttAPInvGrp.GroupID = "101015th".
RUN Update in APInvGrpProc. ({&input-output_dataset_APInvGrpDataSet}).
END.
As for not being able to update the record directly, I think you need a
special open edge license to do that.
You should be able to model your second call similar to the one above.
From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On Behalf
Of Thomas Rose
Sent: Friday, October 15, 2010 2:05 PM
To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] Call Business Object Method from a BPM
That looks really interesting. I am trying to do something similar,
except that I want to add a new AP Invoice when a customer shipment is
made. Here is the code I have in the CustShip.Update post processing
action so far (8.03.403):
DEFINE VAR err-msg AS CHARACTER NO-UNDO.
DEFINE VAR APInvGrpProc AS HANDLE NO-UNDO.
DEFINE VAR APInvoiceProc AS HANDLE NO-UNDO.
RUN bo/APInvGrpProc/APInvGrpProc.p PERSISTENT SET APInvGrpProc NO-ERROR.
IF ERROR-STATUS:ERROR THEN DO:
err-msg='Could not start process bo/APInvGrp/APInvGrp.p,
Aborting!(Create AP Invoice Group)'.
message err-msg.
END.
RUN GetNewAPInvGrp IN APInvGrpProc("101015th").
IF ERROR-STATUS:ERROR THEN DO:
DELETE OBJECT APInvGrpProc NO-ERROR.
err-msg='Error in RunDirect for Process
GetNewAPInvGrp,Aborting(createAPInvGrp)'.
MESSAGE err-msg "->" error-status:get-message(1) " " error-status:error.
RETURN.
END.
/*Now the AP invoice group has been created. Next, we access it.*/
FIND FIRST APInvGrp WHERE APInvGrp.GroupID='101015th' NO-ERROR.
IF AVAIL APInvGrp THEN DO:
/*Add a new invoice to the group.*/
RUN bo/APInvoice/APInvoice.p PERSISTENT SET APInvoiceProc NO-ERROR.
RUN GetNewAPInvHedInvoice IN APInvoiceProc('SONumAndPackNum').
IF AVAIL APInvHed THEN DO:
ASSIGN APInvHed.APAcctID = "COMM".
END.
END.
I tried to look for ttAPInvGrp and ttAPInvHed with my IF AVAIL...
statements, but they gave a validation error, "Unknown or ambiguous
table...". I'm guessing, but don't know, this may be a symptom of a
deeper problem. My next problem comes in the ASSIGN statement, where I
get a validation error, "You may not compile programs that update the
database in this version...". I thought that if I was using the BO, I
was okay. If I can't assign data to fields in the record, there is not
much point to adding the invoice.
I feel lost. Presumably, I am entirely on the wrong track here. If
anyone can turn me in the right direction, or if someone has an existing
example that adds a new AP invoice in a BPM, I would be very grateful.
Thom Rose
Controller
Electric Mirror LLC
HOTEL LUXURY
"The World Leader in Back-lit Mirrors & Mirror TV Technology"
T 425 776-4946
A 11831 Beverly Park Rd, Bldg D, Everett, WA 98204 USA
www.electricmirror.com<http://www.electricmirror.com>
From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com> ] On
Behalf Of Mike Anstey
Sent: Tuesday, September 28, 2010 4:52 AM
To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] Call Business Object Method from a BPM
DEF VAR vh-proc AS HANDLE NO-UNDO. /* handle to the process
object */
RUN bo/PO/PO.p PERSISTENT SET vh-proc NO-ERROR.
IF ERROR-STATUS:ERROR THEN DO:
err-msg = 'Could not start process bo/PO/PO.p, Aborting!
(CreatePO)'.
message err-msg.
END.
RUN GetNewPOHeader IN vh-proc ({&input-output_dataset_PODataSet}).
IF ERROR-STATUS:ERROR THEN DO:
DELETE OBJECT vh-proc NO-ERROR.
err-msg = 'Error in RunDirect for Process GetNewPOHeader, Aborting
(createPOHdr)'.
MESSAGE err-msg "-> " error-status:get-message(1) " "
error-status:error.
RETURN.
END.
/* Now that you have created the PO head you must access it */
FIND FIRST ttPOHeader WHERE ttPOHeader.Rowmod = 'A' NO-ERROR.
IF AVAIL ttPOHeader THEN
DO:
/* Once you have access, make any changes */
RUN getBuyer(cplant, output cbuyer).
ASSIGN ttPOHeader.BuyerID = cbuyer
ttPOHeader.ShipViaCode = "0007" /* Customer Pickup */
ttPOHeader.VendorNum = iVendorNum. /* CP RAIL */
END.
/* Once you have made your changes update */
RUN UPDATE IN vh-proc (INPUT-OUTPUT DATASET PODataSet).
To know what you need for each different procedure call use the
"Advanced" button in Method Directives. (Open method directives for the
bo you are interested in, find the right procedure call then click the
advanced button).
-----Original Message-----
From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>]
On Behalf
Of Kevin Simon
Sent: Monday, September 27, 2010 10:22 PM
To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: Re: [Vantage] Call Business Object Method from a BPM
Rob,
I do quite a bit of coding in the 4GL, so that doesn't scare me. If I
wanted simply to write new rows to the OrderMsc table, for example, that
would be a breeze. However, I don't know the syntax to set the values
in the datasets, then call the associated BO. Do you have any examples?
Thanks again.
Kevin
On Mon, Sep 27, 2010 at 9:06 AM, Rob Bucek <rbucek@...<mailto:rbucek%40dsmfg.com>
<mailto:rbucek%40dsmfg.com> <mailto:rbucek%40dsmfg.com>> wrote:
Behalf Of
------------------------------------
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/.<http://groups.yahoo.com/group/vantage/files/>
<http://groups.yahoo.com/group/vantage/files/>
<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
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
RUN GetNewAPInvGrp IN APInvGrpProc({&input-output_dataset_APInvGrpDataSet}).
Thom Rose
Controller
Electric Mirror LLC
HOTEL LUXURY
"The World Leader in Back-lit Mirrors & Mirror TV Technology"
T 425 776-4946
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 Mike Anstey
Sent: Friday, October 15, 2010 10:40 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Call Business Object Method from a BPM
RUN GetNewAPInvGrp IN APInvGrpProc("101015th") won't work. It does not
match the signature of the method
Also you can't look for a record before you find it.
You need to use:
RUN GetNewAPInvGrp IN APInvGrpProc
({&input-output_dataset_APInvGrpDataSet})
FIND FIRST ttAPInvGrp WHERE ttAPInvGrp.Rowmod = "A" NO-ERROR.
IF AVAIL ttAPInvGrp THEN
DO:
ttAPInvGrp.GroupID = "101015th".
RUN Update in APInvGrpProc. ({&input-output_dataset_APInvGrpDataSet}).
END.
As for not being able to update the record directly, I think you need a
special open edge license to do that.
You should be able to model your second call similar to the one above.
From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On Behalf
Of Thomas Rose
Sent: Friday, October 15, 2010 2:05 PM
To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] Call Business Object Method from a BPM
That looks really interesting. I am trying to do something similar,
except that I want to add a new AP Invoice when a customer shipment is
made. Here is the code I have in the CustShip.Update post processing
action so far (8.03.403):
DEFINE VAR err-msg AS CHARACTER NO-UNDO.
DEFINE VAR APInvGrpProc AS HANDLE NO-UNDO.
DEFINE VAR APInvoiceProc AS HANDLE NO-UNDO.
RUN bo/APInvGrpProc/APInvGrpProc.p PERSISTENT SET APInvGrpProc NO-ERROR.
IF ERROR-STATUS:ERROR THEN DO:
err-msg='Could not start process bo/APInvGrp/APInvGrp.p,
Aborting!(Create AP Invoice Group)'.
message err-msg.
END.
RUN GetNewAPInvGrp IN APInvGrpProc("101015th").
IF ERROR-STATUS:ERROR THEN DO:
DELETE OBJECT APInvGrpProc NO-ERROR.
err-msg='Error in RunDirect for Process
GetNewAPInvGrp,Aborting(createAPInvGrp)'.
MESSAGE err-msg "->" error-status:get-message(1) " " error-status:error.
RETURN.
END.
/*Now the AP invoice group has been created. Next, we access it.*/
FIND FIRST APInvGrp WHERE APInvGrp.GroupID='101015th' NO-ERROR.
IF AVAIL APInvGrp THEN DO:
/*Add a new invoice to the group.*/
RUN bo/APInvoice/APInvoice.p PERSISTENT SET APInvoiceProc NO-ERROR.
RUN GetNewAPInvHedInvoice IN APInvoiceProc('SONumAndPackNum').
IF AVAIL APInvHed THEN DO:
ASSIGN APInvHed.APAcctID = "COMM".
END.
END.
I tried to look for ttAPInvGrp and ttAPInvHed with my IF AVAIL...
statements, but they gave a validation error, "Unknown or ambiguous
table...". I'm guessing, but don't know, this may be a symptom of a
deeper problem. My next problem comes in the ASSIGN statement, where I
get a validation error, "You may not compile programs that update the
database in this version...". I thought that if I was using the BO, I
was okay. If I can't assign data to fields in the record, there is not
much point to adding the invoice.
I feel lost. Presumably, I am entirely on the wrong track here. If
anyone can turn me in the right direction, or if someone has an existing
example that adds a new AP invoice in a BPM, I would be very grateful.
Thom Rose
Controller
Electric Mirror LLC
HOTEL LUXURY
"The World Leader in Back-lit Mirrors & Mirror TV Technology"
T 425 776-4946
A 11831 Beverly Park Rd, Bldg D, Everett, WA 98204 USA
www.electricmirror.com<http://www.electricmirror.com>
From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com> ] On
Behalf Of Mike Anstey
Sent: Tuesday, September 28, 2010 4:52 AM
To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
Subject: RE: [Vantage] Call Business Object Method from a BPM
DEF VAR vh-proc AS HANDLE NO-UNDO. /* handle to the process
object */
RUN bo/PO/PO.p PERSISTENT SET vh-proc NO-ERROR.
IF ERROR-STATUS:ERROR THEN DO:
err-msg = 'Could not start process bo/PO/PO.p, Aborting!
(CreatePO)'.
message err-msg.
END.
RUN GetNewPOHeader IN vh-proc ({&input-output_dataset_PODataSet}).
IF ERROR-STATUS:ERROR THEN DO:
DELETE OBJECT vh-proc NO-ERROR.
err-msg = 'Error in RunDirect for Process GetNewPOHeader, Aborting
(createPOHdr)'.
MESSAGE err-msg "-> " error-status:get-message(1) " "
error-status:error.
RETURN.
END.
/* Now that you have created the PO head you must access it */
FIND FIRST ttPOHeader WHERE ttPOHeader.Rowmod = 'A' NO-ERROR.
IF AVAIL ttPOHeader THEN
DO:
/* Once you have access, make any changes */
RUN getBuyer(cplant, output cbuyer).
ASSIGN ttPOHeader.BuyerID = cbuyer
ttPOHeader.ShipViaCode = "0007" /* Customer Pickup */
ttPOHeader.VendorNum = iVendorNum. /* CP RAIL */
END.
/* Once you have made your changes update */
RUN UPDATE IN vh-proc (INPUT-OUTPUT DATASET PODataSet).
To know what you need for each different procedure call use the
"Advanced" button in Method Directives. (Open method directives for the
bo you are interested in, find the right procedure call then click the
advanced button).
-----Original Message-----
From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>]
On Behalf
Of Kevin Simon
Sent: Monday, September 27, 2010 10:22 PM
To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
<mailto:vantage%40yahoogroups.com>
Subject: Re: [Vantage] Call Business Object Method from a BPM
Rob,
I do quite a bit of coding in the 4GL, so that doesn't scare me. If I
wanted simply to write new rows to the OrderMsc table, for example, that
would be a breeze. However, I don't know the syntax to set the values
in the datasets, then call the associated BO. Do you have any examples?
Thanks again.
Kevin
On Mon, Sep 27, 2010 at 9:06 AM, Rob Bucek <rbucek@...<mailto:rbucek%40dsmfg.com>
<mailto:rbucek%40dsmfg.com> <mailto:rbucek%40dsmfg.com>> wrote:
>writing..
>
> It is possible to do just that with a BPM yes... crack your knuckles
> and put your coding hat on, it will be reasonable chunk of 4GL
><mailto:vantage%40yahoogroups.com> <vantage%40yahoogroups.com> [mailto:
> Rob Bucek
>
> Production Control Manager
>
> PH: (715) 284-5376 ext 311
>
> Mobile: (715)896-0590
>
> FAX: (715)284-4084
>
> <http://www.dsmfg.com/>
>
> (Click the logo to view our site) <http://www.dsmfg.com/>
>
> From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
> vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com><mailto:vantage%40yahoogroups.com> <vantage%40yahoogroups.com>] On
Behalf Of
> ksimon8fw<mailto:vantage%40yahoogroups.com> <vantage%40yahoogroups.com>
> Sent: Sunday, September 26, 2010 10:15 PM
> To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
> Subject: [Vantage] Call Business Object Method from a BPM[Non-text portions of this message have been removed]
>
>
> I'm not sure if this is possible, but it seems as if I've heard of
> someone doing something similar. I would like to have a BPM trigger a
> business object call. In the specific example I am looking at, I want
> to trigger an event that adds a miscellaneous charge to a sales order.
> When I do a trace, it appears to call the following methods from the
> SalesOrder business object:
> GetNewOrderMsc
> ChangeMiscCode
> ChangeMiscAmount
> Update
>
> Is it possible to do this within a BPM? Or, are my options only to go
> the Service Connect route?
>
> Thanks.
> Kevin Simon
>
> [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/.<http://groups.yahoo.com/group/vantage/files/>
<http://groups.yahoo.com/group/vantage/files/>
<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
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]