09-24-2015 11:23 AM
Hi
apologies if this has been discussed before but I couldn't find anything when searching through previous posts.
I have created a custom entity, created a series of fields and these are saved to the database correctly and I can save data to these fields for contacts...and all seems good with the world
When I created these fields I added attibutes :
var field = new FieldDescriptor("Min Weight", "MIN_WEIGHT", descriptor, FieldDataType.Decimal); field.Attributes[FieldProperty.DecimalPrecision] = new Act.Framework.Database.CurrencyPrecisionAttribute(leftPrecision, rightPrecision); Framework.Fields.Save(actField);
Now I want to get the value of these attibutes, so for instance I want to know the left & right precision of "Min Weight".
What is the best method to achieve this?
Thanks in advance.
09-24-2015 11:32 AM
Something like the following should work
Act.Framework.Database.DecimalPrecisionAttribute att = (Act.Framework.Database.DecimalPrecisionAttribute)field.Attributes[FieldProperty.DecimalPrecision]; MessageBox.Show(att.LeftPrecision.ToString());
09-24-2015 11:32 AM
Something like the following should work
Act.Framework.Database.DecimalPrecisionAttribute att = (Act.Framework.Database.DecimalPrecisionAttribute)field.Attributes[FieldProperty.DecimalPrecision]; MessageBox.Show(att.LeftPrecision.ToString());
09-25-2015 04:54 AM
Thanks Ashan, that worked for me