title: PXDBScalar SOOrderKvExt attribute bool
body: <p>I'm trying to use PXDBScalar to bring in a boolean attribute from the Sales Order user defined fields tab to the Shipment screen.</p>
  <p>I found another stack overflow post that helped with the creation of the SOOrderKvExt DAC, and I am able to retrieve the value of the valueNumeric (decimal) field via my PXDBScalar attribute, but I cannot find a way to convert the value to a bool so it properly displays as a checkbox on the screen.  I tried setting the data type for my unbound field to bool, but got a data type conversion error.  I also tried leaving the field as a decimal and just changing the control type on the screen, but it always displays as checked regardless of the value.  Any idea how I can convert the decimal value to a bool in the PXDBScalar attribute or another solution?</p>
  <p>Code snippets provided below.</p>
  <p>SOOrderKvExt</p>
  <pre><code>[PXCacheName(&quot;SO Order Attributes&quot;)]
  [Serializable]
  public class SOOrderKvExt : IBqlTable
  {
      public abstract class recordID : BqlGuid.Field&lt;recordID&gt; { }
      [PXDBGuid(IsKey = true)]
      public Guid? RecordID { get; set; }
  
      public abstract class fieldName : BqlString.Field&lt;fieldName&gt; { }
      [PXDBString(50,IsKey = true)]
      [PXUIField(DisplayName =&quot;Name&quot;)]
      public string FieldName { get; set; }
  
      public abstract class valueNumeric : BqlDecimal.Field&lt;valueNumeric&gt; { }
      [PXDBDecimal(8)]
      [PXUIField(DisplayName = &quot;Value Numeric&quot;)]
      public decimal? ValueNumeric { get; set; }
  
      public abstract class valueDate : BqlDateTime.Field&lt;valueDate&gt; { }
      [PXDBDate]
      [PXUIField(DisplayName = &quot;Value Date&quot;)]
      public DateTime? ValueDate { get; set; }
  
      public abstract class valueString : BqlString.Field&lt;valueString&gt; { }
      [PXDBString(256)]
      [PXUIField(DisplayName = &quot;Value String&quot;)]
      public string ValueString { get; set; }
  
      public abstract class valueText : BqlString.Field&lt;valueText&gt; { }
      [PXDBString]
      [PXUIField(DisplayName = &quot;Value Text&quot;)]
      public string ValueText { get; set; }
  }  
    
    
  }
  </code></pre>
  <p>PXDBScalar</p>
  <pre><code>   #region UsrSOBlindShip
      [PXDecimal(8)]
      [PXUIField(DisplayName=&quot;SO Blind Ship&quot;, IsReadOnly=true)]
      [PXDBScalar(typeof(Search2&lt;SOOrderKvExt.valueNumeric,
          LeftJoin&lt;SOOrder, On&lt;SOOrder.noteID, Equal&lt;SOOrderKvExt.recordID&gt;&gt;,
          LeftJoin&lt;SOShipLine, On&lt;SOShipLine.origOrderNbr, Equal&lt;SOOrder.orderNbr&gt;&gt;&gt;&gt;,      
          Where&lt;SOShipLine.shipmentNbr, Equal&lt;SOShipment.shipmentNbr&gt;&gt;&gt;))]
      public virtual decimal? UsrSOBlindShip{ get; set; }
      public abstract class usrSOBlindShip: PX.Data.BQL.BqlDecimal.Field&lt;usrSOBlindShip&gt; { }
      #endregion 
  </code></pre>
  <p>Thanks
  Scott</p>