
12-05-2009 11:02 AM
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_C
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
12-05-2009 11:27 AM
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?
12-08-2009 08:24 AM
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