Author: hansbak
Date: Fri May 21 08:16:18 2010
New Revision: 946931
URL:
http://svn.apache.org/viewvc?rev=946931&view=revLog:
in convert communication to customer request, truncate subject field from communication if it does not fit in the customer request name
Modified:
ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml
Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml?rev=946931&r1=946930&r2=946931&view=diff==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml Fri May 21 08:16:18 2010
@@ -502,7 +502,13 @@ under the License.
<set-service-fields service-name="createCustRequest" map="parameters" to-map="custRequest"/>
<if-empty field="custRequest.custRequestName">
- <set field="custRequest.custRequestName" from-field="communicationEvent.subject"/>
+ <set field="subjectLength" value="${groovy:communicationEvent.subject.length()}" type="Integer"/>
+ <if-compare field="subjectLength" operator="less" value="100" type="Integer">
+ <set field="custRequest.custRequestName" from-field="communicationEvent.subject"/>
+ <else>
+ <set field="custRequest.custRequestName" value="${groovy:communicationEvent.subject.substring(0,95) + "....." }"/>
+ </else>
+ </if-compare>
</if-empty>
<if-empty field="parameters.custRequestTypeId">
<set field="custRequest.custRequestTypeId" value="RF_SUPPORT"/>