E9.702A BPM at Part Entry to Update Part fields

For what is worth if you set it in the pre processing you dont have to re-set it in post



Jose C Gomez
Software Engineer



T: 904.469.1524 mobile
E: jose@...
http://www.josecgomez.com

     Â


Quis custodiet ipsos custodes?


On Wed, Aug 20, 2014 at 4:55 PM, marcus@... [vantage] <vantage@yahoogroups.com> wrote:
Â
<div>
  
  
  <p>I figured it out (with a lot of help from the people above):</p><div></div><div>Use the Part BO and the Update Method.</div><div>In the Pre-Processing tab, create the following action (no conditions):</div><div>

synchronously execute ABL using the following code:

For each ttPart no-lock  where ttpart.RowMod ='A', Each PartClass no-lock where (PartClass.Company = ttPart.Company and PartClass.ClassID = ttPart.ClassID ).
Â
      set ttPart.CheckBox01 = PartClass.Checkbox01.
      set ttPart.CheckBox02 = PartClass.Checkbox02.
      set ttPart.CheckBox03 = PartClass.Checkbox03.
      set ttPart.CheckBox04 = PartClass.Checkbox04.
      set ttPart.CheckBox05 = PartClass.Checkbox05.
      set ttPart.CheckBox06 = PartClass.Checkbox06.
End.

In the Post-Processing tab, create the following:
In the conditions tab:
method changed the ttPart.ClassID field using the query, for each ttPart no-lock, from any to any
In the actions tab:
synchronously execute ABL using the following code:
for each PartClass no-lock  ,  each ttPart no-lock  where (PartClass.Company = ttPart.Company and PartClass.ClassID = ttPart.ClassID ):
set ttPart.CheckBox01 = PartClass.Checkbox01.
set ttPart.CheckBox02 = PartClass.Checkbox02.
set ttPart.CheckBox03 = PartClass.Checkbox03.
set ttPart.CheckBox04 = PartClass.Checkbox04.
set ttPart.CheckBox05 = PartClass.Checkbox05.
set ttPart.CheckBox06 = PartClass.Checkbox06.
End.


I hope someone else finds this useful. Thanks again to each of the people who helped me, I really appreciate it. :)

</div><div class="ygrps-yiv-586693501">
 


<div style="color:#fff;min-height:0;"></div>

Hi,

I am currently trying to write a BPM that updates 6 UD fields in the Part table with a corresponding value in the Part Class table. When a user enters the part number and selects a part class and then saves, I would like the BPM to update the Part UD fields with the Part Class UD fields.

Right now, my BPM only works when I change the part class. So when I initially create a part and enter the class it doesn't update the part table with the part class information; however, when I change the part class it then saves the new part class information into the part table. So basically, my current BPM only works properly when the part class is changed, but not when the part class is initially set on a new part.

Here is what I am using:

The method I am calling is Part.Update

In the Post Processing Behavior my condition is:

method changed the ttPart.ClassID field For each ttPart no-lock from any to another

OR

method changed the ttPart.ClassID field For each ttPart no-lock from ? to another

The action is:

synchronously execute ABL 

for each PartClass no-lock  ,  each ttPart no-lock  where (PartClass.Company = ttPart.Company and PartClass.ClassID = ttPart.ClassID ):

set ttPart.CheckBox01 = PartClass.Checkbox01.

set ttPart.CheckBox02 = PartClass.Checkbox02.

set ttPart.CheckBox03 = PartClass.Checkbox03.

set ttPart.CheckBox04 = PartClass.Checkbox04.

set ttPart.CheckBox05 = PartClass.Checkbox05.

set ttPart.CheckBox06 = PartClass.Checkbox06.

End.

Any ideas on how to get this to work when someone initially enters a part and sets the class?

Thanks you,

-Marcus

 

I used a Data Directive to set Default values for the Part Table.

 

 

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Monday, August 18, 2014 1:41 PM
To: vantage@yahoogroups.com
Subject: [Vantage] E9.702A BPM at Part Entry to Update Part fields

 

 

Hi,

I am currently trying to write a BPM that updates 6 UD fields in the Part table with a corresponding value in the Part Class table. When a user enters the part number and selects a part class and then saves, I would like the BPM to update the Part UD fields with the Part Class UD fields.

Right now, my BPM only works when I change the part class. So when I initially create a part and enter the class it doesn't update the part table with the part class information; however, when I change the part class it then saves the new part class information into the part table. So basically, my current BPM only works properly when the part class is changed, but not when the part class is initially set on a new part.

Here is what I am using:

The method I am calling is Part.Update

In the Post Processing Behavior my condition is:

method changed the ttPart.ClassID field For each ttPart no-lock from any to another

OR

method changed the ttPart.ClassID field For each ttPart no-lock from ? to another

The action is:

synchronously execute ABL 

for each PartClass no-lock  ,  each ttPart no-lock  where (PartClass.Company = ttPart.Company and PartClass.ClassID = ttPart.ClassID ):

           set ttPart.CheckBox01 = PartClass.Checkbox01.

           set ttPart.CheckBox02 = PartClass.Checkbox02.

           set ttPart.CheckBox03 = PartClass.Checkbox03.

           set ttPart.CheckBox04 = PartClass.Checkbox04.

           set ttPart.CheckBox05 = PartClass.Checkbox05.

           set ttPart.CheckBox06 = PartClass.Checkbox06.

End.

Any ideas on how to get this to work when someone initially enters a part and sets the class?

Thanks you,

-Marcus

 

So you used the Data Directive to set the default of one table to the default of another?
If so, would you mind explaining it to me how you did it?
Basically, I would like to set the following values:
Part.Checkbox01 = PartClass.Checkbox01
Part.Checkbox02 = PartClass.Checkbox02
Part.Checkbox03 = PartClass.Checkbox03
Part.Checkbox04 = PartClass.Checkbox04
Part.Checkbox05 = PartClass.Checkbox05
Part.Checkbox06 = PartClass.Checkbox06
I can get it to work correctly as long as I am making a change to a pre-existing record; for example part number 123 already has an assigned class of XXX and I change it to YYY and it brings over the correct information; however, when I initially create a part and I initially assign a class, I can't figure out how to bring over that Part.Class information.

You would have to do a lookup on the Part Class table – find that record  -

 

Find first  PartClass where PartClass.Company = ttPart.Company

                                           And PartClass.ClassID = ttPart.ClassID.

 

If Available PartClass then DO:

 

Assign Part.Checkbox01 = PartClass.Checkbox01

 

 

End.

 

 

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Monday, August 18, 2014 3:36 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: E9.702A BPM at Part Entry to Update Part fields

 

 

So you used the Data Directive to set the default of one table to the default of another?

If so, would you mind explaining it to me how you did it?

Basically, I would like to set the following values:

Part.Checkbox01 = PartClass.Checkbox01

Part.Checkbox02 = PartClass.Checkbox02

Part.Checkbox03 = PartClass.Checkbox03

Part.Checkbox04 = PartClass.Checkbox04

Part.Checkbox05 = PartClass.Checkbox05

Part.Checkbox06 = PartClass.Checkbox06

I can get it to work correctly as long as I am making a change to a pre-existing record; for example part number 123 already has an assigned class of XXX and I change it to YYY and it brings over the correct information; however, when I initially create a part and I initially assign a class, I can't figure out how to bring over that Part.Class information.

Thanks for your help so far, I really appreciate it!
I'm not sure how I can do a lookup in the Data Directives tool. I chose the part table and created both a standard and In'Transaction Directive. In the conditions I chose ttPart.ClassID field has been changed from any to any and the actions I chose to execute the ABL code I listed above.
Where would I go to do a lookup like you mentioned? That isn't one of the options I am seeing in either the Conditions or Actions tab.
In a regular BPM Pre-Processing just run Pre-Proc on Update and do a lookup and update the fields on the tt table..Â


Jose C Gomez
Software Engineer



T: 904.469.1524 mobile

