Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Tuned Listener
Posts: 9
Registered: ‎12-05-2009

Java class & SLX Mobile question

Hi,

 

Very time-sensitive question. Hope somebody is around today.

 

I have to default some values for the underlying db table as part of the Mobile 5.5 page save in order for computations to work when they are opened in our customized web page for Opportunities. I have tried a few methods and found soemthing that works for presetting fields already visible on the form within the BaseOpportunity class as in  

businessObject.setProperty(TableManager.RESERVED_COLUMN_NAME_varname) , but what I still need to set are 3 more fields not present on the mobile form and in the customized opportunity table in the db.

 

Here I am stuck, it seems that maybe there is a function in the sage.mobile.common.BusinessObject class, but I cannot seem to find where to look for that. When I search the server folders, all that turns up are other files that reference it with import lines. Google turns up zip as does the forum search. Reasonably new to Java and Mobile, which compounds the problem, and was up half the night running dozens of permutations to no avail.

 

Any pointers to where the class is lurking so I can try to take a look at it or is there some other method that would get this done? 

 

Thanks in advance,

Paul

Tuned Listener
Posts: 9
Registered: ‎12-05-2009

Re: Java class & SLX Mobile question

Ok, located the jar files and which ones have the class files I am interested in. When I open the file, I get gibberish. Any recommended tool to view the contents?

Employee
Posts: 5
Registered: ‎09-01-2009

Re: Java class & SLX Mobile question

Hi Paul,

 

This can be done use in formshow for new opportunities with the following code:

public void formShow()throws SageMobileException

{

 

super.formshow();

if (!super.new)

{

// some code....

}

 

  // Set value to default.
  
   
   SetFieldValue("Potential", "100");
   SetFieldValue("probability", "50");
      
   CMPEditField xyz1 = (CMPEditField)super.getControl("Potential");
   String xyz2 = xyz1.getValue();
   double xyz3 = Double.parseDouble(xyz2); 
   
   CMPEditField abc1 = (CMPEditField)super.getControl("probability");
   String abc2 = abc1.getValue();
   double abc3 = Double.parseDouble(abc2);
   
   double total = xyz3 * abc3;
      
   SetFieldValue("Desc", " "+total);
  

}

 

/////////////////////////////////

 

The above example will allow to set some values for form fields, when user will add a new opportunity. I have tested with the available fields on Opportunity, you can add your custom fields instead.

 

Hope this helps.

 

Thanks

 

Alshah