Maximo Wire - The IBM Maximo Help & Discussion Forum
May 24, 2012, 09:16:30 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to Maximo Wire, the IBM Maximo help forum. Feel free to register and ask any Maximo related questions you like.
 
  Home Help Search Login Register  
*
Pages: 1 [2]   Go Down
  Print  
Author Topic: Calculate the result dynamically before save......  (Read 2477 times)
0 Members and 3 Guests are viewing this topic.
vijet
Jr. Member
**

Karma: 5
Posts: 56



View Profile Email
« Reply #15 on: August 13, 2008, 03:45:49 pm »

Hi Guys,

Thanks a million........ with all your help i was able to get the values...  Smiley

Your suggessions were very good and helped me a lot..........

and amdisuk   i will see that i follow the java rules while coding...... Wink

MboRemote CompRecord =result.getMbo(0);

Should be

MboRemote compRecord =result.getMbo(0);


Thanks
Vijet
Logged
amdisuk
Administrator
Full Member
*****

Karma: -1
Posts: 199


allandonaldson@hotmail.com
View Profile WWW
« Reply #16 on: August 13, 2008, 10:10:40 pm »

Glad we could help!!!! Grin

See that you come back and ask qustions or answer questions!!!!

Thats how the forum will work!!!!
Logged

Big Al
vijet
Jr. Member
**

Karma: 5
Posts: 56



View Profile Email
« Reply #17 on: August 14, 2008, 05:35:30 am »

Sure i will be a part of this forum now....

By the way the only changes i made thanks to you both is removing the save which i was using and also used the sum() method ... that eliminated the for loop and also i could do everything in the fld class...
i will post the last working code as this might be usefull for a newbee like me........

MboRemote mbo = (ComponentsMBO)getMboValue().getMbo();
double precost = 0;
MboValue Estcost = getMboValue();
if(mbo instanceof ComponentsMBO)
{
precost = ((ComponentsMBO)Estcost.getMbo()).getThisMboSet().sum("ESTCOST");
MboRemote compRecord=mbo.getOwner();
String setval = Double.toString(precost); /* b'cos the field where i set is ALN */
compRecord.setValue("COSTSUMMARY", setval);
}

I could finish the coding in four lines... !!
Logged
aashish
Newbie
*

Karma: 0
Posts: 4


View Profile
« Reply #18 on: December 09, 2010, 06:02:45 am »

Hi Frns ,
I am also trying to same concept ,
bt my problem is with mbosetremote ....its nt fetching value at "itemcost" field ..value is coming only zero evrytime...
Pls Sugggest me..
==============================================================================
                    SqlFormat sqlf2 = new SqlFormat("1=2");
                    Mbo mbo=getMboValue().getMbo();
                              MboRemote mboremote = mbo.getOwner();                                 //owner is Asset
               MboSetRemote ttcost = mboremote.getMboSet("$client", "CLIENT", sqlf2.format());
                 
               if(mbo != null )      
         {                       
            double assetcost=mboremote.getDouble("totalitemcost");
                                double displayitemcost=mboremote.getDouble("itemcost");             // nt fetching value,alws coming 0 value
                 double totalcost=ttcost.sum("itemcost");                                 // nt fetching value,alws coming 0 value
                           double diffcost=Math.abs(assetcost-totalcost);
                                                 
                             Object param[] = {            diffcost  };
================================================================================================
Logged
Pages: 1 [2]   Go Up
  Print  
 
Jump to:  

Recent

TinyPortal v1.0 beta 4 © Bloc
Powered by MySQL Powered by PHP Powered by SMF 1.1.15 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!