E: jose@...
http://www.josecgomez.com

     Â


Quis custodiet ipsos custodes?


On Mon, Aug 18, 2014 at 7:05 PM, marcus@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p>Thanks for your help so far, I really appreciate it!</p><div></div><div>I&#39;m not sure how I can do a lookup in the Data Directives tool. I chose the part table and created both a standard and In&#39;Transaction Directive. In the conditions I chose ttPart.ClassID field has been changed from any to any and the actions I chose to execute the ABL code I listed above.</div>
Where would I go to do a lookup like you mentioned? That isn't one of the options I am seeing in either the Conditions or Actions tab.

</div>
 


<div style="color:#fff;min-height:0;"></div>

Ok, so I used the Update Method in the BPM and created a new Pre-Proc.
For the Actions I used the user text:
set the defined field of all rows identified by the designed query to the specific expression
For the defined field I chose:
ttPart.Checkbox01
For the design query I used:
for each ttPart no-lock  ,  each PartClass no-lock  where (ttPart.Company = PartClass.Company and ttPart.ClassID = PartClass.ClassID )
For the specific expressions I used:
FIND FIRST PartClass where (PartClass.Company = ttPart.Company AND PartClass.ClassID = ttPart.ClassID).
IF AVAILABLE PartClass THEN DO:
Assign Part.Checkbox01 = PartClass.CheckBox01
End.

However, I keep getting the following error when I check the syntax of the specific expressions I used above:
Unable to understand after -- ".Checkbox01 =" (247)
Cannot process comparison in expression. (250)
Could not understand line 1. (198)
Unable to understand after -- "PartClass.Checkbox01". (247)
Could not understand line 3. (198)

Any idea what this may mean?
I am very new to BPM's and coding in general, so much of this is very difficult for me. Thank you all for your help so far, I truly appreciate it.

There is no period after checkBox01. I took you original code and made some changes to it. paste the code below into the execute ABL action in a pre-processing directive on part update.

 

I did not test, but it should work for you

 

Greg

 

 

For each ttPart no-lock  where (ttpart.RowMod ='A' or ttpart.RowMod ='U') ,

                                                Each PartClass no-lock where (PartClass.Company = ttPart.Company and PartClass.ClassID = ttPart.ClassID ).

 

 

            set ttPart.CheckBox01 = PartClass.Checkbox01.

            set ttPart.CheckBox02 = PartClass.Checkbox02.

            set ttPart.CheckBox03 = PartClass.Checkbox03.

            set ttPart.CheckBox04 = PartClass.Checkbox04.

            set ttPart.CheckBox05 = PartClass.Checkbox05.

            set ttPart.CheckBox06 = PartClass.Checkbox06.

End.

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, August 19, 2014 11:49 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: E9.702A BPM at Part Entry to Update Part fields

 

 

Ok, so I used the Update Method in the BPM and created a new Pre-Proc.

For the Actions I used the user text:

set the defined field of all rows identified by the designed query to the specific expression

For the defined field I chose:

ttPart.Checkbox01

For the design query I used:

for each ttPart no-lock  ,  each PartClass no-lock  where (ttPart.Company = PartClass.Company and ttPart.ClassID = PartClass.ClassID )

For the specific expressions I used:

FIND FIRST PartClass where (PartClass.Company = ttPart.Company AND PartClass.ClassI D = ttPart.ClassID).

IF AVAILABLE PartClass THEN DO:

Assign Part.Checkbox01 = PartClass.CheckBox01

End.

 

However, I keep getting the following error when I check the syntax of the specific expressions I used above:

Unable to understand after -- ".Checkbox01 =" (247)

Cannot process comparison in expression. (250)

Could not understand line 1. (198)

Unable to understand after -- "PartClass.Checkbox01". (247)

Could not understand line 3. (198)

 

Any idea what this may mean?

I am very new to BPM's and coding in general, so much of this is very difficu lt for me. Thank you all for your help so far, I truly appreciate it.



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-6280 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."

