Skip to main content
Answer

ver-21.114.0030

  • January 10, 2022
  • 1 reply
  • 96 views

Forum|alt.badge.img

Hi,

In Unit of Measure SCreen am trying to increase the ‘FromUnit’ and ‘ToUnit’ field length from nvarchar(6) to nvarchar(15) 

and am able to change from backend but am trying customize that field DAC Level but its throwing an error

 

 

#region FromUnit  
        [PXMergeAttributes(Method = MergeMethod.Append)]
        [PXDBString(15,IsUnicode =true,IsFixed =true)]
        public string FromUnit { get; set; }
        #endregion
        protected virtual void INUnit_FromUnit_CacheAttached(PXCache Sender)
        {
        }
        #region ToUnit 

        [PXMergeAttributes(Method = MergeMethod.Append)]
        [PXDBString(15, IsUnicode = true, IsFixed = true)]
        public string ToUnit { get; set; }
        #endregion
        
        protected virtual void INUnit_ToUnit_CacheAttached(PXCache Sender)
        {
        }

Best answer by Naveen Boga

Hi @FarhanaM60  We can not achieve this requirement for now, since there are many calculations involved. Below comment I have updated in the previous post.

 

The above issue, which you are getting with the CacheAttached event for UOM field.

Here are more details.

  • INUnit DAC → ToUnit Field, used INUnitAttribute and there is logic related unit conversions, we can not simply replace with the PXDBString(15, Isunicode = true)
  • Due to the some calculations in the INUnitAttribute, hence getting the Casting i.e. Decimal to String.
  • I will recommend you to raise a support ticket to increase the length of INUnitAttribute 

 

Also, there is an idea also posted to consider this feature in the future. Please find the link here.

 

Hope this information will help you!!

1 reply

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • Answer
  • January 10, 2022

Hi @FarhanaM60  We can not achieve this requirement for now, since there are many calculations involved. Below comment I have updated in the previous post.

 

The above issue, which you are getting with the CacheAttached event for UOM field.

Here are more details.

  • INUnit DAC → ToUnit Field, used INUnitAttribute and there is logic related unit conversions, we can not simply replace with the PXDBString(15, Isunicode = true)
  • Due to the some calculations in the INUnitAttribute, hence getting the Casting i.e. Decimal to String.
  • I will recommend you to raise a support ticket to increase the length of INUnitAttribute 

 

Also, there is an idea also posted to consider this feature in the future. Please find the link here.

 

Hope this information will help you!!