Unpick Transaction BO

I’m curious if anyone has experience with the unpick transaction BO. Looking at the documentation, it looks a little unclear about how to use it exactly how to use it, especially with where the UnpickTransactionTableSet comes from.

While I’ve never used it, I am sure I can make sense of the code. Do you have any specific questions?

It looks like you’ll use:

using Erp.Tablesets;
//if its not an adapter, create your own TS  to work with 
UnpickTransactionTableset myDS = new UnpickTransactionTableset()

public void GetNewUnpickTransaction(string ipType, ref UnpickTransactionTableset ds)
//make some changes to part, etc and be sure to call the update funcs like -
public void ChangePartNum(string ipProposedValue, ref UnpickTransactionTableset ds)
//there are some helper funcs to get relevant data, like whats allocated, etc
public void PreUnpickTransaction(ref UnpickTransactionTableset ds, out string msg) //validate b4 changes
public void _UnpickTransaction(ref UnpickTransactionTableset ds) //unpick, updates PartAlloc if a TransOrder, otherwise updates PickedOrders for SO

With all that said, I have no clue how to use it :stuck_out_tongue: Please share your findings!

Thanks Chris! I was doing a bunch of work on it today and I’m really close to an answer. I’ll post tomorrow if I get it. It’s kind of a special use case but interesting nonetheless

Old post but I wanted to update. I ended up not using the unpick transaction bo, as it wasn’t necessary to perform the “unpick” of the sales order line release.
I’m still not entirely sure what it’s used for but the Issue Return BO is the one actually doing the work.

private void UnpickSalesOrder(UltraGridRow row)
{
	if((bool)row.Cells["Allocate"].Value)
	{			
		try
		{
			//MessageBox.Show(row.Cells["PartAlloc_OrderNum"].Value.ToString());
			/*Local Variables*/				
			bool userInput = false;
			string legalNumberMsg = string.Empty;
			string partTranPKs = string.Empty;
			
			/*Instantiate IssueReturn*/
			IssueReturnAdapter adapterIssueReturn = new IssueReturnAdapter(oTrans);				
	
			/*Connect to adapters*/
			adapterIssueReturn.BOConnect();			
		
			/*Call Issue Return*/
			adapterIssueReturn.GetNewIssueReturn("STK-STK", Guid.Empty, "Unpick");

			//set adapterIssueReturn fields here			
			adapterIssueReturn.IssueReturnData.IssueReturn[0].TranQty = 1;
			adapterIssueReturn.IssueReturnData.IssueReturn[0].PartNum= (string)row.Cells["PartBin_PartNum"].Value;
			adapterIssueReturn.IssueReturnData.IssueReturn[0].LotNum= (string)row.Cells["PartBin_LotNum"].Value;
			adapterIssueReturn.IssueReturnData.IssueReturn[0].OrderNum = (int)row.Cells["PartAlloc_OrderNum"].Value;
			adapterIssueReturn.IssueReturnData.IssueReturn[0].OrderLine = (int)row.Cells["PartAlloc_OrderLine"].Value;
			adapterIssueReturn.IssueReturnData.IssueReturn[0].OrderRel = (int)row.Cells["PartAlloc_OrderRelNum"].Value;
			adapterIssueReturn.IssueReturnData.IssueReturn[0].FromWarehouseCode = (string)row.Cells["PartBin_WarehouseCode"].Value;
			adapterIssueReturn.IssueReturnData.IssueReturn[0].FromBinNum = (string)row.Cells["PartBin_BinNum"].Value;
			adapterIssueReturn.IssueReturnData.IssueReturn[0].ToWarehouseCode = (string)row.Cells["PartBin_WarehouseCode"].Value;
			adapterIssueReturn.IssueReturnData.IssueReturn[0].ToBinNum = (string)row.Cells["PartBin_BinNum"].Value;
			adapterIssueReturn.IssueReturnData.IssueReturn[0].UM = "EA";

			/*Call Issue Return*/
			adapterIssueReturn.PrePerformMaterialMovement(out userInput);								
			adapterIssueReturn.PerformMaterialMovement(false, out legalNumberMsg, out partTranPKs);
	
			/*Cleanup adapters*/
			adapterIssueReturn.Dispose();

		}
		catch(Exception ex)
		{
			MessageBox.Show(ex.Message.ToString() + "\r\n" + ex.InnerException.ToString());
		}
	}
}
2 Likes