Page 1 of 1

Setting Expiry Date on Work Order output item(s)

PostPosted: Wed Jul 08, 2026 4:35 pm
by DannyC
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?

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

PostPosted: Wed Jul 08, 2026 4:39 pm
by Mike.Sheen
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.

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

PostPosted: Wed Jul 08, 2026 4:56 pm
by DannyC
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.

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

PostPosted: Wed Jul 08, 2026 5:01 pm
by Mike.Sheen
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
}

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

PostPosted: Wed Jul 08, 2026 5:32 pm
by DannyC
Righto.
No wonder I couldn't find it. Not a syntax I'm familiar with.

Appreciate that Mike, got it working.

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

PostPosted: Wed Jul 08, 2026 5:50 pm
by Mike.Sheen
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.