Re: help with updateProductPrice

2018-04-18 Thread Rajesh Mallah
Hi Mike ,

I concur with you.

In fact i am already taking such an  approach of directly connecting to DB
.
Instead of XML RPC its JSON in my case. So my client software
 connects to a non-OfBiz App server.

The Appserver tries to accomplish the task using a documented WebService
interface   using XML/RPC or connects to DB directly and emulates part
of the logic of OFBiz (in case XML/RPC Webservice) is
insufficient/infeasible.

thanks for the tip regarding Invalidating the caches. Is there any variant
of the
same to clear caches of a set of particular entities?

regds
mallah.



On Wed, Apr 18, 2018 at 11:04 AM, Mike  wrote:

> Just make your DB updates, then make an API call or use wget to clear the
> cache.  For instance:
>
> wget --no-check-certificate -T 360
> https://IP_ADDRESS/webtools/control/FindUtilCacheClearAll?
> USERNAME=admin=xxx=N
>
> Here's the thing.. Eventually, you're going to make hacks to satisfy
> various problems that come up.  Making your own, custom xmlrpc/SOAP/REST is
> well within the norm.  If you make one (hack), like to make an easy fast
> price updater, you'll start to use the same technique to solve another
> problem.  It's great to be a purist (if you can), but you have to have a
> way of working around bugs.  Just MHO.
>
> On Tue, Apr 17, 2018 at 10:14 PM, Rajesh Mallah 
> wrote:
>
> > Hi Mike  ,
> >
> > moreover there is the factor of Caching at various levels . If you
> > directly interact with DB , i feel the caches may become stale .
> >
> > regds
> > Mallah.
> >
> > On Tue, Apr 17, 2018 at 9:17 PM, Mike  wrote:
> >
> > > Why not just write your own custom xmlrpc server (perl/python/java)
> that
> > > accepts just the P/N and new price, searches for the current record,
> and
> > > performs a SQL call to update the DB.
> > >
> > > On Tue, Apr 17, 2018 at 8:12 AM, Rajesh Mallah <
> mallah.raj...@gmail.com>
> > > wrote:
> > >
> > > > ERRATA: I meant "There is no parameter" in lieu of "There is
> parameter"
> > > >
> > > > On Tue, Apr 17, 2018 at 8:09 PM, Rajesh Mallah <
> > mallah.raj...@gmail.com>
> > > > wrote:
> > > >
> > > > >
> > > > > Hi Rishi ,
> > > > >
> > > > > I am using XML RPC with OFBiz so my capabilities are limited to
> > > > > what the interface provides. There is  parameter that allows me
> > > > > to specify the data format/pattern .
> > > > >
> > > > > At this moment i have solved my problem temporarily by appending
> > > > > .001 after the second part in HH:MM:SS and i am only using
> > > > > createProductPrice instead of updateProductPrice . As creating new
> > > > > prices allows to have a history/audit of prices. I feel
> > > > updateProductPrice
> > > > > is really overwriting the values and trail is lost.
> > > > >
> > > > > regds
> > > > > mallah.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > On Tue, Apr 17, 2018 at 6:49 PM, Rishi Solanki <
> > > rishisolan...@gmail.com>
> > > > > wrote:
> > > > >
> > > > >> Idea of utility class is, use the format you would like and pass
> the
> > > > >> value.
> > > > >> It will convert into timestamp used in the table. In case you
> could
> > > not
> > > > >> get
> > > > >> the desired format in the utility class then the class uses the
> > > > >> java.text.SimpleDateFormat class to resolve its purpose.
> > > > >>
> > > > >> Please take a look at toTimestamp() method variations and format
> you
> > > are
> > > > >> receiving in the xml. Once you have the format with you, it can be
> > > > easily
> > > > >> converted into timestamp. Also if utility class does not support
> > then
> > > go
> > > > >> to
> > > > >> core class for same i.e java.text.SimpleDateFormat and look for
> the
> > > > >> supporting format.
> > > > >>
> > > > >> HTH!
> > > > >>
> > > > >>
> > > > >> 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 3:02 PM, Rajesh Mallah <
> > > mallah.raj...@gmail.com
> > > > >
> > > > >> wrote:
> > > > >>
> > > > >> > Further Info:
> > > > >> >
> > > > >> >   
> > > > >> > fromDate
> > > > >> > 
> > > > >> >   
> > > > >> > 
> > > > >> >
> > > > >> >
> > > > >> > In XML results in
> > > > >> >
> > > > >> > from_date   | 2018-04-17 14:59:34.001+05:30
> > > > >> >
> > > > >> > in DB. looks like the parser is kind enough to consider TZ
> > > > >> > spec without colons.
> > > > >> >
> > > > >> >
> > > > >> > regds
> > > > >> > mallah.
> > > > >> >
> > > > >> >
> > > > >> > On Tue, Apr 17, 2018 at 2:42 PM, Rajesh Mallah <
> > > > mallah.raj...@gmail.com
> > > > >> >
> > > > >> > wrote:
> > > > >> >
> > > > >> > >
> > > > >> > > Its PostgreSQL
> > > > >> > > regds
> > > > >> > >
> > > > >> > >
> > > > >> > >  below is a sample data :
> > > > >> > >
> > > > >> > > SQL> 

Re: help with updateProductPrice

2018-04-17 Thread Mike
Just make your DB updates, then make an API call or use wget to clear the
cache.  For instance:

wget --no-check-certificate -T 360
https://IP_ADDRESS/webtools/control/FindUtilCacheClearAll?USERNAME=admin=xxx=N

Here's the thing.. Eventually, you're going to make hacks to satisfy
various problems that come up.  Making your own, custom xmlrpc/SOAP/REST is
well within the norm.  If you make one (hack), like to make an easy fast
price updater, you'll start to use the same technique to solve another
problem.  It's great to be a purist (if you can), but you have to have a
way of working around bugs.  Just MHO.

On Tue, Apr 17, 2018 at 10:14 PM, Rajesh Mallah 
wrote:

> Hi Mike  ,
>
> moreover there is the factor of Caching at various levels . If you
> directly interact with DB , i feel the caches may become stale .
>
> regds
> Mallah.
>
> On Tue, Apr 17, 2018 at 9:17 PM, Mike  wrote:
>
> > Why not just write your own custom xmlrpc server (perl/python/java) that
> > accepts just the P/N and new price, searches for the current record, and
> > performs a SQL call to update the DB.
> >
> > On Tue, Apr 17, 2018 at 8:12 AM, Rajesh Mallah 
> > wrote:
> >
> > > ERRATA: I meant "There is no parameter" in lieu of "There is parameter"
> > >
> > > On Tue, Apr 17, 2018 at 8:09 PM, Rajesh Mallah <
> mallah.raj...@gmail.com>
> > > wrote:
> > >
> > > >
> > > > Hi Rishi ,
> > > >
> > > > I am using XML RPC with OFBiz so my capabilities are limited to
> > > > what the interface provides. There is  parameter that allows me
> > > > to specify the data format/pattern .
> > > >
> > > > At this moment i have solved my problem temporarily by appending
> > > > .001 after the second part in HH:MM:SS and i am only using
> > > > createProductPrice instead of updateProductPrice . As creating new
> > > > prices allows to have a history/audit of prices. I feel
> > > updateProductPrice
> > > > is really overwriting the values and trail is lost.
> > > >
> > > > regds
> > > > mallah.
> > > >
> > > >
> > > >
> > > >
> > > > On Tue, Apr 17, 2018 at 6:49 PM, Rishi Solanki <
> > rishisolan...@gmail.com>
> > > > wrote:
> > > >
> > > >> Idea of utility class is, use the format you would like and pass the
> > > >> value.
> > > >> It will convert into timestamp used in the table. In case you could
> > not
> > > >> get
> > > >> the desired format in the utility class then the class uses the
> > > >> java.text.SimpleDateFormat class to resolve its purpose.
> > > >>
> > > >> Please take a look at toTimestamp() method variations and format you
> > are
> > > >> receiving in the xml. Once you have the format with you, it can be
> > > easily
> > > >> converted into timestamp. Also if utility class does not support
> then
> > go
> > > >> to
> > > >> core class for same i.e java.text.SimpleDateFormat and look for the
> > > >> supporting format.
> > > >>
> > > >> HTH!
> > > >>
> > > >>
> > > >> 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 3:02 PM, Rajesh Mallah <
> > mallah.raj...@gmail.com
> > > >
> > > >> wrote:
> > > >>
> > > >> > Further Info:
> > > >> >
> > > >> >   
> > > >> > fromDate
> > > >> > 
> > > >> >   
> > > >> > 
> > > >> >
> > > >> >
> > > >> > In XML results in
> > > >> >
> > > >> > from_date   | 2018-04-17 14:59:34.001+05:30
> > > >> >
> > > >> > in DB. looks like the parser is kind enough to consider TZ
> > > >> > spec without colons.
> > > >> >
> > > >> >
> > > >> > regds
> > > >> > mallah.
> > > >> >
> > > >> >
> > > >> > On Tue, Apr 17, 2018 at 2:42 PM, Rajesh Mallah <
> > > mallah.raj...@gmail.com
> > > >> >
> > > >> > wrote:
> > > >> >
> > > >> > >
> > > >> > > Its PostgreSQL
> > > >> > > regds
> > > >> > >
> > > >> > >
> > > >> > >  below is a sample data :
> > > >> > >
> > > >> > > SQL> select * from  ofbiz.product_price  where
> > > >> > > product_id='PROD_SW52D5H3EN' order by created_date desc limit 1;
> > > >> > >
> > > >> > > -[ RECORD 1 ]---+--
> > > >> > > product_id  | PROD_SW52D5H3EN
> > > >> > > product_price_type_id   | DEFAULT_PRICE
> > > >> > > product_price_purpose_id| PURCHASE
> > > >> > > currency_uom_id | INR
> > > >> > > product_store_group_id  | _NA_
> > > >> > > from_date   | 2018-04-17 12:49:20+05:30<
> > > This
> > > >> has
> > > >> > > been put by me.
> > > >> > > thru_date   |
> > > >> > > price   | 121.000
> > > >> > > term_uom_id | WT_kg
> > > >> > > custom_price_calc_service   |
> > > >> > > price_without_tax   |
> > > >> > > price_with_tax  |
> > > >> > > tax_amount  |
> > > >> > > 

Re: help with updateProductPrice

2018-04-17 Thread Rajesh Mallah
Hi Mike  ,

moreover there is the factor of Caching at various levels . If you
directly interact with DB , i feel the caches may become stale .

regds
Mallah.

On Tue, Apr 17, 2018 at 9:17 PM, Mike  wrote:

> Why not just write your own custom xmlrpc server (perl/python/java) that
> accepts just the P/N and new price, searches for the current record, and
> performs a SQL call to update the DB.
>
> On Tue, Apr 17, 2018 at 8:12 AM, Rajesh Mallah 
> wrote:
>
> > ERRATA: I meant "There is no parameter" in lieu of "There is parameter"
> >
> > On Tue, Apr 17, 2018 at 8:09 PM, Rajesh Mallah 
> > wrote:
> >
> > >
> > > Hi Rishi ,
> > >
> > > I am using XML RPC with OFBiz so my capabilities are limited to
> > > what the interface provides. There is  parameter that allows me
> > > to specify the data format/pattern .
> > >
> > > At this moment i have solved my problem temporarily by appending
> > > .001 after the second part in HH:MM:SS and i am only using
> > > createProductPrice instead of updateProductPrice . As creating new
> > > prices allows to have a history/audit of prices. I feel
> > updateProductPrice
> > > is really overwriting the values and trail is lost.
> > >
> > > regds
> > > mallah.
> > >
> > >
> > >
> > >
> > > On Tue, Apr 17, 2018 at 6:49 PM, Rishi Solanki <
> rishisolan...@gmail.com>
> > > wrote:
> > >
> > >> Idea of utility class is, use the format you would like and pass the
> > >> value.
> > >> It will convert into timestamp used in the table. In case you could
> not
> > >> get
> > >> the desired format in the utility class then the class uses the
> > >> java.text.SimpleDateFormat class to resolve its purpose.
> > >>
> > >> Please take a look at toTimestamp() method variations and format you
> are
> > >> receiving in the xml. Once you have the format with you, it can be
> > easily
> > >> converted into timestamp. Also if utility class does not support then
> go
> > >> to
> > >> core class for same i.e java.text.SimpleDateFormat and look for the
> > >> supporting format.
> > >>
> > >> HTH!
> > >>
> > >>
> > >> 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 3:02 PM, Rajesh Mallah <
> mallah.raj...@gmail.com
> > >
> > >> wrote:
> > >>
> > >> > Further Info:
> > >> >
> > >> >   
> > >> > fromDate
> > >> > 
> > >> >   
> > >> > 
> > >> >
> > >> >
> > >> > In XML results in
> > >> >
> > >> > from_date   | 2018-04-17 14:59:34.001+05:30
> > >> >
> > >> > in DB. looks like the parser is kind enough to consider TZ
> > >> > spec without colons.
> > >> >
> > >> >
> > >> > regds
> > >> > mallah.
> > >> >
> > >> >
> > >> > On Tue, Apr 17, 2018 at 2:42 PM, Rajesh Mallah <
> > mallah.raj...@gmail.com
> > >> >
> > >> > wrote:
> > >> >
> > >> > >
> > >> > > Its PostgreSQL
> > >> > > regds
> > >> > >
> > >> > >
> > >> > >  below is a sample data :
> > >> > >
> > >> > > SQL> select * from  ofbiz.product_price  where
> > >> > > product_id='PROD_SW52D5H3EN' order by created_date desc limit 1;
> > >> > >
> > >> > > -[ RECORD 1 ]---+--
> > >> > > product_id  | PROD_SW52D5H3EN
> > >> > > product_price_type_id   | DEFAULT_PRICE
> > >> > > product_price_purpose_id| PURCHASE
> > >> > > currency_uom_id | INR
> > >> > > product_store_group_id  | _NA_
> > >> > > from_date   | 2018-04-17 12:49:20+05:30<
> > This
> > >> has
> > >> > > been put by me.
> > >> > > thru_date   |
> > >> > > price   | 121.000
> > >> > > term_uom_id | WT_kg
> > >> > > custom_price_calc_service   |
> > >> > > price_without_tax   |
> > >> > > price_with_tax  |
> > >> > > tax_amount  |
> > >> > > tax_percentage  |
> > >> > > tax_auth_party_id   |
> > >> > > tax_auth_geo_id |
> > >> > > tax_in_price| Y
> > >> > > created_date| 2018-04-17 12:49:20.416+05:30
> > >> > > created_by_user_login   | admin
> > >> > > last_modified_date  | 2018-04-17 12:49:20.416+05:30
> > >> > > last_modified_by_user_login | admin
> > >> > > last_updated_stamp  | 2018-04-17 12:49:20.416+05:30  <
> > >> > > Generated by defaults.
> > >> > > last_updated_tx_stamp   | 2018-04-17 12:49:20.357+05:30
> > >> > > created_stamp   | 2018-04-17 12:49:20.416+05:30
> > >> > > created_tx_stamp| 2018-04-17 12:49:20.357+05:30
> > >> > >
> > >> > >
> > >> > > On Tue, Apr 17, 2018 at 2:39 PM, Deepak Dixit
> > >> >  > >> > > com> wrote:
> > >> > >
> > >> > >> Hi Rajesh,
> > >> > >>
> > >> > >> Could you please share which database you are using?
> > >> > 

Re: help with updateProductPrice

2018-04-17 Thread Rajesh Mallah
Its always not that straightforward. I tend to use webservices  as it
provides
consistent results and you do not have to "reverse engineer" . Moreover
things
should work as advertised (documented) !


On Tue, Apr 17, 2018 at 9:17 PM, Mike  wrote:

> Why not just write your own custom xmlrpc server (perl/python/java) that
> accepts just the P/N and new price, searches for the current record, and
> performs a SQL call to update the DB.
>
> On Tue, Apr 17, 2018 at 8:12 AM, Rajesh Mallah 
> wrote:
>
> > ERRATA: I meant "There is no parameter" in lieu of "There is parameter"
> >
> > On Tue, Apr 17, 2018 at 8:09 PM, Rajesh Mallah 
> > wrote:
> >
> > >
> > > Hi Rishi ,
> > >
> > > I am using XML RPC with OFBiz so my capabilities are limited to
> > > what the interface provides. There is  parameter that allows me
> > > to specify the data format/pattern .
> > >
> > > At this moment i have solved my problem temporarily by appending
> > > .001 after the second part in HH:MM:SS and i am only using
> > > createProductPrice instead of updateProductPrice . As creating new
> > > prices allows to have a history/audit of prices. I feel
> > updateProductPrice
> > > is really overwriting the values and trail is lost.
> > >
> > > regds
> > > mallah.
> > >
> > >
> > >
> > >
> > > On Tue, Apr 17, 2018 at 6:49 PM, Rishi Solanki <
> rishisolan...@gmail.com>
> > > wrote:
> > >
> > >> Idea of utility class is, use the format you would like and pass the
> > >> value.
> > >> It will convert into timestamp used in the table. In case you could
> not
> > >> get
> > >> the desired format in the utility class then the class uses the
> > >> java.text.SimpleDateFormat class to resolve its purpose.
> > >>
> > >> Please take a look at toTimestamp() method variations and format you
> are
> > >> receiving in the xml. Once you have the format with you, it can be
> > easily
> > >> converted into timestamp. Also if utility class does not support then
> go
> > >> to
> > >> core class for same i.e java.text.SimpleDateFormat and look for the
> > >> supporting format.
> > >>
> > >> HTH!
> > >>
> > >>
> > >> 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 3:02 PM, Rajesh Mallah <
> mallah.raj...@gmail.com
> > >
> > >> wrote:
> > >>
> > >> > Further Info:
> > >> >
> > >> >   
> > >> > fromDate
> > >> > 
> > >> >   
> > >> > 
> > >> >
> > >> >
> > >> > In XML results in
> > >> >
> > >> > from_date   | 2018-04-17 14:59:34.001+05:30
> > >> >
> > >> > in DB. looks like the parser is kind enough to consider TZ
> > >> > spec without colons.
> > >> >
> > >> >
> > >> > regds
> > >> > mallah.
> > >> >
> > >> >
> > >> > On Tue, Apr 17, 2018 at 2:42 PM, Rajesh Mallah <
> > mallah.raj...@gmail.com
> > >> >
> > >> > wrote:
> > >> >
> > >> > >
> > >> > > Its PostgreSQL
> > >> > > regds
> > >> > >
> > >> > >
> > >> > >  below is a sample data :
> > >> > >
> > >> > > SQL> select * from  ofbiz.product_price  where
> > >> > > product_id='PROD_SW52D5H3EN' order by created_date desc limit 1;
> > >> > >
> > >> > > -[ RECORD 1 ]---+--
> > >> > > product_id  | PROD_SW52D5H3EN
> > >> > > product_price_type_id   | DEFAULT_PRICE
> > >> > > product_price_purpose_id| PURCHASE
> > >> > > currency_uom_id | INR
> > >> > > product_store_group_id  | _NA_
> > >> > > from_date   | 2018-04-17 12:49:20+05:30<
> > This
> > >> has
> > >> > > been put by me.
> > >> > > thru_date   |
> > >> > > price   | 121.000
> > >> > > term_uom_id | WT_kg
> > >> > > custom_price_calc_service   |
> > >> > > price_without_tax   |
> > >> > > price_with_tax  |
> > >> > > tax_amount  |
> > >> > > tax_percentage  |
> > >> > > tax_auth_party_id   |
> > >> > > tax_auth_geo_id |
> > >> > > tax_in_price| Y
> > >> > > created_date| 2018-04-17 12:49:20.416+05:30
> > >> > > created_by_user_login   | admin
> > >> > > last_modified_date  | 2018-04-17 12:49:20.416+05:30
> > >> > > last_modified_by_user_login | admin
> > >> > > last_updated_stamp  | 2018-04-17 12:49:20.416+05:30  <
> > >> > > Generated by defaults.
> > >> > > last_updated_tx_stamp   | 2018-04-17 12:49:20.357+05:30
> > >> > > created_stamp   | 2018-04-17 12:49:20.416+05:30
> > >> > > created_tx_stamp| 2018-04-17 12:49:20.357+05:30
> > >> > >
> > >> > >
> > >> > > On Tue, Apr 17, 2018 at 2:39 PM, Deepak Dixit
> > >> >  > >> > > com> wrote:
> > >> > >
> > >> > >> Hi Rajesh,
> > >> > >>
> > >> > >> Could you please 

Re: help with updateProductPrice

2018-04-17 Thread Mike
Why not just write your own custom xmlrpc server (perl/python/java) that
accepts just the P/N and new price, searches for the current record, and
performs a SQL call to update the DB.

On Tue, Apr 17, 2018 at 8:12 AM, Rajesh Mallah 
wrote:

> ERRATA: I meant "There is no parameter" in lieu of "There is parameter"
>
> On Tue, Apr 17, 2018 at 8:09 PM, Rajesh Mallah 
> wrote:
>
> >
> > Hi Rishi ,
> >
> > I am using XML RPC with OFBiz so my capabilities are limited to
> > what the interface provides. There is  parameter that allows me
> > to specify the data format/pattern .
> >
> > At this moment i have solved my problem temporarily by appending
> > .001 after the second part in HH:MM:SS and i am only using
> > createProductPrice instead of updateProductPrice . As creating new
> > prices allows to have a history/audit of prices. I feel
> updateProductPrice
> > is really overwriting the values and trail is lost.
> >
> > regds
> > mallah.
> >
> >
> >
> >
> > On Tue, Apr 17, 2018 at 6:49 PM, Rishi Solanki 
> > wrote:
> >
> >> Idea of utility class is, use the format you would like and pass the
> >> value.
> >> It will convert into timestamp used in the table. In case you could not
> >> get
> >> the desired format in the utility class then the class uses the
> >> java.text.SimpleDateFormat class to resolve its purpose.
> >>
> >> Please take a look at toTimestamp() method variations and format you are
> >> receiving in the xml. Once you have the format with you, it can be
> easily
> >> converted into timestamp. Also if utility class does not support then go
> >> to
> >> core class for same i.e java.text.SimpleDateFormat and look for the
> >> supporting format.
> >>
> >> HTH!
> >>
> >>
> >> 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 3:02 PM, Rajesh Mallah  >
> >> wrote:
> >>
> >> > Further Info:
> >> >
> >> >   
> >> > fromDate
> >> > 
> >> >   
> >> > 
> >> >
> >> >
> >> > In XML results in
> >> >
> >> > from_date   | 2018-04-17 14:59:34.001+05:30
> >> >
> >> > in DB. looks like the parser is kind enough to consider TZ
> >> > spec without colons.
> >> >
> >> >
> >> > regds
> >> > mallah.
> >> >
> >> >
> >> > On Tue, Apr 17, 2018 at 2:42 PM, Rajesh Mallah <
> mallah.raj...@gmail.com
> >> >
> >> > wrote:
> >> >
> >> > >
> >> > > Its PostgreSQL
> >> > > regds
> >> > >
> >> > >
> >> > >  below is a sample data :
> >> > >
> >> > > SQL> select * from  ofbiz.product_price  where
> >> > > product_id='PROD_SW52D5H3EN' order by created_date desc limit 1;
> >> > >
> >> > > -[ RECORD 1 ]---+--
> >> > > product_id  | PROD_SW52D5H3EN
> >> > > product_price_type_id   | DEFAULT_PRICE
> >> > > product_price_purpose_id| PURCHASE
> >> > > currency_uom_id | INR
> >> > > product_store_group_id  | _NA_
> >> > > from_date   | 2018-04-17 12:49:20+05:30<
> This
> >> has
> >> > > been put by me.
> >> > > thru_date   |
> >> > > price   | 121.000
> >> > > term_uom_id | WT_kg
> >> > > custom_price_calc_service   |
> >> > > price_without_tax   |
> >> > > price_with_tax  |
> >> > > tax_amount  |
> >> > > tax_percentage  |
> >> > > tax_auth_party_id   |
> >> > > tax_auth_geo_id |
> >> > > tax_in_price| Y
> >> > > created_date| 2018-04-17 12:49:20.416+05:30
> >> > > created_by_user_login   | admin
> >> > > last_modified_date  | 2018-04-17 12:49:20.416+05:30
> >> > > last_modified_by_user_login | admin
> >> > > last_updated_stamp  | 2018-04-17 12:49:20.416+05:30  <
> >> > > Generated by defaults.
> >> > > last_updated_tx_stamp   | 2018-04-17 12:49:20.357+05:30
> >> > > created_stamp   | 2018-04-17 12:49:20.416+05:30
> >> > > created_tx_stamp| 2018-04-17 12:49:20.357+05:30
> >> > >
> >> > >
> >> > > On Tue, Apr 17, 2018 at 2:39 PM, Deepak Dixit
> >> >  >> > > com> wrote:
> >> > >
> >> > >> 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
> >> > >> > 

Re: help with updateProductPrice

2018-04-17 Thread Rajesh Mallah
ERRATA: I meant "There is no parameter" in lieu of "There is parameter"

On Tue, Apr 17, 2018 at 8:09 PM, Rajesh Mallah 
wrote:

>
> Hi Rishi ,
>
> I am using XML RPC with OFBiz so my capabilities are limited to
> what the interface provides. There is  parameter that allows me
> to specify the data format/pattern .
>
> At this moment i have solved my problem temporarily by appending
> .001 after the second part in HH:MM:SS and i am only using
> createProductPrice instead of updateProductPrice . As creating new
> prices allows to have a history/audit of prices. I feel updateProductPrice
> is really overwriting the values and trail is lost.
>
> regds
> mallah.
>
>
>
>
> On Tue, Apr 17, 2018 at 6:49 PM, Rishi Solanki 
> wrote:
>
>> Idea of utility class is, use the format you would like and pass the
>> value.
>> It will convert into timestamp used in the table. In case you could not
>> get
>> the desired format in the utility class then the class uses the
>> java.text.SimpleDateFormat class to resolve its purpose.
>>
>> Please take a look at toTimestamp() method variations and format you are
>> receiving in the xml. Once you have the format with you, it can be easily
>> converted into timestamp. Also if utility class does not support then go
>> to
>> core class for same i.e java.text.SimpleDateFormat and look for the
>> supporting format.
>>
>> HTH!
>>
>>
>> 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 3:02 PM, Rajesh Mallah 
>> wrote:
>>
>> > Further Info:
>> >
>> >   
>> > fromDate
>> > 
>> >   
>> > 
>> >
>> >
>> > In XML results in
>> >
>> > from_date   | 2018-04-17 14:59:34.001+05:30
>> >
>> > in DB. looks like the parser is kind enough to consider TZ
>> > spec without colons.
>> >
>> >
>> > regds
>> > mallah.
>> >
>> >
>> > On Tue, Apr 17, 2018 at 2:42 PM, Rajesh Mallah > >
>> > wrote:
>> >
>> > >
>> > > Its PostgreSQL
>> > > regds
>> > >
>> > >
>> > >  below is a sample data :
>> > >
>> > > SQL> select * from  ofbiz.product_price  where
>> > > product_id='PROD_SW52D5H3EN' order by created_date desc limit 1;
>> > >
>> > > -[ RECORD 1 ]---+--
>> > > product_id  | PROD_SW52D5H3EN
>> > > product_price_type_id   | DEFAULT_PRICE
>> > > product_price_purpose_id| PURCHASE
>> > > currency_uom_id | INR
>> > > product_store_group_id  | _NA_
>> > > from_date   | 2018-04-17 12:49:20+05:30< This
>> has
>> > > been put by me.
>> > > thru_date   |
>> > > price   | 121.000
>> > > term_uom_id | WT_kg
>> > > custom_price_calc_service   |
>> > > price_without_tax   |
>> > > price_with_tax  |
>> > > tax_amount  |
>> > > tax_percentage  |
>> > > tax_auth_party_id   |
>> > > tax_auth_geo_id |
>> > > tax_in_price| Y
>> > > created_date| 2018-04-17 12:49:20.416+05:30
>> > > created_by_user_login   | admin
>> > > last_modified_date  | 2018-04-17 12:49:20.416+05:30
>> > > last_modified_by_user_login | admin
>> > > last_updated_stamp  | 2018-04-17 12:49:20.416+05:30  <
>> > > Generated by defaults.
>> > > last_updated_tx_stamp   | 2018-04-17 12:49:20.357+05:30
>> > > created_stamp   | 2018-04-17 12:49:20.416+05:30
>> > > created_tx_stamp| 2018-04-17 12:49:20.357+05:30
>> > >
>> > >
>> > > On Tue, Apr 17, 2018 at 2:39 PM, Deepak Dixit
>> > > > > com> wrote:
>> > >
>> > >> 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 

Re: help with updateProductPrice

2018-04-17 Thread Rajesh Mallah
Hi Rishi ,

I am using XML RPC with OFBiz so my capabilities are limited to
what the interface provides. There is  parameter that allows me
to specify the data format/pattern .

At this moment i have solved my problem temporarily by appending
.001 after the second part in HH:MM:SS and i am only using
createProductPrice instead of updateProductPrice . As creating new
prices allows to have a history/audit of prices. I feel updateProductPrice
is really overwriting the values and trail is lost.

regds
mallah.




On Tue, Apr 17, 2018 at 6:49 PM, Rishi Solanki 
wrote:

> Idea of utility class is, use the format you would like and pass the value.
> It will convert into timestamp used in the table. In case you could not get
> the desired format in the utility class then the class uses the
> java.text.SimpleDateFormat class to resolve its purpose.
>
> Please take a look at toTimestamp() method variations and format you are
> receiving in the xml. Once you have the format with you, it can be easily
> converted into timestamp. Also if utility class does not support then go to
> core class for same i.e java.text.SimpleDateFormat and look for the
> supporting format.
>
> HTH!
>
>
> 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 3:02 PM, Rajesh Mallah 
> wrote:
>
> > Further Info:
> >
> >   
> > fromDate
> > 
> >   
> > 
> >
> >
> > In XML results in
> >
> > from_date   | 2018-04-17 14:59:34.001+05:30
> >
> > in DB. looks like the parser is kind enough to consider TZ
> > spec without colons.
> >
> >
> > regds
> > mallah.
> >
> >
> > On Tue, Apr 17, 2018 at 2:42 PM, Rajesh Mallah 
> > wrote:
> >
> > >
> > > Its PostgreSQL
> > > regds
> > >
> > >
> > >  below is a sample data :
> > >
> > > SQL> select * from  ofbiz.product_price  where
> > > product_id='PROD_SW52D5H3EN' order by created_date desc limit 1;
> > >
> > > -[ RECORD 1 ]---+--
> > > product_id  | PROD_SW52D5H3EN
> > > product_price_type_id   | DEFAULT_PRICE
> > > product_price_purpose_id| PURCHASE
> > > currency_uom_id | INR
> > > product_store_group_id  | _NA_
> > > from_date   | 2018-04-17 12:49:20+05:30< This
> has
> > > been put by me.
> > > thru_date   |
> > > price   | 121.000
> > > term_uom_id | WT_kg
> > > custom_price_calc_service   |
> > > price_without_tax   |
> > > price_with_tax  |
> > > tax_amount  |
> > > tax_percentage  |
> > > tax_auth_party_id   |
> > > tax_auth_geo_id |
> > > tax_in_price| Y
> > > created_date| 2018-04-17 12:49:20.416+05:30
> > > created_by_user_login   | admin
> > > last_modified_date  | 2018-04-17 12:49:20.416+05:30
> > > last_modified_by_user_login | admin
> > > last_updated_stamp  | 2018-04-17 12:49:20.416+05:30  <
> > > Generated by defaults.
> > > last_updated_tx_stamp   | 2018-04-17 12:49:20.357+05:30
> > > created_stamp   | 2018-04-17 12:49:20.416+05:30
> > > created_tx_stamp| 2018-04-17 12:49:20.357+05:30
> > >
> > >
> > > On Tue, Apr 17, 2018 at 2:39 PM, Deepak Dixit
> >  > > com> wrote:
> > >
> > >> 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 

Re: help with updateProductPrice

2018-04-17 Thread Rishi Solanki
Idea of utility class is, use the format you would like and pass the value.
It will convert into timestamp used in the table. In case you could not get
the desired format in the utility class then the class uses the
java.text.SimpleDateFormat class to resolve its purpose.

Please take a look at toTimestamp() method variations and format you are
receiving in the xml. Once you have the format with you, it can be easily
converted into timestamp. Also if utility class does not support then go to
core class for same i.e java.text.SimpleDateFormat and look for the
supporting format.

HTH!


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 3:02 PM, Rajesh Mallah 
wrote:

> Further Info:
>
>   
> fromDate
> 
>   
> 
>
>
> In XML results in
>
> from_date   | 2018-04-17 14:59:34.001+05:30
>
> in DB. looks like the parser is kind enough to consider TZ
> spec without colons.
>
>
> regds
> mallah.
>
>
> On Tue, Apr 17, 2018 at 2:42 PM, Rajesh Mallah 
> wrote:
>
> >
> > Its PostgreSQL
> > regds
> >
> >
> >  below is a sample data :
> >
> > SQL> select * from  ofbiz.product_price  where
> > product_id='PROD_SW52D5H3EN' order by created_date desc limit 1;
> >
> > -[ RECORD 1 ]---+--
> > product_id  | PROD_SW52D5H3EN
> > product_price_type_id   | DEFAULT_PRICE
> > product_price_purpose_id| PURCHASE
> > currency_uom_id | INR
> > product_store_group_id  | _NA_
> > from_date   | 2018-04-17 12:49:20+05:30< This has
> > been put by me.
> > thru_date   |
> > price   | 121.000
> > term_uom_id | WT_kg
> > custom_price_calc_service   |
> > price_without_tax   |
> > price_with_tax  |
> > tax_amount  |
> > tax_percentage  |
> > tax_auth_party_id   |
> > tax_auth_geo_id |
> > tax_in_price| Y
> > created_date| 2018-04-17 12:49:20.416+05:30
> > created_by_user_login   | admin
> > last_modified_date  | 2018-04-17 12:49:20.416+05:30
> > last_modified_by_user_login | admin
> > last_updated_stamp  | 2018-04-17 12:49:20.416+05:30  <
> > Generated by defaults.
> > last_updated_tx_stamp   | 2018-04-17 12:49:20.357+05:30
> > created_stamp   | 2018-04-17 12:49:20.416+05:30
> > created_tx_stamp| 2018-04-17 12:49:20.357+05:30
> >
> >
> > On Tue, Apr 17, 2018 at 2:39 PM, Deepak Dixit
>  > com> wrote:
> >
> >> 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  >
> >> 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 = 

Re: help with updateProductPrice

2018-04-17 Thread Rajesh Mallah
Further Info:

  
fromDate

  

   

In XML results in

from_date   | 2018-04-17 14:59:34.001+05:30

in DB. looks like the parser is kind enough to consider TZ
spec without colons.


regds
mallah.


On Tue, Apr 17, 2018 at 2:42 PM, Rajesh Mallah 
wrote:

>
> Its PostgreSQL
> regds
>
>
>  below is a sample data :
>
> SQL> select * from  ofbiz.product_price  where
> product_id='PROD_SW52D5H3EN' order by created_date desc limit 1;
>
> -[ RECORD 1 ]---+--
> product_id  | PROD_SW52D5H3EN
> product_price_type_id   | DEFAULT_PRICE
> product_price_purpose_id| PURCHASE
> currency_uom_id | INR
> product_store_group_id  | _NA_
> from_date   | 2018-04-17 12:49:20+05:30< This has
> been put by me.
> thru_date   |
> price   | 121.000
> term_uom_id | WT_kg
> custom_price_calc_service   |
> price_without_tax   |
> price_with_tax  |
> tax_amount  |
> tax_percentage  |
> tax_auth_party_id   |
> tax_auth_geo_id |
> tax_in_price| Y
> created_date| 2018-04-17 12:49:20.416+05:30
> created_by_user_login   | admin
> last_modified_date  | 2018-04-17 12:49:20.416+05:30
> last_modified_by_user_login | admin
> last_updated_stamp  | 2018-04-17 12:49:20.416+05:30  <
> Generated by defaults.
> last_updated_tx_stamp   | 2018-04-17 12:49:20.357+05:30
> created_stamp   | 2018-04-17 12:49:20.416+05:30
> created_tx_stamp| 2018-04-17 12:49:20.357+05:30
>
>
> On Tue, Apr 17, 2018 at 2:39 PM, Deepak Dixit  com> wrote:
>
>> 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 
>> 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 > >
>> > 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.
>> 

Re: help with updateProductPrice

2018-04-17 Thread Rajesh Mallah
Its PostgreSQL
regds


 below is a sample data :

SQL> select * from  ofbiz.product_price  where product_id='PROD_SW52D5H3EN'
order by created_date desc limit 1;

-[ RECORD 1 ]---+--
product_id  | PROD_SW52D5H3EN
product_price_type_id   | DEFAULT_PRICE
product_price_purpose_id| PURCHASE
currency_uom_id | INR
product_store_group_id  | _NA_
from_date   | 2018-04-17 12:49:20+05:30< This has
been put by me.
thru_date   |
price   | 121.000
term_uom_id | WT_kg
custom_price_calc_service   |
price_without_tax   |
price_with_tax  |
tax_amount  |
tax_percentage  |
tax_auth_party_id   |
tax_auth_geo_id |
tax_in_price| Y
created_date| 2018-04-17 12:49:20.416+05:30
created_by_user_login   | admin
last_modified_date  | 2018-04-17 12:49:20.416+05:30
last_modified_by_user_login | admin
last_updated_stamp  | 2018-04-17 12:49:20.416+05:30  <
Generated by defaults.
last_updated_tx_stamp   | 2018-04-17 12:49:20.357+05:30
created_stamp   | 2018-04-17 12:49:20.416+05:30
created_tx_stamp| 2018-04-17 12:49:20.357+05:30


On Tue, Apr 17, 2018 at 2:39 PM, Deepak Dixit <
deepak.di...@hotwaxsystems.com> wrote:

> 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 
> 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 
> > 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"
> > 

Re: help with updateProductPrice

2018-04-17 Thread Deepak Dixit
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 
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 
> wrote:
>
> > Thanks Rishi.
> >
> > On Tue, Apr 17, 2018 at 2:08 PM, Rishi Solanki 
> > 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")
> >> >
> >> >
> >> > 
> >> >
> >> >   
> >> > fromDate
> >> > 
> >> >   
> >> > 
> >> >   
> >> >
> >> > 
> >> >
> >> >
> >> >
> >> >
> >> > 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 
> >> > >>
> >> > >> On Mon, Apr 16, 2018 at 11:42 PM, Rajesh Mallah <
> >> > mallah.raj...@gmail.com>
> >> > >> wrote:
> >> > >>
> >> > >> > Hi ,
> >> > >> >
> >> > >> > I am calling
> >> > >> >
> >> 

Re: help with updateProductPrice

2018-04-17 Thread Rajesh Mallah
 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 
wrote:

> Thanks Rishi.
>
> On Tue, Apr 17, 2018 at 2:08 PM, Rishi Solanki 
> 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 
>> 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")
>> >
>> >
>> > 
>> >
>> >   
>> > fromDate
>> > 
>> >   
>> > 
>> >   
>> >
>> > 
>> >
>> >
>> >
>> >
>> > 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 > >
>> > > 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 
>> > >>
>> > >> 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",
>> > >> > 

Re: help with updateProductPrice

2018-04-17 Thread Rajesh Mallah
Thanks Rishi.

On Tue, Apr 17, 2018 at 2:08 PM, Rishi Solanki 
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 
> 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")
> >
> >
> > 
> >
> >   
> > fromDate
> > 
> >   
> > 
> >   
> >
> > 
> >
> >
> >
> >
> > regds
> > mallah.
> >
> >
> > On Tue, Apr 17, 2018 at 11:08 AM, Rajesh Mallah  >
> > 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 
> > > 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 
> > >>
> > >> 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 = , Line 69null
> > >> >
> > >> >
> > >> > the minilang def is reproduced here for convinience:
> > >> >
> > >> >   > >> short-description="Update
> > >> > an ProductPrice">
> > >> > 
> > >> > 
> > >> >  > >> > xml-resource="component://product/minilang/product/
> > >> > product/ProductServices.xml"/>
> > >> > 
> > >> >  > >> > property="ProductPriceMaintPermissionError"/>
> > >> > 
> > >> > 
> > >> >
> > >> > 
> > >> >
> > >> >  > >> > value-field="lookedUpValue"/>
> > >> >
> > >> > 
> > >> >  > >> > result-name="oldPrice"/>
> > >> >
> > >> >  > value-field="lookedUpValue"/>
> > >> >
> > >> > 
> > >> >  > >> > from-field="nowTimestamp"/>
> > >> >  > >> > from-field="userLogin.userLoginId"/>
> > >> >
> > >> > 
> > >> >  
> > >> >
> > >> > The productID does exists in Entity ProductPrice
> > >> > Where am I going wrong ?
> > >> >
> > >> > thanks & regds
> > >> > Rajesh Mallah.
> > >> >
> > >>
> > >
> > >
> >
>


Re: help with updateProductPrice

2018-04-17 Thread Rishi Solanki
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 
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")
>
>
> 
>
>   
> fromDate
> 
>   
> 
>   
>
> 
>
>
>
>
> regds
> mallah.
>
>
> On Tue, Apr 17, 2018 at 11:08 AM, Rajesh Mallah 
> 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 
> > 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 
> >>
> >> 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 = , Line 69null
> >> >
> >> >
> >> > the minilang def is reproduced here for convinience:
> >> >
> >> >   >> short-description="Update
> >> > an ProductPrice">
> >> > 
> >> > 
> >> >  >> > xml-resource="component://product/minilang/product/
> >> > product/ProductServices.xml"/>
> >> > 
> >> >  >> > property="ProductPriceMaintPermissionError"/>
> >> > 
> >> > 
> >> >
> >> > 
> >> >
> >> >  >> > value-field="lookedUpValue"/>
> >> >
> >> > 
> >> >  >> > result-name="oldPrice"/>
> >> >
> >> >  value-field="lookedUpValue"/>
> >> >
> >> > 
> >> >  >> > from-field="nowTimestamp"/>
> >> >  >> > from-field="userLogin.userLoginId"/>
> >> >
> >> > 
> >> >  
> >> >
> >> > The productID does exists in Entity ProductPrice
> >> > Where am I going wrong ?
> >> >
> >> > thanks & regds
> >> > Rajesh Mallah.
> >> >
> >>
> >
> >
>


Re: help with updateProductPrice

2018-04-17 Thread Rajesh Mallah
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")




  
fromDate

  

  






regds
mallah.


On Tue, Apr 17, 2018 at 11:08 AM, Rajesh Mallah 
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 
> 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 
>>
>> On Mon, Apr 16, 2018 at 11:42 PM, Rajesh Mallah 
>> 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 = , Line 69null
>> >
>> >
>> > the minilang def is reproduced here for convinience:
>> >
>> >  > short-description="Update
>> > an ProductPrice">
>> > 
>> > 
>> > > > xml-resource="component://product/minilang/product/
>> > product/ProductServices.xml"/>
>> > 
>> > > > property="ProductPriceMaintPermissionError"/>
>> > 
>> > 
>> >
>> > 
>> >
>> > > > value-field="lookedUpValue"/>
>> >
>> > 
>> > > > result-name="oldPrice"/>
>> >
>> > 
>> >
>> > 
>> > > > from-field="nowTimestamp"/>
>> > > > from-field="userLogin.userLoginId"/>
>> >
>> > 
>> >  
>> >
>> > The productID does exists in Entity ProductPrice
>> > Where am I going wrong ?
>> >
>> > thanks & regds
>> > Rajesh Mallah.
>> >
>>
>
>


