Auto increment a UD field on LaborDtl

Also I didn’t add any using statements in for any of this. Just the references.

Can you save with the enabled unchecked? After you do that, export the BPM and post it please.

working fine for me 10.2.400.8

I am on running version 10.1.500.9

I don’t seem to have export as an option? actions is grayed out…

if i am not wrong in 10.1
Ice.Lib.NextValue(Db).GetNextSequence was different.

let me see my old code somewhere

AK_labordtl.bpm (65.6 KB)

This doesn’t have the “usings” code in it, but had the same error with or without

So I brought it into my system, changed the fields to the ones that I added, and it works fine. Looks to me like it must be a version thing. Bummer. Looks like you might have to do this manually.

dang…ok, maybe i will look back at some of the UD Code options then as there are a lot of threads that point to timshuwy’s posts…I couldn’t get it to work before but I will go that path and see where I get to.

Can’t thank you enough for your time today @Banderson, really appreciate the help!

If you gonna manually insert might as well use the right table
So if you go the manual route BC of the bug still write it in the Sequence table

As in have a BPM fire that throws the current sequence number into the table when it gets entered?

Right and reads it from there…

It looks like that table is going to be pretty hard to get to. I think @jeowings suggestion with the UD table is going to be a better option for this. You’re going to have to do the lookup, then increment one, set your field, and update the row in the UD table. Like Josh mentioned, you also get the benefit of a table that’s easier to get to.

Hold that thought…@surendrapal was able to get me almost to where i want to be, we have the number writing and incrementing, but its going up in 3’s so just have to figure out the loop…Once we have it figured out (and lets be honest when I say we, I mean @surendrapal) we can post the solution…looks like we can work around the bug…

Stay tuned! (and thanks again for everyone’s input/help. Can’t tell you how much the forum helps me figure stuff out!)

1 Like

i advice to check what happens to the sequence when End Activity

use below code

note add reference :-- Ice.Lib.NextValue

foreach(var ttLaborDtl_xRow in (from row in  ttLaborDtl where row.Company == Session.CompanyID && row.IWR_Num_c == 0 &&  row.EmpCB4_c  select row))
{
	var nextNumber = Convert.ToInt32(new Ice.Lib.NextValue(Db).GetNextSequence("IWRNum").ToString("00000"));
	ttLaborDtl_xRow.IWR_Num_c = nextNumber;
	callContextBpmData.Checkbox01 = true;
	callContextBpmData.Number01 = nextNumber;
}
2 Likes

Surendra to the rescue (not the first time I have typed that). Fine tuning the final result (after the inspection department has their input as no one is every happy ha ha) but this was exactly what I needed. We also added a condition after the code to show a pop up message which tells the user which number as been applied…

As usual Surendra really went out of his way to solve this with me…for me…he solved it for me, I wasn’t any help ha ha

3 Likes