Update Material Queue Seq Qty after inventory transfer

Im trying to do a customization to where we can do a partial processing of a material queue sequence. When a part is received a PUR-STK transaction is created. But we may need to ship some of these out instead of put up. so we might need to do multiple transfers.

Thought a good way to do this would be to do an inventory transfer with the mtl queue sequence as the reference and then do a bpm to subtract that transferred qty from that sequnce once a transfer was made.

most of it is working except I cannot seem to update the mtl que seq qty.

Below is the code im using within the Erp.BO.InvTransfer.CommitTransfer method directive. If I do a RowMod of == “U” I get an odd error message. ill post that in the next window

var transfer = ds.InvTrans.Where((x)=> x.RowMod == “”).FirstOrDefault(); // get tranfer row

if(transfer != null)
{

// check to make sure reference is the mtlq seq
var partial_mtlqueue_move = (from mtlq in Db.MtlQueue
                             where mtlq.MtlQueueSeq.ToString() == transfer.TranReference
                             select mtlq).FirstOrDefault();
                             
 
 if(partial_mtlqueue_move != null)
 {
      
      decimal new_qty = partial_mtlqueue_move.Quantity - transfer.TransferQty;    // qty to remove from the mtlq seq due to the partial move
      
      var MaterialQueueSvc = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.MaterialQueueSvcContract>(Db);   // connect to service Requires Erp.Contracts.BO.MaterialQueue assembly
      var MaterialQueueDs = new Erp.Tablesets.MaterialQueueTableset();                                                // create dataset
      
      MaterialQueueDs = MaterialQueueSvc.GetByID(partial_mtlqueue_move.MtlQueueSeq);
      MaterialQueueDs.MtlQueue[0].Quantity = new_qty;
      MaterialQueueSvc.Update(ref MaterialQueueDs);
      
      
}

}

error message if I do RowMod = U to trigger the update

System Information

==================

AppServer Connection: https://epicor.leeboy.com/KineticERPPilot
Form Name: Inventory Transfer
Customization Name: VTLB_InvTransfer_07_08_16
Menu ID: IMGO3008
Software Version: 11.1.200.0

============

Business Layer Exception

Requested by is required.
Supply Job is required.
Supply Asm is required.
Supplier Number is required.
Pack ID is required.
Order is required.
Line is required.
Rel is required.
Description is required.
PO is required.
PO Line is required.
PO Release is required.
RMA is required.
RMA Line is required.
Rcv is required.

Exception caught in: Epicor.ServiceModel

Error Detail

============

