That did it.
Thanks much to all.
Greg Payne
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of DD
Sent: Friday, June 08, 2012 11:18 AM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] Re: Create and Update UD17 not working
Add the no-error to the find first line so that it will not error out when the UD 17 is not found.
Find first UD17 where UD17.Company = ttQuoteMtl.Company and UD17.Key1 = string(ttQuoteMtl.QuoteNum) and UD17.Key2 = string(ttQuoteMtl.QuoteLine) and UD17.Key4 = string(ttQuoteMtl.MtlSeq) and UD17.Key5=string(QuoteQty.QtyNum) NO-ERROR .
________________________________
From: Greg Payne <gpayne@...<mailto:gpayne%40compulink-usa.com>>
To: "vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>" <vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>>
Sent: Friday, June 8, 2012 9:17 AM
Subject: RE: [Vantage] Re: Create and Update UD17 not working
here it is. The concatenation attempt was putting all of the keys into character10 to see if that worked.
Thanks for looking.
Greg
/* Calculate Excess into UD17 */
/* Calculate Excess in ttQuoteQty.Number01, Mtl in UD17.Number01 */
define variable MatMult as decimal no-undo initial 0.
define variable QtyToBuy as decimal no-undo initial 0.
define variable QtyRequired as decimal no-undo initial 0.
define variable ExcessMaterial as decimal no-undo initial 0.
define variable ExcessMaterialCost as decimal no-undo initial 0.
define variable Total_ExcessMaterialCost as decimal no-undo initial 0.
For Each ttQuoteMtl, each QuoteDtl
where ttQuoteMtl.Company = QuoteDtl.Company
and ttQuoteMtl.QuoteNum = QuoteDtl.QuoteNum
and ttQuoteMtl.QuoteLine = QuoteDtl.QuoteLine
and ttQuoteMtl.RowMod = 'U',
each QuoteQty
where QuoteQty.Company = ttQuoteMtl.company and
QuoteQty.QuoteNum = ttQuoteMtl.QuoteNum and
QuoteQty.QuoteLine = ttQuoteMtl.QuoteLine:
Message " DEBUG in QuoteAsm after ttQuoteMtl query " string(ttQuoteMtl.QuoteNum).
Assign QtyTobuy = 0
QtyRequired = 0
Excessmaterial = 0
ExcessMaterialCost = 0
MatMult = ttQuoteMtl.Number01.
/* QtyToBuy = MatMult * QuoteQty.OurQuantity */
Assign QtyRequired = ttQuoteMtl.QtyPer * QuoteQty.OurQuantity.
If QtyRequired > MatMult and Int(QtyRequired / MatMult) <> ( QtyRequired / MatMult ) Then Do:
Assign QtyToBuy = ( Int(QtyRequired / MatMult) + 1 ) * MatMult.
End.
If QtyRequired > MatMult and (Int(QtyRequired / MatMult)) = (QtyRequired / MatMult) Then Do:
Assign QtyToBuy = (QtyRequired / MatMult) * MatMult.
End.
If QtyRequired <= MatMult Then Do:
Assign QtyToBuy = MatMult.
End.
ExcessMaterial = QtyToBuy - QtyRequired.
ExcessMaterialCost = (QtyToBuy - QtyRequired) * ttQuoteMtl.EstunitCost. /* Expand to use the proper PBrkCostxx */
Find first UD17 where UD17.Company = ttQuoteMtl.Company and UD17.Key1 = string(ttQuoteMtl.QuoteNum) and UD17.Key2 = string(ttQuoteMtl.QuoteLine) and UD17.Key4 = string(ttQuoteMtl.MtlSeq) and UD17.Key5=string(QuoteQty.QtyNum).
/* find first UD17 where UD17.Character10 = ttQuoteMtl.Company + string(ttQuoteMtl.QuoteNum) + string(ttQuoteMtl.QuoteLine) + string(ttQuoteMtl.AssemblySeq) + string(ttQuoteMtl.MtlSeq) + string(QuoteQty.QtyNum).
*/
Message " DEBUG in QuoteAsm Find first UD17 query " ttQuoteMtl.MtlSeq QuoteQty.QtyNum.
If Available UD17 then Do:
assign UD17.Company = CUR-COMP
UD17.Key1 = string(ttQuoteMtl.QuoteNum)
UD17.Key2 = string(ttQuoteMtl.QuoteLine)
UD17.Key3 = string(ttQuoteMtl.AssemblySeq)
UD17.Key4 = string(ttQuoteMtl.MtlSeq)
UD17.Key5 = string(QuoteQty.QtyNum)
UD17.Number01 = ExcessMaterial
UD17.Number02 = ExcessMaterialCost
UD17.Number03 = QtyToBuy
UD17.Number04 = QtyRequired
UD17.Character01 = ttQuoteMtl.PartNum.
End.
Else Do:
Create UD17.
assign UD17.Company = CUR-COMP
UD17.Key1 = string(ttQuoteMtl.QuoteNum)
UD17.Key2 = string(ttQuoteMtl.QuoteLine)
UD17.Key3 = string(ttQuoteMtl.AssemblySeq)
UD17.Key4 = string(ttQuoteMtl.MtlSeq)
UD17.Key5 = string(QuoteQty.QtyNum)
UD17.Number01 = ExcessMaterial
UD17.Number02 = ExcessMaterialCost
UD17.Number03 = QtyToBuy
UD17.Number04 = QtyRequired
UD17.Character01 = ttQuoteMtl.PartNum no-error.
UD17.Character10 = UD17.Company + string(ttQuoteMtl.QuoteNum) + string(ttQuoteMtl.QuoteLine) + string(ttQuoteMtl.AssemblySeq) + string(ttQuoteMtl.MtlSeq) + string(QuoteQty.QtyNum).
Release UD17.
End.
End.
-----Original Message-----
From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On Behalf Of John Driggers
Sent: Friday, June 08, 2012 9:56 AM
To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
Subject: Re: [Vantage] Re: Create and Update UD17 not working
I'm not sure I follow what you mean when you say you tried to concat all the keys into one field...
Can you stick all your code up here?
Thanks much to all.
Greg Payne
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of DD
Sent: Friday, June 08, 2012 11:18 AM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] Re: Create and Update UD17 not working
Add the no-error to the find first line so that it will not error out when the UD 17 is not found.
Find first UD17 where UD17.Company = ttQuoteMtl.Company and UD17.Key1 = string(ttQuoteMtl.QuoteNum) and UD17.Key2 = string(ttQuoteMtl.QuoteLine) and UD17.Key4 = string(ttQuoteMtl.MtlSeq) and UD17.Key5=string(QuoteQty.QtyNum) NO-ERROR .
________________________________
From: Greg Payne <gpayne@...<mailto:gpayne%40compulink-usa.com>>
To: "vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>" <vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>>
Sent: Friday, June 8, 2012 9:17 AM
Subject: RE: [Vantage] Re: Create and Update UD17 not working
here it is. The concatenation attempt was putting all of the keys into character10 to see if that worked.
Thanks for looking.
Greg
/* Calculate Excess into UD17 */
/* Calculate Excess in ttQuoteQty.Number01, Mtl in UD17.Number01 */
define variable MatMult as decimal no-undo initial 0.
define variable QtyToBuy as decimal no-undo initial 0.
define variable QtyRequired as decimal no-undo initial 0.
define variable ExcessMaterial as decimal no-undo initial 0.
define variable ExcessMaterialCost as decimal no-undo initial 0.
define variable Total_ExcessMaterialCost as decimal no-undo initial 0.
For Each ttQuoteMtl, each QuoteDtl
where ttQuoteMtl.Company = QuoteDtl.Company
and ttQuoteMtl.QuoteNum = QuoteDtl.QuoteNum
and ttQuoteMtl.QuoteLine = QuoteDtl.QuoteLine
and ttQuoteMtl.RowMod = 'U',
each QuoteQty
where QuoteQty.Company = ttQuoteMtl.company and
QuoteQty.QuoteNum = ttQuoteMtl.QuoteNum and
QuoteQty.QuoteLine = ttQuoteMtl.QuoteLine:
Message " DEBUG in QuoteAsm after ttQuoteMtl query " string(ttQuoteMtl.QuoteNum).
Assign QtyTobuy = 0
QtyRequired = 0
Excessmaterial = 0
ExcessMaterialCost = 0
MatMult = ttQuoteMtl.Number01.
/* QtyToBuy = MatMult * QuoteQty.OurQuantity */
Assign QtyRequired = ttQuoteMtl.QtyPer * QuoteQty.OurQuantity.
If QtyRequired > MatMult and Int(QtyRequired / MatMult) <> ( QtyRequired / MatMult ) Then Do:
Assign QtyToBuy = ( Int(QtyRequired / MatMult) + 1 ) * MatMult.
End.
If QtyRequired > MatMult and (Int(QtyRequired / MatMult)) = (QtyRequired / MatMult) Then Do:
Assign QtyToBuy = (QtyRequired / MatMult) * MatMult.
End.
If QtyRequired <= MatMult Then Do:
Assign QtyToBuy = MatMult.
End.
ExcessMaterial = QtyToBuy - QtyRequired.
ExcessMaterialCost = (QtyToBuy - QtyRequired) * ttQuoteMtl.EstunitCost. /* Expand to use the proper PBrkCostxx */
Find first UD17 where UD17.Company = ttQuoteMtl.Company and UD17.Key1 = string(ttQuoteMtl.QuoteNum) and UD17.Key2 = string(ttQuoteMtl.QuoteLine) and UD17.Key4 = string(ttQuoteMtl.MtlSeq) and UD17.Key5=string(QuoteQty.QtyNum).
/* find first UD17 where UD17.Character10 = ttQuoteMtl.Company + string(ttQuoteMtl.QuoteNum) + string(ttQuoteMtl.QuoteLine) + string(ttQuoteMtl.AssemblySeq) + string(ttQuoteMtl.MtlSeq) + string(QuoteQty.QtyNum).
*/
Message " DEBUG in QuoteAsm Find first UD17 query " ttQuoteMtl.MtlSeq QuoteQty.QtyNum.
If Available UD17 then Do:
assign UD17.Company = CUR-COMP
UD17.Key1 = string(ttQuoteMtl.QuoteNum)
UD17.Key2 = string(ttQuoteMtl.QuoteLine)
UD17.Key3 = string(ttQuoteMtl.AssemblySeq)
UD17.Key4 = string(ttQuoteMtl.MtlSeq)
UD17.Key5 = string(QuoteQty.QtyNum)
UD17.Number01 = ExcessMaterial
UD17.Number02 = ExcessMaterialCost
UD17.Number03 = QtyToBuy
UD17.Number04 = QtyRequired
UD17.Character01 = ttQuoteMtl.PartNum.
End.
Else Do:
Create UD17.
assign UD17.Company = CUR-COMP
UD17.Key1 = string(ttQuoteMtl.QuoteNum)
UD17.Key2 = string(ttQuoteMtl.QuoteLine)
UD17.Key3 = string(ttQuoteMtl.AssemblySeq)
UD17.Key4 = string(ttQuoteMtl.MtlSeq)
UD17.Key5 = string(QuoteQty.QtyNum)
UD17.Number01 = ExcessMaterial
UD17.Number02 = ExcessMaterialCost
UD17.Number03 = QtyToBuy
UD17.Number04 = QtyRequired
UD17.Character01 = ttQuoteMtl.PartNum no-error.
UD17.Character10 = UD17.Company + string(ttQuoteMtl.QuoteNum) + string(ttQuoteMtl.QuoteLine) + string(ttQuoteMtl.AssemblySeq) + string(ttQuoteMtl.MtlSeq) + string(QuoteQty.QtyNum).
Release UD17.
End.
End.
-----Original Message-----
From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On Behalf Of John Driggers
Sent: Friday, June 08, 2012 9:56 AM
To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
Subject: Re: [Vantage] Re: Create and Update UD17 not working
I'm not sure I follow what you mean when you say you tried to concat all the keys into one field...
Can you stick all your code up here?
On Fri, Jun 8, 2012 at 9:39 AM, Greg Payne <gpayne@...<mailto:gpayne%40compulink-usa.com>> wrote:
> **
>
>
> I am getting find first/last failed for UD17 in the error log.
>
> I tried using all 5 keys and I tried to concat them all together into
> Character10 for just one compare, but the same error.
>
>
> -----Original Message-----
> From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On
> Behalf Of John Driggers
> Sent: Friday, June 08, 2012 8:14 AM
> To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
> Subject: Re: [Vantage] Re: Create and Update UD17 not working
>
> I've used the following structure numerous times:
>
> FIND FIRST UD17 WHERE UD17.Character01 <> "" NO-ERROR.
> IF AVAILABLE UD17 THEN DO:
> <update existing record>
> END.
> ELSE DO:
> <create new record>
> END.
>
> Is this what you're after?
>
> On Fri, Jun 8, 2012 at 7:48 AM, jckinneman <jckinneman@...<mailto:jckinneman%40yahoo.com>> wrote:
>
> > **
>
> >
> >
> > What release of Epicor are you on? And in what
> > context/method/program are you running the code? When you run the
> > code is there anything showing up in the server log? You won't
> > always get a visible error message but the log will frequently have
> > some informational error
> messages.
> >
> > Jim Kinneman
> > Encompass Solutions, Inc
> >
> >
> > --- In vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>, Greg Payne <gpayne@...<mailto:gpayne@...>> wrote:
> > >
> > > I need to create and update UD17. I have tried available , not
> > > available
> > for UD17, but I can't get both to work. Each works if the other is
> > commented out.
> > >
> > > What is the right way to do both in a method directive bpm?
> > >
> > > A section of the code is below.
> > >
> > > Thanks
> > >
> > > Greg Payne
> > >
> > >
> > >
> > > Create UD17.
> > > assign UD17.Company = CUR-COMP
> > > UD17.Key1 = string(ttQuoteMtl.QuoteNum)
> > > UD17.Key2 = string(ttQuoteMtl.QuoteLine)
> > > UD17.Key3 = string(ttQuoteMtl.AssemblySeq)
> > > UD17.Key4 = string(ttQuoteMtl.MtlSeq)
> > > UD17.Key5 = string(QuoteQty.QtyNum)
> > > UD17.Number01 = ExcessMaterial
> > > UD17.Number02 = ExcessMaterialCost
> > > UD17.Number03 = QtyToBuy
> > > UD17.Number04 = QtyRequired
> > > UD17.Character01 = ttQuoteMtl.PartNum no-error.
> > > Release UD17.
> > >
> > >
> > > For Each UD17 where UD17.Company = ttQuoteMtl.Company and
> > > UD17.Key1 =
> > trim(string(ttQuoteMtl.QuoteNum)) and UD17.Key2 =
> > trim(string(ttQuoteMtl.QuoteLine)) and UD17.Key3 =
> > trim(string(ttQuoteMtl.AssemblySeq)) and
> > > UD17.Key4 = trim(string(ttQuoteMtl.MtlSeq)) and
> > UD17.Key5=trim(string(QuoteQty.QtyNum)).
> > >
> > >
> > > assign UD17.Company = CUR-COMP
> > > UD17.Key1 = string(ttQuoteMtl.QuoteNum)
> > > UD17.Key2 = string(ttQuoteMtl.QuoteLine)
> > > UD17.Key3 = string(ttQuoteMtl.AssemblySeq)
> > > UD17.Key4 = string(ttQuoteMtl.MtlSeq)
> > > UD17.Key5 = string(QuoteQty.QtyNum)
> > > UD17.Number01 = ExcessMaterial
> > > UD17.Number02 = ExcessMaterialCost
> > > UD17.Number03 = QtyToBuy
> > > UD17.Number04 = QtyRequired
> > > UD17.Character01 = ttQuoteMtl.PartNum.
> > > Release UD17.
> > >
> > > End.
> > >
> > > CONFIDENTIALITY NOTICE
> > >
> > > The information contained in this communication, including
> > > attachments,
> > is privileged and confidential. It is intended only for the
> > exclusive use of the addressee. If the reader of this message is not
> > the intended recipient, or the employee or agent responsible for
> > delivering it to the intended recipient, you are hereby notified
> > that any dissemination, distribution or copying of this
> > communication is strictly prohibited. If you have received this
> > communication in error, please notify us at (727)
> > 578-6258 and immediately delete the communication.
> > >
> > > "This (document/presentation) may contain technical data as
> > > defined in
> > the International Traffic In Arms Regulations (ITAR) 22 CFR 120.10.
> > Export of this material is restricted by the Arms Export Control Act
> > (22
> U.S.C.
> > 2751 et seq.) and may not be exported to foreign persons without
> > prior approval form the U.S. Department of State."
> > >
> >
> >
> >
>
> --
> *John Driggers*
> *High End Dev, System Design, Profit Drinking*
> *
> **:: 904.404.9233*
> *:: waffqle@...<mailto:waffqle%40gmail.com>*
> *:: NO FAXES*
>
> *
>
> *
>
> [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/>
> (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
>
>
> CONFIDENTIALITY NOTICE
>
> The information contained in this communication, including
> attachments, is privileged and confidential. It is intended only for
> the exclusive use of the addressee. If the reader of this message is
> not the intended recipient, or the employee or agent responsible for
> delivering it to the intended recipient, you are hereby notified that
> any dissemination, distribution or copying of this communication is
> strictly prohibited. If you have received this communication in error,
> please notify us at (727) 578-6258 and immediately delete the communication.
>
> "This (document/presentation) may contain technical data as defined in
> the International Traffic In Arms Regulations (ITAR) 22 CFR 120.10.
> Export of this material is restricted by the Arms Export Control Act
> (22 U.S.C. 2751 et seq.) and may not be exported to foreign persons
> without prior approval form the U.S. Department of State."
>
>
>
--
*John Driggers*
*High End Dev, System Design, Profit Drinking*
*
**:: 904.404.9233*
*:: waffqle@...<mailto:waffqle%40gmail.com>*
*:: NO FAXES*
*
*
[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/>
(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
CONFIDENTIALITY NOTICE
The information contained in this communication, including attachments, is privileged and confidential. It is intended only for the exclusive use of the addressee. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us at (727) 578-6258 and immediately delete the communication.
"This (document/presentation) may contain technical data as defined in the International Traffic In Arms Regulations (ITAR) 22 CFR 120.10. Export of this material is restricted by the Arms Export Control Act (22 U.S.C. 2751 et seq.) and may not be exported to foreign persons without prior approval form the U.S. Department of State."
[Non-text portions of this message have been removed]
________________________________
CONFIDENTIALITY NOTICE
The information contained in this communication, including attachments, is privileged and confidential. It is intended only for the exclusive use of the addressee. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us at (727) 578-6258 and immediately delete the communication.
"This (document/presentation) may contain technical data as defined in the International Traffic In Arms Regulations (ITAR) 22 CFR 120.10. Export of this material is restricted by the Arms Export Control Act (22 U.S.C. 2751 et seq.) and may not be exported to foreign persons without prior approval form the U.S. Department of State."
[Non-text portions of this message have been removed]