Ok thanks.
I’ll try it tomorrow and report back
In the part.update add the partplant to the for each something like this.
For each ttPart where ttPart.Rowmod = ‘U’ no-lock,
each partplant fields (AutoConsumeStock RawMaterial MfgLotSize MinOrderQty ) where partplant.plant = cur-plant and PartPlant.PartNum = ttPart.PartNum and PartPlant.Company = cur-comp.
Greg
Hi Greg,
First of all, thank you so much for your help and guidance on this thread…this has been my first real go with ABL and you’ve really helped!
I’ve done the following:
- Created a method directive for Part.Update Pre-Processing…used the same ABL code and changed the Rowmod to U. Also adding the condition “ttpart.typecode” has been changed from any to any.
- Created a data directive for PartPlant using In-Transaction…used the same ABL code and changed the Rowmod to U. Also adding the condition “ttPartPlant.SourceType” has been changed from any to any.
- I then tested the results and it seems to work, (i’ll test more throughly tomorrow).
If i click new part,
add a part num and description.
click save (its already on purchased).
then change the type to manufactured.
Click save.
The manufactured defaults seem to kick in after i click YES to a pop up message (which is what i wanted) - but i’ll test more thoroughly tomorrow.
Lastly, i’m still trying to digest your last message before i change the ABL further as it does seem to work already.
Thanks again,
Mark
Your Welcome. I like abl and will be lost when I go to 10 and have to get deep into C#.
On the last bit of code, your data directive does the same as adding the partplant to the part update.
Greg
Just to summarise this ticket as there’s quite a lot of detail:
Request: In Part Entry when the user creates a new part, I would like various default fields set for when the Part.TypeCode is either Purchased or Manufactured. The fields i want defaulting come from 2 tables, Part and PartPlant.
Solution: Done via 4 bpms using ABL code:
-
Method directive… Part.GetNewPart…Post-Processing…ABL attached…No condition, only action.Part.GetNewPart (Method Directive) ABL.txt (724 Bytes)
-
Method directive…Part.Update…Pre-Processing…ABL attached…Condition = “the ttPart.TypeCode field has been changed from any to any”, and the action is the ABL code.Part.Update (Method Directive) ABL.txt (685 Bytes)
-
Data directive…PartPlant / In-Transaction…ABL attached…No condition, only action. PartPlant (Data Directive) ABL.txt (791 Bytes)
-
Data directive…PartPlant / In-Transaction…ABL attached…condition = “the ttPartPlant.SourceType field has been changed from any to any”, and the action is the ABL code. PartPlant updated (Data Directive) ABL.txt (783 Bytes)
Point 1 is for get new part.
Point 2 is for when the part is updated.
Point 3 is for new partplant.
Point 4 is for when partplant is updated.
Greg, From the four files attached, which do i need to add that final bit of code to?
Thanks again.
.
You won’t need the last part with the way you have it working.
Greg
Hi Greg,
Have you got any clues on the below link?
Many thanks in advance.
I did run a quick trace yesterday, but did not find the method that is firing. I think the quickest way to do this would be a customization and use the data wizard to set the field to true on load of the form.
I do not do very many customizations, but this should be like one in the ice manuals. I will try to run a test later today.
Greg
Hi Greg, i watched the above video…and then started to build it in here:
(but i don’t know how to write now default the field to 1 or True)
this thread nails it pal.