Shipment fields UserField1 to UserField10  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Shipment fields UserField1 to UserField10

Postby DannyC » Tue Feb 22, 2022 4:03 pm

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?
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Shipment fields UserField1 to UserField10

Postby Mike.Sheen » Tue Feb 22, 2022 5:44 pm

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.
Attachments
Plugin ShipmentLine UserField1.xml
(7.04 KiB) Downloaded 734 times
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Shipment fields UserField1 to UserField10  Topic is solved

Postby DannyC » Wed Feb 23, 2022 8:05 am

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?
User avatar
DannyC
Senpai
Senpai
 
Posts: 718
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 31

Re: Shipment fields UserField1 to UserField10

Postby Mike.Sheen » Wed Feb 23, 2022 10:57 am

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.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 6 guests