UtilDateTime is the utility class, add the time format support you want and use it. Most format supported by this utility class OFBiz have.
Rishi Solanki Sr Manager, Enterprise Software Development HotWax Systems Pvt. Ltd. Direct: +91-9893287847 http://www.hotwaxsystems.com www.hotwax.co On Tue, Apr 17, 2018 at 12:27 PM, Rajesh Mallah <mallah.raj...@gmail.com> wrote: > Now I am passing "2018-04-17 12:09:17+05:30" as fromDate , > Which is the value picked up from the DB column. > > Even at XML level the string is preserved , but at some stage after > hitting tomcat it becomes: "2018-04-17 12:09:17+05:30.0" > > which is not parseable. > > |W| [ModelService.makeValid] : Type conversion of field [fromDate] to type > [java.sql.Timestamp] failed f > or value "2018-04-17 12:09:17+05:30": > org.apache.ofbiz.base.util.GeneralException: java.text.ParseException: > Unparseable date: "2018-04-17 12:09:17+05:30.0" (java.text.ParseExceptio > n: Unparseable date: "2018-04-17 12:09:17+05:30.0") > > > <!--- snippet from the XML-RPC --> > > <member> > <name>fromDate</name> > <value> > <string><![CDATA[2018-04-17 12:09:17+05:30]]></string> > </value> > </member> > > <!-- end of snippet --> > > > > > regds > mallah. > > > On Tue, Apr 17, 2018 at 11:08 AM, Rajesh Mallah <mallah.raj...@gmail.com> > wrote: > > > Hello Mr Deepak , > > > > Thanks for the response . The record does exists but i guess > > i am not specifying the params good enough to hit the record > > by pkey. > > > > I wish there were a "product_price_id" in ProductPrice entity. :-) > > > > regds > > mallah. > > > > > > > > > > > > On Tue, Apr 17, 2018 at 9:58 AM, Deepak Dixit <deepak.di...@hotwax.co> > > wrote: > > > >> Hi Rajesh, > >> > >> If you want to create product price you should use createProductPrice > >> service, > >> https://demo-stable.ofbiz.apache.org/webtools/control/Servic > >> eList?sel_service_name=createProductPrice > >> > >> If productPrice record already exists you should use updateProductPrice, > >> > >> Thanks & Regards > >> -- > >> Deepak Dixit > >> Director of Product Engineering > >> HotWax Commerce <https://hotwax.co/> > >> > >> On Mon, Apr 16, 2018 at 11:42 PM, Rajesh Mallah < > mallah.raj...@gmail.com> > >> wrote: > >> > >> > Hi , > >> > > >> > I am calling > >> > > >> > https://demo-stable.ofbiz.apache.org/webtools/control/ > >> > ServiceList?sel_service_name=updateProductPrice > >> > > >> > with ARGS > >> > > >> > { > >> > currencyUomId "INR", > >> > fromDate "2018-04-16 17:39:52", > >> > price 150, > >> > productId "PROD_SW52D5H3EN", > >> > productPricePurposeId "PURCHASE", > >> > productPriceTypeId "DEFAULT_PRICE", > >> > productStoreGroupId "_NA_", > >> > taxInPrice "Y", > >> > termUomId "WT_kg" > >> > } > >> > > >> > > >> > I am getting error: > >> > > >> > > >> > faultString:Error running the simple-method: Entity value not found > with > >> > name: lookedUpValue Method = updateProductPrice, File = > >> > file:/opt/ofbiz/apache-ofbiz-16.11.04/applications/product/ > >> > minilang/product/price/PriceServices.xml, > >> > Element = <set-nonpk-fields>, Line 69null > >> > > >> > > >> > the minilang def is reproduced here for convinience: > >> > > >> > <simple-method method-name="updateProductPrice" > >> short-description="Update > >> > an ProductPrice"> > >> > <set field="callingMethodName" value="updateProductPrice"/> > >> > <set field="checkAction" value="UPDATE"/> > >> > <call-simple-method method-name=" > checkProductRelatedPermission" > >> > xml-resource="component://product/minilang/product/ > >> > product/ProductServices.xml"/> > >> > <check-permission permission="CATALOG_PRICE_MAINT"> > >> > <fail-property resource="ProductUiLabels" > >> > property="ProductPriceMaintPermissionError"/> > >> > </check-permission> > >> > <check-errors/> > >> > > >> > <call-simple-method method-name=" > inlineHandlePriceWithTaxInclud > >> > ed"/> > >> > > >> > <entity-one entity-name="ProductPrice" > >> > value-field="lookedUpValue"/> > >> > > >> > <!-- grab the old price value before setting nonpk parameter > >> fields > >> > --> > >> > <field-to-result field="lookedUpValue.price" > >> > result-name="oldPrice"/> > >> > > >> > <set-nonpk-fields map="parameters" > value-field="lookedUpValue"/> > >> > > >> > <now-timestamp field="nowTimestamp"/> > >> > <set field="lookedUpValue.lastModifiedDate" > >> > from-field="nowTimestamp"/> > >> > <set field="lookedUpValue.lastModifiedByUserLogin" > >> > from-field="userLogin.userLoginId"/> > >> > > >> > <store-value value-field="lookedUpValue"/> > >> > </simple-method> > >> > > >> > The productID does exists in Entity ProductPrice > >> > Where am I going wrong ? > >> > > >> > thanks & regds > >> > Rajesh Mallah. > >> > > >> > > > > >