Setting Expiry Date on Work Order output item(s)  Topic is solved

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

Setting Expiry Date on Work Order output item(s)

Postby DannyC » Wed Jul 08, 2026 4:35 pm

I've got a little plugin to write that needs to set a Work Order output item, set to Use Expiry Dates, as 5 months from production date.

I can get to the output item object via
JiwaFinancials.Jiwa.JiwaBillOfMaterials.WorkOrder.OutputItem myOutputItem

but I can't find the Expiry Date property to set it.
Not in JiwaFinancials.Jiwa.JiwaBillOfMaterials.WorkOrder.OutputItem and also not in
myOutputItem.LineDetails.

Where is it?
User avatar
DannyC
Senpai
Senpai
 
Posts: 736
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 32

Re: Setting Expiry Date on Work Order output item(s)

Postby Mike.Sheen » Wed Jul 08, 2026 4:39 pm

DannyC wrote:but I can't find the Expiry Date property to set it.
Not in JiwaFinancials.Jiwa.JiwaBillOfMaterials.WorkOrder.OutputItem and also not in
myOutputItem.LineDetails.

Where is it?


It is in the LineDetail - myOutputItem.LineDetails is a collection of LineDetail - each one of those has an ExpiryDate, SerialNo, Bin Location property, and so on.
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: 2608
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 818

Re: Setting Expiry Date on Work Order output item(s)

Postby DannyC » Wed Jul 08, 2026 4:56 pm

I thought so.

But I can't iterate through the LineDetails collection.

Normally I'd write something like
Code: Select all
foreach(objectType myLineDetail in outputItem.LineDetails)
{
      //do something
}

but I can't work out what the objectType should be.
User avatar
DannyC
Senpai
Senpai
 
Posts: 736
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 32

Re: Setting Expiry Date on Work Order output item(s)  Topic is solved

Postby Mike.Sheen » Wed Jul 08, 2026 5:01 pm

DannyC wrote:I thought so.

But I can't iterate through the LineDetails collection.

Normally I'd write something like
Code: Select all
foreach(objectType myLineDetail in outputItem.LineDetails)
{
      //do something
}

but I can't work out what the objectType should be.


It's an implementation of the IJiwaSOHConsumer - so for WorkOrders it would be something like:
Code: Select all
foreach(JiwaFinancials.Jiwa.JiwaApplication.Inventory.SOH.LineDetail<JiwaFinancials.Jiwa.JiwaBillOfMaterials.WorkOrder.OutputItem> myLineDetail in outputItem.LineDetails)
{
      //do something
}
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: 2608
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 818

Re: Setting Expiry Date on Work Order output item(s)

Postby DannyC » Wed Jul 08, 2026 5:32 pm

Righto.
No wonder I couldn't find it. Not a syntax I'm familiar with.

Appreciate that Mike, got it working.
User avatar
DannyC
Senpai
Senpai
 
Posts: 736
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 32

Re: Setting Expiry Date on Work Order output item(s)

Postby Mike.Sheen » Wed Jul 08, 2026 5:50 pm

DannyC wrote:Not a syntax I'm familiar with.


Yeah, it's something we introduced with Work Orders and now a few other places use it now, too.

It lets us have a single, central way of performing stock operations - our Work Order Input and Outputs both implement the interface, and as a result they don't need to know how to get or create stock or manage the line details holding tables needed until activation / processing.

For an Input Item, it just needs to set the TotalQuantity property of its LineDetails property, and all the FIFO stock logic and all that magic is handled automatically - we're not re-inventing things for each module wanting to interact with the stock. Same goes with output items - the updating and inserting of stock is all handled through that interface.
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: 2608
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 818


Return to Technical and or Programming

Who is online

Users browsing this forum: Baidu [Spider] and 9 guests