Next Lot Button on Receive Detail

Hello All,

I was trying to figure out how to suppress the “Are you sure you wish to create a new lot” message for a few different forms. In other cases I have been able to tap into the method directive and change the value of the message param when the message is “Are you sure you want to…”

I am able to do it this way, via a BPM, on receipt detail if the user types in a new lot into the text box, but if they click the next lot message I don’t see any method calls as a result, just a message that immediately pops up AND THEN there are method calls.

I am thinking I will have to do some customization on the form then? Anyone else getting this behavior (no method calls as a result of clicking the button)?

image

I have seen that before with some buttons.
One thought, if they are not going to be using the Next Lot button, you could put it behind something and disable it.
BTW I think if they type in a new lot number and then save the record (method call) it will still popup the message, but I don’t know if that’s coming from the UI or the method. If it’s the method then you should be able to suppress it as you did before. If it’s the UI still, well yeah not sure how to do that.

Thanks Rick, yeah I am not great with UI adapter manipulation.

I am able to suppress it if they type it in, but not if they use the button. I am not sure they are even using that button so maybe disabling it is an option, thanks for the thought.

-Utah

@Rick_Bird ,

I found that the button launches the “Do you want to create a new lot?” message right away and if you click yes, then it launches the Erp.LotSelectUpdate.GenerateNewLotNum method.

I created a new custom button that calls that exact same method and then I set the lot number on the receipt line with the out param from the method.

I also had to write a BPM on Erp.Receipt.CheckDtlLotInfo that handles the error message of “Do you wish to create a new lot?” by first checking if that is the error messsage and if it is, then set the error message to “”, in which case the message doesn’t pop up (as seen in traces where an existing lot is used).

Here is the code on the form that is called when the custom “Next Lot” button is clicked.

private void CallLotSelectUpdateAdapterGenerateNewLotNumMethod()
{
try
{
// Declare and Initialize EpiDataView Variables
EpiDataView edvRcvDtl = ((EpiDataView)(this.oTrans.EpiDataViews[“RcvDtl”]));

  	// Check if valid EpiDataView Row(s) are selected
  	if ((edvRcvDtl.Row < 0))
  	{
  		return;
  	}

  	// Declare and create an instance of the Adapter.
  	LotSelectUpdateAdapter adapterLotSelectUpdate = new LotSelectUpdateAdapter(this.oTrans);
  	adapterLotSelectUpdate.BOConnect();

  	// Declare and Initialize Variables
  	// TODO: You may need to replace the default initialization with valid values as required for the BL method call.
  	string vPartNum = ((string)(edvRcvDtl.dataView[edvRcvDtl.Row]["PartNum"]));
  	string vNewLotNum = String.Empty;
  	//EpiMessageBox.Show(vPartNum.ToString());
  	// Call Adapter method
  	bool result = adapterLotSelectUpdate.GenerateNewLotNum(vPartNum, out vNewLotNum);
  	//EpiMessageBox.Show(vNewLotNum.ToString());
  	/*Begin Lot Num Update*/
  	System.Data.DataRow edvRcvDtlRow = edvRcvDtl.CurrentDataRow;
  	if(edvRcvDtl != null)
  		{
  			edvRcvDtlRow.BeginEdit();
  			edvRcvDtlRow["LotNum"] = vNewLotNum;
  			edvRcvDtlRow.EndEdit();
  		}
  	// Cleanup Adapter Reference
  	adapterLotSelectUpdate.Dispose();

  } catch (System.Exception ex)
  {
  	ExceptionBox.Show(ex);
  }

}

1 Like

Nicely done… and thanks for adding your solution to the community!