I can not setcustomfield using myOutboundRecord.setCustomField(), these codes used to work in 7.6 ocs,
I upgraded our ocs from 7.6 to 8.0, then they don't work in 8.0 ocs.
what's wierd is I can getCustomfield, setCallResult, setTimeZone etc,
but all values from get custom field are Null.
Then I checked ail source code about method 'setcustomfield',
public void setCustomField(String _fieldName, Object _value) throws RequestFailedException
/* */ {
/* 401 */ setCustomField(_fieldName, _value, true);
/* */ }
/* */
/* */ public void setCustomField(String _fieldName, Object _value, boolean _update)
/* */ throws RequestFailedException
/* */ {
/* 408 */ Object currentFieldValue = this.mCustomFields.get(_fieldName);
/* 409 */ if (currentFieldValue == null) {
/* 410 */ this.sLog.warn("Can't set custom field: field " + _fieldName + " unknown");
/* 411 */ throw new InvalidParameterException("_fieldname", _fieldName, "Unknown custom field");
/* */ }
/* */
/* 414 */ if (_value == null) {
/* 415 */ this.sLog.warn("Can't set custom field: value is null");
/* 416 */ throw new InvalidParameterException("_value", null, "Null custom field");
/* */ }
/* */
/* 419 */ if (!currentFieldValue.getClass().isInstance(_value)) {
/* 420 */ this.sLog.warn("Can't set custom field: field " + _fieldName + " has not the correct type");
/* 421 */ throw new InvalidParameterException("_fieldname", _fieldName, "Incorrect type for the custom field");
only when currentFieldValue == null is true, there will be error message: unknown custom field.
so, it seems the reason is clear, but why the these custom field values are null?
I am very sure the values of these field in database not null, even some field can not be null.
The following is error message from jsp code.
org.apache.jasper.JasperException: Exception in JSP: /custom/disposition-codes-view.jsp:33
30: OutboundRecord myOutboundRecord = myOutboundChain.getActiveRecord();
31: Integer wrapUpCode = new Integer(5);
32: String aaa = "aaaaa";
33: myOutboundRecord.setCustomField("WrapUpCode",wrapUpCode);
34: //myOutboundRecord.setCustomField("Customer_name","kevin");
35: myOutboundRecord.setTimeZone("EST");
36:
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.genesyslab.uadthin.filter.CachePreventFilter.doFilter(CachePreventFilter.java:30)
com.genesyslab.uadthin.filter.UTF8Filter.doFilter(UTF8Filter.java:127)
root cause
javax.servlet.ServletException: Unknown custom field
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.custom.disposition_002dcodes_002dview_jsp._jspService(disposition_002dcodes_002dview_jsp.java:185)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.genesyslab.uadthin.filter.CachePreventFilter.doFilter(CachePreventFilter.java:30)
com.genesyslab.uadthin.filter.UTF8Filter.doFilter(UTF8Filter.java:127)
root cause
com.genesyslab.ail.exception.InvalidParameterException: Unknown custom field
com.genesyslab.ail.core.outbound.OutboundRecordImpl.setCustomField(OutboundRecordImpl.java:411)
com.genesyslab.ail.core.outbound.OutboundRecordImpl.setCustomField(OutboundRecordImpl.java:401)
org.apache.jsp.custom.disposition_002dcodes_002dview_jsp._jspService(disposition_002dcodes_002dview_jsp.java:87)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.genesyslab.uadthin.filter.CachePreventFilter.doFilter(CachePreventFilter.java:30)
com.genesyslab.uadthin.filter.UTF8Filter.doFilter(UTF8Filter.java:127)