Find list of CDT/record types in the application that uses specific data type

Certified Senior Developer

I'm trying to get the list of the custom data types that uses date and time field in it, from the whole application. Kindly post your suggestions, Thank you.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    If you can find a way to get the list of CDTs, you could do this

    a!localVariables(
      local!CDTList: {
        'type!{urn:com:appian:types:S}S_COM_35103'()
      },
      a!forEach(
        items: local!CDTList,
        expression: a!localVariables(
          local!CDT: fv!item,
          local!CDTTypeName: typename(typeof(local!CDT)),
          local!keys: a!keys(local!CDT),
          a!forEach(
            items: local!keys,
            expression: a!localVariables(
              local!field: fv!item,
              local!fieldType: typeof(index(local!CDT, local!field, null)),
              local!fieldTypeName: typename(local!fieldType),
              if(
                local!fieldType = 9,
                a!map(
                  entityName: local!CDTTypeName,
                  fieldName: local!field,
                  fieldType: local!fieldType,
                  fieldTypeName: local!fieldTypeName
                ),
                {}
              )
            )
          )
        )
      )
    )

Reply
  • 0
    Certified Lead Developer

    If you can find a way to get the list of CDTs, you could do this

    a!localVariables(
      local!CDTList: {
        'type!{urn:com:appian:types:S}S_COM_35103'()
      },
      a!forEach(
        items: local!CDTList,
        expression: a!localVariables(
          local!CDT: fv!item,
          local!CDTTypeName: typename(typeof(local!CDT)),
          local!keys: a!keys(local!CDT),
          a!forEach(
            items: local!keys,
            expression: a!localVariables(
              local!field: fv!item,
              local!fieldType: typeof(index(local!CDT, local!field, null)),
              local!fieldTypeName: typename(local!fieldType),
              if(
                local!fieldType = 9,
                a!map(
                  entityName: local!CDTTypeName,
                  fieldName: local!field,
                  fieldType: local!fieldType,
                  fieldTypeName: local!fieldTypeName
                ),
                {}
              )
            )
          )
        )
      )
    )

Children