UBAQ to Create Requisition

Good afternoon,
I have a form that lists chemicals that are set to expire in the next 90 days. To this dashboard, I added a blank tracker form. I opened the form in customization mode, and added a button to the tracker form. My goal is to have the button pull the part number from the grid’s selected row, and pass that part number into a callcontext field. Once that is done I want my UBAQ custom action to run. My custom action is designed to generate a new requisition head, and detail.

I think the req head is created ok, as I can see a list of the reqs my UBAQ created as I am testing. However the req detail, or req line is not getting created correctly. Instead my BPM gives this error: Requisition for Other is not allowed for a Quantity Bearing Part.

## System Information ##

AppServer Connection: https://centralusdtpilot01.epicorsaas.com/SaaS512Pilot
Form Name: List of expiring chemicals
Customization Name: Custom1
Menu ID: UD4161
Software Version:


Business Layer Exception

Requisition for Other is not allowed for a Quantity Bearing Part.

Exception caught in: Epicor.ServiceModel

## Error Detail ##

##!Correlation ID:##!  828a4bbb-aa8f-4be0-a677-6f521d19dc47
##!Description:##!  Requisition for Other is not allowed for a Quantity Bearing Part.
##!Program:##!  Erp.Services.BO.Req.dll
##!Method:##!  validateTranType
##!Line Number:##!  2628
##!Column Number:##!  29

## Client Stack Trace ##
   at Ice.Cloud.ProxyBase`1.CallWithCommunicationFailureRetry(String methodName, ProxyValuesIn valuesIn, ProxyValuesOut valuesOut, RestRpcValueSerializer serializer)
   at Ice.Cloud.ProxyBase`1.CallWithMultistepBpmHandling(String methodName, ProxyValuesIn valuesIn, ProxyValuesOut valuesOut, Boolean useSparseCopy)
   at Ice.Cloud.ProxyBase`1.Call(String methodName, ProxyValuesIn valuesIn, ProxyValuesOut valuesOut, Boolean useSparseCopy)
   at Ice.Proxy.BO.DynamicQueryImpl.RunCustomAction(DynamicQueryDataSet queryDS, String actionID, DataSet queryResultDataset)
   at Ice.Adapters.DynamicQueryAdapter.<>c__DisplayClass43_0.<RunCustomAction>b__0(DataSet datasetToSend)
   at Ice.Adapters.DynamicQueryAdapter.ProcessUbaqMethod(String methodName, DataSet updatedDS, Func`2 methodExecutor, Boolean refreshQueryResultsDataset)
   at Ice.Adapters.DynamicQueryAdapter.RunCustomAction(DynamicQueryDataSet queryDS, String actionId, DataSet updatedDS, Boolean refreshQueryResultsDataset)

I am using BO method widgets to duplicate the methods I traced from manually creating a requisition and detail line.

I know that I can manually create a req head and line for the part in question. I don’t get any such error when I create it manually.

Has anyone seen this error before? I assume that I am missing something when I setup my requisition line.

Screenshots following show my setup:

// Dashboard customization
private void BAQRunCustomAction(EpiDataView iEdv, string iActionID)
    BAQDataView BAQView = (BAQDataView)iEdv;
    Assembly assembly = Assembly.LoadFrom("Ice.Lib.EpiClientLib.dll");
    Type t = assembly.GetType("Ice.Lib.Framework.BAQUpdater");
    BindingFlags bf = BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy;
    MethodInfo mi = t.GetMethod("BAQRunCustomAction", bf);
    object[] param = new object[] { BAQView, iActionID};
    mi.Invoke("Ice.Lib.Framework.BAQUpdater", param);

	private void btnGenReq_Click(object sender, System.EventArgs args)
		// ** Place Event Handling Code Here **
		//Run Custom Action to generate a new requsition.
		// Pass in part number through call context field.
		EpiDataView edvCallContextBpmData = ((EpiDataView)(this.oTrans.EpiDataViews["CallContextBpmData"]));
		System.Data.DataRow edvCallContextBpmDataRow = edvCallContextBpmData.CurrentDataRow;
		var edvV = oTrans.Factory("V_ExpiringLots_1View");
		edvCallContextBpmDataRow["Character08"] = edvV.dataView[edvV.Row]["PartLot_PartNum"].ToString();
		BAQRunCustomAction(edvV, "GenReq");

@NateS I have not used requisitions, but in reading the schema it looks like it wants TranType set. I know in POs you have inventory, job or other. Look at the trace from the manual and see what TranType is set to.

I see that ReqDetail is setting TranType to “PUR-UKN” in my trace. So I set the same value in my Update Table by Query table Mapping. I still get the same error.

PUR-UNK is Other. Is that on the same part number? I would try all of the PUR- types.

It is on the same part number. I am looking for the tran type listed on the requisition entry form, so that I can see where the transaction types are setup. I don’t know what they other types of transactions are.

I see now. The column is called Type and the values are Inventory, Other, or Material. I have to use Inventory, which is “PUR-STK”.
Thanks for the guidance!!

1 Like

As stated in a related post, I still can’t get my req to be dispatched properly.

In my BPM I use the BO method Req.BuildNextDispatcher. Then I do a Req.Update. But when I look at New PO suggestions, or even in Requisition entry, I can see that the req has not been dispatched. I think I must need to set some additional fields with an Update Table By Query widget before I do the Req.Update. Looking through the traces, I can’t tell exactly which fields are required.

How’s this going?

I started on a similar path this week. I’m trying to recreate Req Entry since its not accessible from DC/MES. (Am I allowed to say that?)

What I assume will be the hard parts are

  1. Attachments (have not even begun to look at that yet)
  2. Dispatching

For the moment, I can’t even figure out how to get a dropdown to work for Dispatcher (user).

The Action dropdown was easy - it’s got it’s own predefined “Reusable Combo.”

But the Dispatcher requires a method to run (BuildNextDispatcher) and I guess it just does not return a list that App Studio likes. I feel like I am failing at the values for “TextField” and “Value Field,” but maybe I’m wrong somewhere else.

Abandoned for now. I also never tried to get it working in Kinetic, which I assume will be even more difficult. Good luck, and please let us know how it goes!

Aw man, not what I wanted to hear.

Of course.

I think I will abandon this also. Two reasons.

  1. Dispatching is just impossible. I explain a little in this post (that you also responded to). There’s no method for it!!! And the trace only gives you false hope that it’s a simple update to ReqHead (nope).
  2. I think this idea is better (OK, easier). Skip reqs and just use POs and buyers.

PO Entry is accessible from MES (Data Collection), if that matters to you (it does to me).

FYI, I did get all of the other pieces working in Kinetic, including file attachments. It was a fun learning experience, and good stuff to know for the future.