Bypassing Credit Hold Message in Client

I have a client tool customization that does work connecting drop ship SO’s to PO’s. It sometimes updates the supplier on the SO. When a customer is on credit hold it will present that message on the screen during every iteration when it opens the SO dataset.

I saw this post but it applies to a BPM.

Disable Credit Hold Message - Epicor User Help Forum (epiusers.help)

How do I go about clearing out the cCreditLimitMessage argument in client code in the commented example below?

	private void updateSOSupplier(int orderNum, int orderLine, int orderRelNum, int vendorNum, bool update)
	{
		bool morePages = false;
		SalesOrderAdapter adpSalesOrder = new SalesOrderAdapter(oTrans);
		adpSalesOrder.BOConnect();
		string wc = string.Format("OrderNum={0}", orderNum);
		string wc2 = string.Format("OrderLine={0} AND OrderRelNum = {1}", orderLine, orderRelNum);
		System.Collections.Hashtable wcs = new Hashtable(1);
        wcs.Add("OrderHed", wc);
        wcs.Add("OrderRel", wc2);        
		Ice.Lib.Searches.SearchOptions searchOpts = Ice.Lib.Searches.SearchOptions.CreateRuntimeSearch(wcs, Ice.Lib.Searches.DataSetMode.RowsDataSet);
		//string custID = "10000";
		//string cAgingMessage = "";
		//bool lCustomerAllowed = false;
		//adpSalesOrder.CheckCustOnCreditHold(orderNum, custID, out cAgingMessage, out lCustomerAllowed);
        adpSalesOrder.InvokeSearch(searchOpts);
		if(adpSalesOrder.SalesOrderData.Tables["OrderRel"].Rows.Count > 0)
		{
			if(update == true)
			{
				adpSalesOrder.SalesOrderData.OrderRel[0]["VendorNum"] = vendorNum;
				adpSalesOrder.Update();
				logSB.AppendLine("Updated Supplier on SO Release:" +cm+cm+cm+cm+cm+cm+ orderNum.ToString() +cm+cm+cm+ getVendorID(vendorNum));
			}
		}
		else
		{
			MessageBox.Show("SO Release " + orderNum.ToString() + "/" + orderLine.ToString() + "/" + orderRelNum.ToString() + " does not exist.");
		}
		adpSalesOrder.Dispose();
	}

I am just looking to bypass the credit hold message in the client code as it iterates through the grid. Or is it easier to just write something to a BPM context field during the iteration and use that as a condition to trigger the BPM approach?

Thanks for any ideas,
Ross

1 Like

I am not an expert, but I would think you can use that post that you linked to, create the BPM and then use something like the context field to trigger the BPM only when that context field was set by your code.

Unless you were going to handle the adapter methods in your code (SalesOrder.OnChangeOfSoldToCreditCheck- when creating a new order and
SalesOrder.CheckCustOnCreditHold -when retreiving an existing order), that might be the only way.

Yes, that is what I just did in PO entry, to suppress a similar message where I was setting the due date on the PO Header - if it was blank when approved.

Ref some screenshots of the highlights below but…TBD if same principle will apply to your case:
image
image
image

Thanks, guys. I will give this a try and see if it works for me.

Ross