##!Correlation ID:##! bc23de1b-4e55-475b-a775-ce6253fff7e0
##!Message No.:##! 1
##!Description:##! Requested by is required.
##!Program:##! Epicor.Ice.dll
##!Method:##! ValidateColumn
##!Line Number:##! 251
##!Column Number:##! 17
##!Table:##! MtlQueue
##!Field:##! RequestedByEmpID
##!Message No.:##! 2
##!Description:##! Supply Job is required.
##!Program:##! Epicor.Ice.dll
##!Method:##! ValidateColumn
##!Line Number:##! 251
##!Column Number:##! 17
##!Table:##! MtlQueue
##!Field:##! JobNum
##!Message No.:##! 3
##!Description:##! Supply Asm is required.
##!Program:##! Epicor.Ice.dll
##!Method:##! ValidateColumn
##!Line Number:##! 251
##!Column Number:##! 17
##!Table:##! MtlQueue
##!Field:##! AssemblySeq
##!Message No.:##! 4
##!Description:##! Supplier Number is required.
##!Program:##! Epicor.Ice.dll
##!Method:##! ValidateColumn
##!Line Number:##! 251
##!Column Number:##! 17
##!Table:##! MtlQueue
##!Field:##! VendorNum
##!Message No.:##! 5
##!Description:##! Pack ID is required.
##!Program:##! Epicor.Ice.dll
##!Method:##! ValidateColumn
##!Line Number:##! 251
##!Column Number:##! 17
##!Table:##! MtlQueue
##!Field:##! PackSlip
##!Message No.:##! 6
##!Description:##! Order is required.
##!Program:##! Epicor.Ice.dll
##!Method:##! ValidateColumn
##!Line Number:##! 251
##!Column Number:##! 17
##!Table:##! MtlQueue
##!Field:##! OrderNum
##!Message No.:##! 7
##!Description:##! Line is required.
##!Program:##! Epicor.Ice.dll
##!Method:##! ValidateColumn
##!Line Number:##! 251
##!Column Number:##! 17
##!Table:##! MtlQueue
##!Field:##! OrderLine
##!Message No.:##! 8
##!Description:##! Rel is required.
##!Program:##! Epicor.Ice.dll
##!Method:##! ValidateColumn
##!Line Number:##! 251
##!Column Number:##! 17
##!Table:##! MtlQueue
##!Field:##! OrderRelNum
##!Message No.:##! 9
##!Description:##! Description is required.
##!Program:##! Epicor.Ice.dll
##!Method:##! ValidateColumn
##!Line Number:##! 251
##!Column Number:##! 17
##!Table:##! MtlQueue
##!Field:##! PartDescription
##!Message No.:##! 10
##!Description:##! PO is required.
##!Program:##! Epicor.Ice.dll
##!Method:##! ValidateColumn
##!Line Number:##! 251
##!Column Number:##! 17
##!Table:##! MtlQueue
##!Field:##! PONum
##!Message No.:##! 11
##!Description:##! PO Line is required.
##!Program:##! Epicor.Ice.dll
##!Method:##! ValidateColumn
##!Line Number:##! 251
##!Column Number:##! 17
##!Table:##! MtlQueue
##!Field:##! POLine
##!Message No.:##! 12
##!Description:##! PO Release is required.
##!Program:##! Epicor.Ice.dll
##!Method:##! ValidateColumn
##!Line Number:##! 251
##!Column Number:##! 17
##!Table:##! MtlQueue
##!Field:##! PORelNum
##!Message No.:##! 13
##!Description:##! RMA is required.
##!Program:##! Epicor.Ice.dll
##!Method:##! ValidateColumn
##!Line Number:##! 251
##!Column Number:##! 17
##!Table:##! MtlQueue
##!Field:##! RMANum
##!Message No.:##! 14
##!Description:##! RMA Line is required.
##!Program:##! Epicor.Ice.dll
##!Method:##! ValidateColumn
##!Line Number:##! 251
##!Column Number:##! 17
##!Table:##! MtlQueue
##!Field:##! RMALine
##!Message No.:##! 15
##!Description:##! Rcv is required.
##!Program:##! Epicor.Ice.dll
##!Method:##! ValidateColumn
##!Line Number:##! 251
##!Column Number:##! 17
##!Table:##! MtlQueue
##!Field:##! RMADisp

Client Stack Trace

==================
at Epicor.ServiceModel.Channels.ImplBase`1.ShouldRethrowNonRetryableException(Exception ex, DataSet dataSets)
at Erp.Proxy.BO.InvTransferImpl.CommitTransfer(InvTransferDataSet ds, String& LegalNumberMessage, String& partTranPKs)
at Erp.Adapters.InvTransferAdapter.CommitTransfer(String& legalNumberMessage, String& partTranPKs)

so does anyone know how to modified an existing mtlq row?

You should not have to. If you do a proper partial transfer the remaining quantity will be left for another transfer. We are lot tracked and may process one queue several times.

Do a trace of a and see if any other methods are called, but I am assuming some Epimajic happens to update the queue after it is processed.

Thanks for the reply Greg. I didnt realize we could to partials on a mtl queue seq. the warehouse folks were telling me it would go away if processed. but tested and it deducts the qty. so dont need a mod. would be nice to know how to modify the mtl q seq. I couldnt modify the qty within the material queue manager but did trace changing priority or assigning an employee and all it called was update. all of the rowmod’s were blank.

but sounds like i dont need to worry about it. thanks for the help!