I am writing some auto-numbering BPM’s for ID’s and have inconsistent behavior. For customers, ship to’s and vendors everything works fine. For parts, the following will not populate the partnum field.
var part_row = (from partrow in ds.Part where partrow.Company == Session.CompanyID && partrow.RowMod == “A” select partrow).FirstOrDefault();
if(part_row != null)
{
part_row.PartNum = “test”;
}
However, if I change:
part_row.PartNum = “test”;
to
part_row.PartDescription = “test”;
…it will populate the Part description box.
When I run trace log the auto number is in the trace data but it doesn’t show up in the ProposedPartNum argument. It does appear there when you create a part through the interface.
What am I missing? Is there a different field used for new part numbers?
I tried it and it does the same thing. It doesn’t carry through to the field on the screen. I have tried it via temp table and direct and they both behave the same way.
Consider setting the fields to something like in your post Get new methods and then handle the assignment of the sequence on the Pre Update.
Otherwise when two users press get new before save you get a duplicate error, or missing sequences.
Good point Stephen,
We’ve handled this before by using a SQL Sequence and calling it via the Db.ExecuteQuery, only downside is that if you click “GetNew” and never save you “lose” that sequence
Yes it is on my todo list to raise with the ICE framework team.
Ideally in Extended Prooerties one could specify a filed is auto sequenced and choose the sequence control definition…
Thanks, Jose. It is always nice to see alternatives.
I am puzzled. Maybe it is a version bug? When I paste this in to a Part.GetNewPart POST directive it behaves the same way as all the other attempts. No PartNum.
I will keep working on it but the fact that it works with PartDescription and not PartNum leaves me scratching my head.
The code I posted works n 10.0.X and 10.1.X
It runs on post on get newpart bpm.
It should work out of the box…
I tested it and works fine on 10.1.400.18