How to determine an Entity field type?

Posts   
 
    
chi
User
Posts: 3
Joined: 01-Oct-2019
# Posted on: 12-Dec-2019 15:23:16   

I am trying to do something like :

if (newEntity.Fields["fieldName"].DataType is decimal) { ... }

Is there a way to do this in C#?

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 12-Dec-2019 22:18:46   

Use type testing directly on the field:

if (newEntity.FieldName is decimal)
{ ... }