cancel
Showing results for 
Search instead for 
Did you mean: 

Maximum length for Simple Type

Former Member
0 Kudos

Hi All,

i have defined a simple type of the built-in type double, the representation format is like follows: #,##0.00

As you can guess it is a price representation for the format like 1,000.99

If i enter a value like 1,000.9999999 and after that i switch fields/change tabs/whatever the framework nicely rounds the entered value to the format that is defined.

Whenever you enter a negative value of dont use the dot in a wrong way you cannot execute the action because of the validation that takes place, but when i enter the same value (1,000.9999999) and click the button to execute the action it takes the wrong format.

What would be a good solution for this problem? Setting a max length for the simple type (how?). Is it a bug in the validation of the framework?

Any help is appreciated! Thanks!

Accepted Solutions (0)

Answers (3)

Answers (3)

venkatakalyan_karanam
Active Contributor
0 Kudos

Hi

You can set the length according to your requirement.I just send the sample

You can set it to 20 ,,,,,,,,,,,,10 any digit.That will work.

Regards

Kalyan

venkatakalyan_karanam
Active Contributor
0 Kudos

Hi Koevotoes

May be this code will helps you

The following code will set the maximum length for that particulat field.

ISimpleTypeModifiable basePayPercentage3 = wdContext.wdGetAPI().

getModifiableTypeOf("<Node Name>.<Attribule Name>");

basePayPercentage3.setMaxExternalLength(3);

Like this you can set the maximum length for a particular Attr which is binded to Some UI element.

Thanks and Regards

kalyan

Former Member
0 Kudos

It seems to me that the code sets the max. length for the whole field to 3. This will not work for me. Since people can enter as many digits as they want before the dot. So it can be 1.99 to something like 1,000,000.95. So a setting a length does not work in this case...

Former Member
0 Kudos

Hi,

Specify the type of the simple type as Decimal instead of double and set the total(max) number of digits(including fractional part, "'" and ".") you want to have and also specify out of this total number how many digits for fractional part.

I think this will suffice your requirement.

Warm Regards,

Murtuza

Message was edited by:

Murtuza Kharodawala

Former Member
0 Kudos

Thanks for all the input folks. Im parking this incident for now... im looking for other possibilities...

Former Member
0 Kudos

Hi

You can use

Minimum Inclusives

Maximum Inclusives

Minimum Exclusives

Maximum Exclusives

Regards

Abhijith YS

Former Member
0 Kudos

This is only to set minum and maximum values. Like the minimum inclusive is set to 0, so that users cannot enter negative values.

Im more looking for a termination character like in regular expressions.

Message was edited by:

M. Koevoets