Default length for value field is 255 in CSANSWERS table. We are getting cast error after we extend DAC to 500. Since the field is shared with different control types. So what could I do to extent the field length to allow longer text for Text type attribute? Thanks.
Solved
How to extend Attribute field length
Best answer by Naveen Boga
Hi
public class InventoryItemMaint_Extension : PXGraphExtension<PX.Objects.IN.InventoryItemMaint>
{
[PXAttributeValue]
[PXUIField(DisplayName = "Value")]
//[CSAttributeValueValidation(typeof(CSAnswers.attributeID))]
[PXPersonalDataFieldAttribute.Value]
public void CSAnswers_Value_CacheAttached(PXCache sender)
{
}
#endregion
internal class PXAttributeValueAttribute : PXDBStringAttribute
{
public PXAttributeValueAttribute() : base()
{
IsUnicode = true;
}
public override void FieldUpdating(PXCache sender, PXFieldUpdatingEventArgs e)
{
if (e.NewValue is DateTime)
e.NewValue = Convert.ToString(e.NewValue, CultureInfo.InvariantCulture);
base.FieldUpdating(sender, e);
}
}
}
ALTER TABLE CSAnswers ALTER COLUMN Value [nvarchar](Max) ;
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.