Can I set a default field value of an EntityProxy? - gwt

Say I have this:
TimeEntryProxy timeEntry = someRequestContext.create(TimeEntryProxy.class);
The created proxy is empty. Is there a way to set some of it's fields with a default value? For example, this proxy has a timeAllocation which is a double. Can it be set to 0 without having to do this:
timeEntry.setTimeAllocation(0);
Thank you

How about setting default values in your custom Locator.create(Class c) method?

Related

Mixing lod and non-lod calculations

I have a data set that looks like this:
I want to use a parameter to select a value from Group and then compute Ratio which is Value divided by Value when Group == parameter. The image above is the desired output when the parameter equals D.
I thought that this would do the trick:
[Value]/{EXCLUDE [GROUP]: MAX(VALUE)}
But I just get nulls.
Thanks for your help!
LOD expressions dont work that way and they will always show as null values in the datasource page. Here is the Documentation. (Bullet point 2)
For your case, create the parameter as shown below. (You can use 'Paste from clipboard' as by default only values can be assigned by field and not 'Display As'.)
Now your calculation simply becomes
[Value]/[Selected_Group]

Chosen Jquery Plugin - setting multiple values

I want to set multiple values like this:
$('#field-partners').val("1,7,9");
$('#field-partners').trigger("chosen:updated");
but it's not working..
I can only set one value like this :
$('#field-partners').val("1");
$('#field-partners').trigger("chosen:updated");
How can I set multiple values ?
I figured it out,this is the answer:
$('#field-partners').val(['7','9','11']);
$('#field-partners').trigger("chosen:updated");

How make default value validation?

I have created an input(text) element which has a default value 'Email'. Label to field was deleted.
How to validate the text field to see if it contains the default value?
Thnx!
You can use the Identical validator, passing your default value as the string to compare against.

SSRS date default with formula disables parameter

When I set a default value formula for a date parameter in SSRS, such as:
=CDate(”01/” & Month(Now) & “/” & Year(Now))
or even:
=Now
the date parameter control becomes disabled with nothing in it. Does anyone know what simple thing (I am sure) I am doing wrong?
After playing some more, I realized that the date controls became enabled when I picked a value from a preceding dropdown parameter that did not have a default. Apparently, controls after non-default parameters are disabled until you pick something, so order matters.
From an MDSN article:
"parameter order is important when you want to show users the default value for one parameter before they choose values for other parameters"
http://msdn.microsoft.com/en-us/library/cc281392.aspx
I experienced the same and the problems lies on the USER ID parameter that I set to internal visibility but without any default value. When I put in default value or set this to null, the date parameter was enabled.. (User ID parameter comes before the date parameter on my case)
Now is a function and you must use like =Now()
maybe it is your problem.

Axapta: Edit form field values

Using a 'clicked' override on a button, I'd like to modify values in an Axapta form.
I'm able to get data from the form field using:
str strOld = Form_FieldName.valueStr();
I'm able to prepend text to the field using:
Form_FieldName.pasteText(strNew);
I can't seem to find a .clear method or .value= method. I'd like to replace the entire value in the field with new information.
Thanks
If the field is bound to a datasource, you have to modify the value in the datasource. If the field is bound to a variable, then modify the value of the variable itself. It is the easy an smart way to do it.
You can modify the value in the form control by using the .text() method. (The control have to be the AutoDeclaration property set to Yes). This is a setter-getter (parameter) type method used in AX. If no parameter is passed, it is user as getter (read). If you pass a value, this is a setter (write).
Hope this helps.