Page 1 of 1

Shipment fields UserField1 to UserField10

PostPosted: Tue Feb 22, 2022 4:03 pm
by DannyC
In the Jiwa GUI, shipment lines have fields UserField1 through to UserField10.

In a plugin, I want to read and write to them.

I have
Code: Select all
foreach (JiwaFinancials.Jiwa.JiwaLandedCost.ShipmentLine shipLine in shipment.Lines)
{
   shipLine.UserField1;  //nope!
}

But I can't see any property in shipLine for the user fields. Am I missing something?

Re: Shipment fields UserField1 to UserField10

PostPosted: Tue Feb 22, 2022 5:44 pm
by Mike.Sheen
UserField1... UserField10 ARE properties of the shipment line.

The code fragment you provided isn't technically valid as you're just referring to the property and not assigning or doing anything with it.

Attached is a plugin which displays in a messagebox the contents of UserField1 of each shipment line if it not blank, when a shipment is read.

This works for me - after importing the plugin (and logging out and back in), when I edit a shipment to set the UserField1 on any shipment and save, when it is re-read it displays the value.

Maybe your problem is related to the version of Jiwa you are using? I tested with 7.2.1 SR9.

Re: Shipment fields UserField1 to UserField10  Topic is solved

PostPosted: Wed Feb 23, 2022 8:05 am
by DannyC
The code fragment you provided isn't technically valid as you're just referring to the property and not assigning or doing anything with it.


Quite right. What I was doing was just using intellisense to look through all the properties, methods etc (the stuff that gets listed when you click the dot). And I didn't see UserFieldnn. And then I decided to dig around a bit and find out why I couldn't see it. By the time I verified that, yep I really can't see those fields, I posted this. But I forgot to make the code nicer by doing something like a messagebox.

Your code is basically the same as mine and yes I am using 7.2.1 SR8.
Maybe if I just type in the properties it will work anyway - could it just be an intellisense thing? BTW, this is in the plugin editor, not VS.

EDIT: So it's not an intellisense thing, because I can see them in your plugin when I click the dot.
I'll just keep looking to see where my plugin is failing. Thanks for confirming that at least I know those fields are there.

EDIT2: Found it.
So, what I was doing was
Code: Select all
foreach (JiwaFinancials.Jiwa.JiwaLandedCost.shipmentline shipLine in shipment.Lines)

but your code has
Code: Select all
foreach (JiwaFinancials.Jiwa.JiwaLandedCost.Shipment.Line shipLine in shipment.Lines)

Can I ask, why have a JiwaFinancials.Jiwa.JiwaLandedCost.shipmentline?

Re: Shipment fields UserField1 to UserField10

PostPosted: Wed Feb 23, 2022 10:57 am
by Mike.Sheen
DannyC wrote:Can I ask, why have a JiwaFinancials.Jiwa.JiwaLandedCost.shipmentline?


That's a bug / oversight. That class is used by the shipment BookIn business logic - it's a representation of a shipment line which is a property of the BookIn line. It's how we associate a BookIn line to a shipment line in the business logic.

Logged DEV-9209 to address this.