
i did a switch case code to get an attribute type and do something for each type; but when i try to get attribute type of a date it syas that it doesnt exist
how do i get the date type to know how to enter the right case in the switch ?
fieldType = Xrm.Page.getAttribute(fieldDestination[index]).getAttributeType();
switch (fieldType)
{
case "lookup":
do something
break;
case "string":
do something
break;
case "optionset":
do something
break;
case "": // what should be here for date type? how to get the date AttributeType to know how to get here in this case?
do something
break;
default:
console.log(fieldType "Unkown");
break;
} Hi Partner,
You need use 'datetime' to get attribute type of a date.
getAttributeType (Client API reference) - Power Apps | Microsoft Docs
Test: