简体   繁体   中英

openbravo callout to use OBDal.getInstance .save Not working

I Have Applied Logic on all the row which i get in the list in eclipse console i got the correct result everything is fine ,but now i just want to set the value again here my code in openbravo callout

for (ShipmentType st_op : cp.getOCAShipmentTypeList()) {

    String val = st_op.getName().substring(0, 3);

    System.out.println(val);
    Exist = val.concat(String.valueOf(CountTot));

    System.out.println("Existing Value Change : " + Exist);
    st_op.setName(Exist);
    OBDal.getInstance().save(st_op);
  }

here is a result cosole after adding 3 rd record :

2011
2
4022
3
201
Existing Value Change : 2013
402
Existing Value Change : 4023
3
4H
3
3
4H33

I just can'nt set and save with OBDal

OBDal.getInstance().save(st_op);

I Got my Work Done By Statement as:

    ShipmentType st = OBProvider.getInstance().get(ShipmentType.class);
    for (ShipmentType st_op : cp.getOCAShipmentTypeList()) {

    String val = st_op.getName().substring(0, 3);

    System.out.println(val);
    Exist = val.concat(String.valueOf(CountTot));

    System.out.println("Existing Value Change : " + Exist);
    st_op.setName(Exist);

  }


    OBDal.getInstance().save(st);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM