Hi Rajesh, Could you please share which database you are using?
Thanks & Regards -- Deepak Dixit www.hotwax.co On Tue, Apr 17, 2018 at 2:36 PM, Rajesh Mallah <mallah.raj...@gmail.com> wrote: > Hi , > > > it was in conversion/DateTimeConverters.java that was appending '.0' to > the > end of > string if the string did not contain any decimals. So i have now started > sending > the fractional seconds. And things are better (if not perfect). > > > > public java.sql.Timestamp convert(String obj, Locale locale, TimeZone > timeZone, String formatString) throws ConversionException { > String str = obj.trim(); > if (str.length() == 0) { > return null; > } > DateFormat df = null; > if (UtilValidate.isEmpty(formatString)) { > // These hacks are a bad idea, but they are included > // for backward compatibility. > if (str.length() > 0 && !str.contains(":")) { > str = str + " 00:00:00.00"; > } > // hack to mimic Timestamp.valueOf() method > if (str.length() > 0 && !str.contains(".")) { > str = str + ".0"; > } else { > // DateFormat has a funny way of parsing milliseconds: > // 00:00:00.2 parses to 00:00:00.002 > // so we'll add zeros to the end to get 00:00:00.200 > String[] timeSplit = str.split("[.]"); > if (timeSplit.length > 1 && timeSplit[1].length() < 3) > { > str = str + "000".substring(timeSplit[1]. > length()); > } > } > df = > UtilDateTime.toDateTimeFormat(UtilDateTime.getDateTimeFormat(), timeZone, > locale); > } else { > df = UtilDateTime.toDateTimeFormat(formatString, timeZone, > locale); > } > try { > return new java.sql.Timestamp(df.parse(str).getTime()); > } catch (ParseException e) { > > > On Tue, Apr 17, 2018 at 2:19 PM, Rajesh Mallah <mallah.raj...@gmail.com> > wrote: > > > Thanks Rishi. > > > > On Tue, Apr 17, 2018 at 2:08 PM, Rishi Solanki <rishisolan...@gmail.com> > > wrote: > > > >> 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. > >> > >> > > >> > >> > >> > > > >> > > > >> > > >> > > > > >