how to update a field value?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

how to update a field value?

edward wang
Hi, Folks,

in the orderstatus.bsh file.

oii = orderItems.iterator();

    while (oii.hasNext()) {
        oitem = oii.next();

        String itDes = oitem.getString("itemDescription");
...........................
}

I want to update itemDescription value.  I tried to use

 oitem.updateString("itemDescription", "®");

but threw the exceptions:

Method updateString( java.lang.String, java.lang.String ) not found in
class'org.ofbiz.entity.GenericValue'))

Could you tell me how to update itemDescription of orderitem?

Thanks

Chwang
Reply | Threaded
Open this post in threaded view
|

Re: how to update a field value?

BJ Freeman
https://demo-trunk.ofbiz.apache.org/webtools/control/FindGeneric?entityName=OrderItem&find=true&VIEW_SIZE=50&VIEW_INDEX=0
orderItem does not have that field.
that is in ProductContent.
handy feature is to use the relationships to navigate what has what.
https://demo-trunk.ofbiz.apache.org/webtools/control/ViewRelations?entityName=OrderItem
the other way is to find how EditProductContent page references it
https://demo-trunk.ofbiz.apache.org/catalog/control/EditProductContent?productId=WG-9943


=========================
BJ Freeman
http://bjfreeman.elance.com
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>

Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man
Linkedin
<http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro>


chaohua wang sent the following on 6/29/2010 9:02 AM:

> Hi, Folks,
>
> in the orderstatus.bsh file.
>
> oii = orderItems.iterator();
>
>      while (oii.hasNext()) {
>          oitem = oii.next();
>
>          String itDes = oitem.getString("itemDescription");
> ...........................
> }
>
> I want to update itemDescription value.  I tried to use
>
>   oitem.updateString("itemDescription", "&#174;");
>
> but threw the exceptions:
>
> Method updateString( java.lang.String, java.lang.String ) not found in
> class'org.ofbiz.entity.GenericValue'))
>
> Could you tell me how to update itemDescription of orderitem?
>
> Thanks
>
> Chwang
>

Reply | Threaded
Open this post in threaded view
|

Re: how to update a field value?

BJ Freeman
forget this post.

=========================
BJ Freeman
http://bjfreeman.elance.com
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>

Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man
Linkedin
<http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro>


BJ Freeman sent the following on 6/29/2010 9:32 AM:

> https://demo-trunk.ofbiz.apache.org/webtools/control/FindGeneric?entityName=OrderItem&find=true&VIEW_SIZE=50&VIEW_INDEX=0
>
> orderItem does not have that field.
> that is in ProductContent.
> handy feature is to use the relationships to navigate what has what.
> https://demo-trunk.ofbiz.apache.org/webtools/control/ViewRelations?entityName=OrderItem
>
> the other way is to find how EditProductContent page references it
> https://demo-trunk.ofbiz.apache.org/catalog/control/EditProductContent?productId=WG-9943
>
>
>
> =========================
> BJ Freeman
> http://bjfreeman.elance.com
> Strategic Power Office with Supplier Automation
> <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
> Specialtymarket.com <http://www.specialtymarket.com/>
>
> Systems Integrator-- Glad to Assist
>
> Chat Y! messenger: bjfr33man
> Linkedin
> <http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro>
>
>
>
> chaohua wang sent the following on 6/29/2010 9:02 AM:
>> Hi, Folks,
>>
>> in the orderstatus.bsh file.
>>
>> oii = orderItems.iterator();
>>
>> while (oii.hasNext()) {
>> oitem = oii.next();
>>
>> String itDes = oitem.getString("itemDescription");
>> ...........................
>> }
>>
>> I want to update itemDescription value. I tried to use
>>
>> oitem.updateString("itemDescription", "&#174;");
>>
>> but threw the exceptions:
>>
>> Method updateString( java.lang.String, java.lang.String ) not found in
>> class'org.ofbiz.entity.GenericValue'))
>>
>> Could you tell me how to update itemDescription of orderitem?
>>
>> Thanks
>>
>> Chwang
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: how to update a field value?

Bilgin Ibryam-2
In reply to this post by edward wang
oitem is a GenericValue object, you have to use the methods of this object.
Use setString(key, value) instead.

Bilgin

On Tue, Jun 29, 2010 at 5:02 PM, chaohua wang <[hidden email]> wrote:

> Hi, Folks,
>
> in the orderstatus.bsh file.
>
> oii = orderItems.iterator();
>
>    while (oii.hasNext()) {
>        oitem = oii.next();
>
>        String itDes = oitem.getString("itemDescription");
> ...........................
> }
>
> I want to update itemDescription value.  I tried to use
>
>  oitem.updateString("itemDescription", "&#174;");
>
> but threw the exceptions:
>
> Method updateString( java.lang.String, java.lang.String ) not found in
> class'org.ofbiz.entity.GenericValue'))
>
> Could you tell me how to update itemDescription of orderitem?
>
> Thanks
>
> Chwang
>