Launch the Call Log from Case customization?

Hey,

Anyone launched the Call Log Entry from a customization?

All my info getting to the assignment to lfoDict (case number, task sequence, etc.) is good, but I’m not getting the arguments passed in correctly.

The call log entry launches, but gets an error on a malformed whereclause in CRMCall GetRows:

Server Side Exception

A server error occurred. Review the server event logs for details.

Exception caught in: Epicor.ServiceModel

Client Stack Trace

at Epicor.ServiceModel.Channels.ImplBase`1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets)
at Erp.Proxy.BO.CRMCallImpl.GetRows(String whereClauseCRMCall, String whereClauseCRMCallAttch, String whereClauseCRMCallCnt, String whereClauseCRMCallHistory, Int32 pageSize, Int32 absolutePage, Boolean& morePages)
at Erp.Adapters.CRMCallAdapter.OnGetRows(SearchOptions opts, Boolean& MorePages, String[] whereClauses)
at Ice.Lib.Framework.EpiBaseAdapter.GetRows(SearchOptions opts, Boolean& morePages)

The call log screen displays after the error, but it’s empty.

Here’s the customization code:

string taskSeqNum = this.grdOVTask.ActiveRow.Cells["TaskSetSeq"].Value.ToString();

if(edvHDCase != null && edvHDCase.SelectedRow != null && 
				!String.IsNullOrEmpty(edvHDCase.SelectedRow["HDCaseNum"].ToString()) && taskSeqNum != "0")
{
				string hdCaseNum = edvHDCase.SelectedRow["HDCaseNum"].ToString();
				string custNum = edvHDCase.SelectedRow["CustNum"].ToString();
				string custName = edvHDCase.SelectedRow["CustomerName"].ToString();

				Dictionary<String, String> lfoDict = new Dictionary<String, String>();

				lfoDict["Key1"] = "HDCase";
				lfoDict["CallCustNum"] = custNum;
				lfoDict["CallCustomerName"] = custName;
				lfoDict["Key2"] = hdCaseNum;
				lfoDict["Key3"] = taskSeqNum;
				lfoDict["RelatedToFile"] = "TASK";

				//string[] valueIn = {"HDCase", custNum, custName, hdCaseNum, taskSeqNum, "task"}; // tried this a couple of ways with a dictionary and a string array
																																																// “the internet” said they might be in this order
				LaunchFormOptions lfo = new LaunchFormOptions();
				//lfo.ContextValue = lfoDict;
				lfo.ValueIn = lfoDict;
				//lfo.ValueIn = valueIn;
				ProcessCaller.LaunchForm(oTrans, "CRGO6100", lfo); 

}

Below are portions of the trace from running the call log from the standard Task Detail sheet and from a button on the custom sheet.

Good trace run from Task Detail sheet:

<tracePacket>
  <businessObject>Erp.Proxy.BO.CRMCallImpl</businessObject>
  <methodName>GetRows</methodName>
  <appServerUri>net.tcp://dnp-paepiapp/ERP10V/</appServerUri>
  <returnType>Erp.Tablesets.CRMCallTableset</returnType>
  <localTime>10/15/2019 17:23:57:6632783 PM</localTime>
  <threadID>1</threadID>
  <executionTime total="4485" roundTrip="718" channel="0" bpm="3734" other="33" />
  <retries>0</retries>
  <parameters>
    **<parameter name="whereClauseCRMCall" type="System.String"><![CDATA[RelatedToFile = 'task' AND Key1 = 'HDCase' AND Key2 = '90600' AND Key3 = '20'  BY CRMCall.OrigDate DESC, CRMCall.OrigTime DESC]]>**</parameter>

Bad trace run from custom sheet:

<tracePacket>
  <businessObject>Erp.Proxy.BO.CRMCallImpl</businessObject>
  <methodName>GetRows</methodName>
  <appServerUri>net.tcp://dnp-paepiapp/ERP10V/</appServerUri>
  <returnType>Erp.Tablesets.CRMCallTableset</returnType>
  <localTime>10/15/2019 17:26:45:6667592 PM</localTime>
  <threadID>1</threadID>
  <executionTime total="154" roundTrip="152" channel="0" bpm="0" other="2" />
  <retries>0</retries>
  <parameters>
    **<parameter name="whereClauseCRMCall" type="System.String"><![CDATA[(RelatedToFile = 'customer' AND Key1 = '' AND Key2 = '' AND Key3 = '')  OR ( CallCustNum = )  BY CRMCall.OrigDate DESC, CRMCall.OrigTime DESC]]></parameter>**

There are oTrans methods for lots of the actions in Case Entry, but not for the call log. In developer mode one hits this customization prompt for menu CRGO6100 (from standard or custom buttons):

Any ideas?

Thanks,

Joe

This is the key part of the code we use:

Erp.UI.App.CRMCallEntry.CRMCallArgs callargs = new Erp.UI.App.CRMCallEntry.CRMCallArgs(
					row["CRMCall_RelatedToFile"].ToString(),
					row["CRMCall_Key1"].ToString(),
					row["CRMCall_Key2"].ToString(),
					row["CRMCall_Key3"].ToString(),
					row["CRMCall_CallSeqNum"].ToString(),
					row["Customer_CustID"].ToString()
					);
ProcessCaller.LaunchCallbackForm(oTrans, menuID, callargs);
2 Likes

Thanks, Daryl. I’ll check it out.

Joe

I never understood how to open this form correctly, thank you very much for posting your code!

1 Like

Daryl,

Thanks! That got me where I needed to go.

The one thing I haven’t figured out is how to launch the form like it’s done on the Case Entry Task Maintenance screen. When you click the log button you get all the current calls for the task in the log maintenance screen. Here’s the whereclause going into the maintenance:

RelatedToFile = ‘task’ AND Key1 = ‘HDCase’ AND Key2 = ‘90600’ AND Key3 = ‘20’ BY CRMCall.OrigDate DESC, CRMCall.OrigTime DESC

Note that there is no CallSeqNum in the whereclause.

If I pass “0” in the CallSeqNum the whereclause is:

RelatedToFile = ‘task’ AND Key1 = ‘HDCase’ AND Key2 = ‘90600’ AND Key3 = ‘20’ AND CallSeqNum = ‘0’ BY CRMCall.OrigDate DESC, CRMCall.OrigTime DESC

So no existing calls show up. That’s okay, because what I need to do is enter a new call, anyway. And if I create a new record it has the case number, task sequence, etc. so the record gets saved correctly.

The form takes exactly five arguments, so I can’t just leave it out.

I could change the whereclause with a BPM if I needed to, I suppose. Maybe I will one day.

Thanks again.

Joe

That hasn’t arisen as a requirement for us so I’m afraid I can’t shed any light on it.

We use call logs a lot, but by now most places where they’re used most heavily we have grids of the calls directly in the screen. That saves them being opened as much anyway. The code above is for the back-up where users do want to open the call in the original form, and obviously for us that’s always a single call.