Method Directive for Default Product Group on Part

I use a routine like this with no condition and abl code. Mine is actually in a data directive, but should work in an update method.

 

I don’t know if the plant record is added on the same pass that the part is made or on an update.

 

if you have data directives, then I would do this on the partplant table and the find would be for the part table to get the class

 

the caps and trim is to keep all of our part numbers uppercase and I had people pasting in numbers with spaces in front of them.

 

I also record who made the part and when.

 

Greg

 

/*Set default values*/

 

For each ttPart where ttPart.Rowmod = 'A' or ttpart.Rowmod = 'U' no-lock.

               

               

                Find First PartPlant where PartPlant.company = cur-comp and PartPlant.PartNum = ttPart.Partnum

                                                                and PartPlant.Plant = 'MfgSys' and PartPlant.LeadTime = 0 no-error.

 

                                                If Available PartPlant Then Do:

                               

                               

                                                                If ttPart.PartClassID = 'FLANGE' then

                                                                                                                                PartPlant.LeadTime = 15.

                                                                                                                               

                                                                If ttPart.PartClassID = 'MOTOR' then

                                                                                                                                PartPlant.LeadTime = 90.

                                                                                                                                                                               

                                               

                                                                                                               

                                                End.

                               

                                                                               

                                               

                                               

                                                                                                                                If ttpart.RowMod = 'A' Then Do:

                                                                                                                                Assign ttpart.PartNum = caps(trim(ttpart.partnum)).

                                                                                                                                Assign ttPart.ShortChar05 = dcd-userid.

                                                                                                                                Assign ttPart.Date01 = Now.

                                                                                                                               

                                                                                                                  End.    

                                                                                               

End.

 

 

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Saturday, May 10, 2014 10:00 AM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] Method Directive for Default Product Group on Part

 

 

I do have another one that i'm not sure how to tackle...

 

How would I go about a Method Dir that would use an if/then to set defaults on the PartPlant.LeadTime based on ttPart.ClassId?

 

For example, if the part being created has a part class of Flange, the leadtime defaults to 15, and if the part class is a motor the default leadtime would be 90, etc.

 

Thanks!

Sarah



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

Hello,


What i'm trying to accomplish is having a default of "After Market" in the Product Code/Group of the Part Master.  My method directive is in the Part.GetNewPart, Post-Processing.  I have it set to enabled and to prevent endless loops.  No Conditions.  the actions section is set to "set the Part.ProdCode field of the added row to the "AM" expression.  I have also tried: "set the Part.ProdCodeDescription field of the added row to the "After Market" expression, just to see.


I have a couple of others in this same method directive that do the exact same thing, but they are checkboxes set to true or false, and they seem to work great, but this one is going back to null upon save.


Any suggestions from you gurus out there?  This is probably something small that i've got wrong.


Thanks!

Try pre-processing.

From: scooley@... [vantage]
Sent: Saturday, May 10, 2014 7:32 AM
To: vantage@yahoogroups.com
Reply To: vantage@yahoogroups.com
Subject: [Vantage] Method Directive for Default Product Group on Part

 

<div id="ygrps-yiv-1677239830ygrp-text">
  
  
  <p></p><p><span>Hello,</span></p><p><span><br></span></p><p>What i&#39;m trying to accomplish is having a default of &quot;After Market&quot; in the Product Code/Group of the Part Master. &nbsp;My method directive is in the Part.GetNewPart, Post-Processing. &nbsp;I have it set to enabled and to prevent endless loops. &nbsp;No Conditions. &nbsp;the actions section is set to &quot;set the Part.ProdCode field of the added row to the &quot;AM&quot; expression. &nbsp;I have also tried: &quot;set the Part.ProdCodeDescription field of the added row to the &quot;After Market&quot; expression, just to see.</p><p><br></p><p>I have a couple of others in this same method directive that do the exact same thing, but they are checkboxes set to true or false, and they seem to work great, but this one is going back to null upon save.</p><p><br></p><p>Any suggestions from you gurus out there? &nbsp;This is probably something small that i&#39;ve got wrong.</p><p><br></p><p>Thanks!</p><p></p>

</div>


Thank you Scott, I tried that and it didn't do anything, but i think i figured it out.

Still in Post-processing i added a second statement, so now the whole thing is:

"set the Part.ProdcodeDescription field of the added row to the "After Market" expression
and set the Part.ProdCode field of the changed row to the "AM" expression"

this seems to handle the before and after the save, the first half of the statement is aesthetic only.

I do have another one that i'm not sure how to tackle...


How would I go about a Method Dir that would use an if/then to set defaults on the PartPlant.LeadTime based on ttPart.ClassId?


For example, if the part being created has a part class of Flange, the leadtime defaults to 15, and if the part class is a motor the default leadtime would be 90, etc.


Thanks!

Sarah