I need a bpm to prevent sales orders being raised where the partnumber is inactive.
Has anybody done this before? It sounds a fairly simple request, but the system allows you to write any part number into the field even if the part number doesn’t exist.
Im not sure this would be 100% bullet proof for us - occasionally we do put “non part numbers” through like for instance if we were to sell scrap metal and an order has to be raised. (its a different form of income, not turnover generated for us).
After testing - this message appears - (which i think is system generated because i can’t find a bpm that has been written)…but if you click “ok”…you can simply proceed.
What i’m looking for is IF the part is inactive…then stop altogether
So what I’ve found from the below testing is that:
When creating a SO and you use the search button – inactive parts don’t show up…..(see screenshot below).
When you just type it into the part field (without searching)….it recognises that it is inactive and the processor is prompted to either click “ok” or “cancel”. Ok lets them continue.
The message that appears is not a bpm setup by Prior. It seems to be a system built notification.
Would you be so kind as to tell me how I should set up the method directive?
Would it be pre processing on salesorder.update?
Then, I can write the action but I’m not sure about how to apply the condition.
Just do a pre processing on ChangePartNum that if it finds the Part In-Active it throws an exception. otherwise if it doesn’t find it at alll or it finds it Active it deosn’t do anything.
Pre Processsing on ChangePartNum and ChangePartNumMaster should do it.
Well this was interesting. On adding the part the message came up but the exception did not stop the part from getting to the order, so I did a second one on update that will actually stop the add. They are attached.
Only 1 glitch - i can’t import it as were on different versions.
Is there any chance you can send me screenshots of what you’ve done to get this working?
Just having a practice on a data directive…the below works to a point but it errors on EVERY part i type in, in-active or not.
It is also extremely slow when you click save.
Here is the ABL code I used. It is essentially what you came up with.
In Salesorder.Update.
/* check Inactive */
define variable Msg as character init ''.
For each ttOrderDtl.
For each Part where ttOrderDtl.Company = Part.Company and ttOrderDtl.Partnum = Part.Partnum no-lock.
If Part.Inactive = True Then Do:
Msg = "Part is Inactive, Cannot be added".
{lib/PublishEx.i &ExMsg = Msg &ExType = {&MESSAGE_ERR}}.
End.
End.
End.
In Sales Order.ChangePartNumMaster
/* check Inactive */
define variable Msg as character init ''.
For each ttOrderDtl where PartNum = ttOrderDtl.PartNum.
For each Part where ttOrderDtl.Company = Part.Company and ttOrderDtl.Partnum = Part.Partnum no-lock.
If Part.Inactive = True Then Do:
ttOrderDtl.PartNum = ''.
PartNum = ''.
Msg = "Part is Inactive, Cannot be added".
{lib/PublishEx.i &ExMsg = Msg &ExType = {&MESSAGE_ERR}}.
End.
End.
End.
but i’m just wondering - will this work for intercompany transactions?..as these are not entered via a processor, they are pulled through the intercompany process and auto generated.
You can test it and see if it works, and you can also make BPM available to all the companies so no inactive parts come through via inter company process
Any reason why you would not want to put the inactive part on hold with a relevant on hold reason? This would achieve the same thing using core system functionality - can’t sell the part, stops you releasing jobs and shipping the part - you could create a specific on hold code.
All you would then need to do is write a simple bpm that when you make the part inactive it sets it to the correct on hold code.