anchor.diff:      ("9C5CA0A1-AB4D-4781-BE7E-8DFBE867B87E", Timer)
     ] |> List.map (fun (id,t) -> id.ToUpper(), t) |> Map.ofList
       
  -let getAttribute (enums:Map<string,TsType>) (_, attrName, controlClass) =
  +let getAttributeType (entity: XrmEntity) name =
  +  let attribute =
  +    entity.attributes
  +    |> List.tryFind (fun a -> a.logicalName = name)
  +
  +  match attribute with
  +  | None -> TsType.Undefined
  +  | Some a -> a.varType
  +
  +let getAttribute (enums:Map<string,TsType>) entity (_, attrName, controlClass) =
     if String.IsNullOrEmpty attrName then None else 
  +  
  +  let attrType = getAttributeType entity attrName
   
     let aType = 
  +    if attrType = TsType.Boolean && controlClass = ControlClassId.Picklist then AttributeType.OptionSet TsType.Boolean else
       match controlClass with
       | Picklist 
       | StatusReason  -> AttributeType.OptionSet (enums.TryFind(attrName) ?| TsType.Number)
  
positive.code:         |> Map.ofList
          
        formData.[em.logicalName]
        |> Array.Parallel.map (interpretFormXml enums (bpfControls.TryFind em.logicalName)))
      |> Array.concat
    |> dict
negative.code:     formType = enum<FormType>(typeInt).ToString() |> Utility.sanitizeString |> Some
      attributes = 
        controlFields @ compositeFields @ bpfFields
        |> List.choose (getAttribute enums entity)
        |> List.distinctBy fst
        |> List.sortBy fst
  
      controls = 
        controlFields @ compositeFields @ bpfFields
        |> List.choose (getControl enums entity)
        |> renameControls
        |> List.sortBy (fun (name, _, _) -> name)
  
  