Re: help with updateProductPrice

2018-04-16 Thread Rajesh Mallah
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 
wrote:

> Hi Rajesh,
>
> If you want to create product price you should use createProductPrice
> service,
> https://demo-stable.ofbiz.apache.org/webtools/control/
> ServiceList?sel_service_name=createProductPrice
>
> If productPrice record already exists you should use updateProductPrice,
>
> Thanks & Regards
> --
> Deepak Dixit
> Director of Product Engineering
> HotWax Commerce 
>
> On Mon, Apr 16, 2018 at 11:42 PM, Rajesh Mallah 
> 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 = , Line 69null
> >
> >
> > the minilang def is reproduced here for convinience:
> >
> >   short-description="Update
> > an ProductPrice">
> > 
> > 
> >  > xml-resource="component://product/minilang/product/
> > product/ProductServices.xml"/>
> > 
> >  > property="ProductPriceMaintPermissionError"/>
> > 
> > 
> >
> > 
> >
> >  > value-field="lookedUpValue"/>
> >
> > 
> >  > result-name="oldPrice"/>
> >
> > 
> >
> > 
> >  > from-field="nowTimestamp"/>
> >  > from-field="userLogin.userLoginId"/>
> >
> > 
> >  
> >
> > The productID does exists in Entity ProductPrice
> > Where am I going wrong ?
> >
> > thanks & regds
> > Rajesh Mallah.
> >
>


Re: help with updateProductPrice

2018-04-16 Thread Rajesh Mallah
Thanks .

This is possibly the reason , shall check and confirm.
However it is difficult to match datetime fields *exactly*
when integrating external systems .

regds
mallah.

On Tue, Apr 17, 2018 at 10:25 AM, Akash Jain 
wrote:

> Hello Mallah,
>
> As you want to update product price then all primary key (productId,
> fromDate, currencyUomId, productPricePurposeId, productPriceTypeId and
> productStoreGroupId) of ProductPrice should be matched (A ProductPrice
> record should exist with all matching primary key you passed).
> lookedUpValue will always be null at Line 64 if any primary key of
> ProductPrice not matched.
>
> Thanks and Regards
> --
> Akash Jain
>
> On Mon, Apr 16, 2018 at 11:42 PM, Rajesh Mallah 
> wrote:
>
> > Hi ,
> >
> > I am calling
> >
> > https://demo-stable.ofbiz.apache.org/webtools/control/Servic
> > eList?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/m
> > inilang/product/price/PriceServices.xml,
> > Element = , Line 69null
> >
> >
> > the minilang def is reproduced here for convinience:
> >
> >   short-description="Update
> > an ProductPrice">
> > 
> > 
> >  > xml-resource="component://product/minilang/product/product/
> > ProductServices.xml"/>
> > 
> >  > property="ProductPriceMaintPermissionError"/>
> > 
> > 
> >
> > 
> >
> >  > value-field="lookedUpValue"/>
> >
> > 
> >  > result-name="oldPrice"/>
> >
> > 
> >
> > 
> >  > from-field="nowTimestamp"/>
> >  > from-field="userLogin.userLoginId"/>
> >
> > 
> >  
> >
> > The productID does exists in Entity ProductPrice
> > Where am I going wrong ?
> >
> > thanks & regds
> > Rajesh Mallah.
> >
>


Re: help with updateProductPrice

2018-04-16 Thread Akash Jain
Hello Mallah,

As you want to update product price then all primary key (productId,
fromDate, currencyUomId, productPricePurposeId, productPriceTypeId and
productStoreGroupId) of ProductPrice should be matched (A ProductPrice
record should exist with all matching primary key you passed).
lookedUpValue will always be null at Line 64 if any primary key of
ProductPrice not matched.

Thanks and Regards
--
Akash Jain

On Mon, Apr 16, 2018 at 11:42 PM, Rajesh Mallah 
wrote:

> Hi ,
>
> I am calling
>
> https://demo-stable.ofbiz.apache.org/webtools/control/Servic
> eList?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/m
> inilang/product/price/PriceServices.xml,
> Element = , Line 69null
>
>
> the minilang def is reproduced here for convinience:
>
>  
> 
> 
>  xml-resource="component://product/minilang/product/product/
> ProductServices.xml"/>
> 
>  property="ProductPriceMaintPermissionError"/>
> 
> 
>
> 
>
>  value-field="lookedUpValue"/>
>
> 
>  result-name="oldPrice"/>
>
> 
>
> 
>  from-field="nowTimestamp"/>
>  from-field="userLogin.userLoginId"/>
>
> 
>  
>
> The productID does exists in Entity ProductPrice
> Where am I going wrong ?
>
> thanks & regds
> Rajesh Mallah.
>


Re: help with updateProductPrice

2018-04-16 Thread Deepak Dixit
Hi Rajesh,

If you want to create product price you should use createProductPrice
service,
https://demo-stable.ofbiz.apache.org/webtools/control/ServiceList?sel_service_name=createProductPrice

If productPrice record already exists you should use updateProductPrice,

Thanks & Regards
--
Deepak Dixit
Director of Product Engineering
HotWax Commerce 

On Mon, Apr 16, 2018 at 11:42 PM, Rajesh Mallah 
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 = , Line 69null
>
>
> the minilang def is reproduced here for convinience:
>
>  
> 
> 
>  xml-resource="component://product/minilang/product/
> product/ProductServices.xml"/>
> 
>  property="ProductPriceMaintPermissionError"/>
> 
> 
>
> 
>
>  value-field="lookedUpValue"/>
>
> 
>  result-name="oldPrice"/>
>
> 
>
> 
>  from-field="nowTimestamp"/>
>  from-field="userLogin.userLoginId"/>
>
> 
>  
>
> The productID does exists in Entity ProductPrice
> Where am I going wrong ?
>
> thanks & regds
> Rajesh Mallah.
>