First value on report is 0

I have a report which displays the following info and works fine. (these fields are all from ItemLedgerEntry.

Pallet No, Box No, Item No, Item Desc, Item Weight.

Pallet1, Box1, Item1, Item1Desc, 20kg

Pallet1, Box2, Item1, Item1Desc, 20kg

etc.

I want to add a field that has the number of pieces in each box.

I have link the field “box no” between ItemLedgerEntry and another table “Trade Items” and I’ve added in the “Pieces” field.

And it’s worked, however… my results look like this…

Pallet No, Box No, Item No, Item Desc, Pieces, Item Weight

Pallet1, Box1, Item1, Item1Desc, 0, 20kg

Pallet1, Box2, Item1, Item1Desc, 9, 20kg

Pallet1, Box3, Item1, Item1Desc, 9, 20kg

For some reason the “Pieces” the very first record always displays 0, (if I look at the data it says “9” pieces for Box1). I can’t fathom out why it’s not populating the first record correctly, but does populate the subsequent ones correctly.

I feel I’m probably making some kind of rookie mistake here, can anyone please advise?

Hi Dougie,

try a calcfields(pieces) in the OnAfterGetrRcordTrigger

Regards,

Jan

Hi,

Thanks for your suggestions, sadly pieces not a flow field, so throws an error if I do a calcfields on it. However I may be able to define the issue better. So if my boxes were like this…

Reality

Pallet , Box , BoxDesc, Pieces, Weight

Pallet 1, Box1, Box1Desc, 1 , 20kg

Pallet 1, Box2, Box2Desc, 2, 20kg

Pallet 1, Box3. Box3Desc, 3 , 20kg

What Report Shows

Pallet , Box , BoxDesc, Pieces, Weight

Pallet 1, Box1, Box1Desc, 0 , 20kg

Pallet 1, Box2, Box2Desc, 1, 20kg

Pallet 1, Box3. Box3Desc, 2 , 20kg

It is like the pieces on the report are “out of sync” with what they should be.

Thanks

Dougie

Or to be clearer: it shows the number of pieces for the box before, rather than the value for that box.