I didn’t test my code either when I sent the email. Just sending the outline – I apologize for being sloppy.

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, August 19, 2014 9:27 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Re: E9.702A BPM at Part Entry to Update Part fields

 

 

There is no period after checkBox01. I took you original code and made some changes to it. paste the code below into the execute ABL action in a pre-processing directive on part update.

 

I did not test, but it should work for you

 

Greg

 

 

For each ttPart no-lock  where (ttpart.RowMod ='A' or ttpart.RowMod ='U') ,

                                                Each PartClass no-lock where (PartClass.Company = ttPart.Company and PartClass.ClassID = ttPart.ClassID ).

 

 

            set ttPart.CheckBox01 = PartClass.Checkbox01.

            set ttPart.CheckBox02 = PartClass.Checkbox02.

            set ttPart.CheckBox03 = PartClass.Checkbox03.

            set ttPart.CheckBox04 = PartClass.Checkbox04.

            set ttPart.CheckBox05 = PartClass.Checkbox05.

            set ttPart.CheckBox06 = PartClass.Checkbox06.

End.

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, August 19, 2014 11:49 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: E9.702A BPM at Part Entry to Update Part fields

 

 

Ok, so I used the Update Method in the BPM and created a new Pre-Proc.

For the Actions I used the user text:

set the defined field of all rows identified by the designed query to the specific expression

For the defined field I chose:

ttPart.Checkbox01

For the design query I used:

for each ttPart no-lock  ,  each PartClass no-lock  where (ttPart.Company = PartClass.Company and ttPart.ClassID = PartClass.ClassID )

For the specific expressions I used:

FIND FIRST PartClass where (PartClass.Company = ttPart.Company AND PartClass.ClassI D = ttPart.ClassID).

IF AVAILABLE PartClass THEN DO:

Assign Part.Checkbox01 = PartClass.CheckBox01

End.

 

However, I keep getting the following error when I check the syntax of the specific expressions I used above:

Unable to understand after -- ".Checkbox01 =" (247)

Cannot process comparison in expression. (250)

Could not understand line 1. (198)

Unable to understand after -- "PartClass.Checkbox01". (247)

Could not understand line 3. (198)

 

Any idea what this may mean?

I am very new to BPM's and coding in general, so much of this is very difficu lt for me. Thank you all for your help so far, I truly appreciate it.

 


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-6280 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."

I can send an email with a video of what I am trying to do if you would like some more clarification. My email is marcus@...
I figured it out (with a lot of help from the people above):
Use the Part BO and the Update Method.
In the Pre-Processing tab, create the following action (no conditions):
synchronously execute ABL using the following code:
For each ttPart no-lock  where ttpart.RowMod ='A', Each PartClass no-lock where (PartClass.Company = ttPart.Company and PartClass.ClassID = ttPart.ClassID ).
 
            set ttPart.CheckBox01 = PartClass.Checkbox01.
            set ttPart.CheckBox02 = PartClass.Checkbox02.
            set ttPart.CheckBox03 = PartClass.Checkbox03.
            set ttPart.CheckBox04 = PartClass.Checkbox04.
            set ttPart.CheckBox05 = PartClass.Checkbox05.
            set ttPart.CheckBox06 = PartClass.Checkbox06.
End.

In the Post-Processing tab, create the following:
In the conditions tab:
method changed the ttPart.ClassID field using the query, for each ttPart no-lock, from any to any
In the actions tab:
synchronously execute ABL using the following code:
for each PartClass no-lock  ,  each ttPart no-lock  where (PartClass.Company = ttPart.Company and PartClass.ClassID = ttPart.ClassID ):
set ttPart.CheckBox01 = PartClass.Checkbox01.
set ttPart.CheckBox02 = PartClass.Checkbox02.
set ttPart.CheckBox03 = PartClass.Checkbox03.
set ttPart.CheckBox04 = PartClass.Checkbox04.
set ttPart.CheckBox05 = PartClass.Checkbox05.
set ttPart.CheckBox06 = PartClass.Checkbox06.
End.


I hope someone else finds this useful. Thanks again to each of the people who helped me, I really appreciate it. :)