02 Jul, 2025
Posted on 02 Jul, 2025 by Rohit Bhagat, Posted in Dataverse Dynamics 365
Blogs
Introduction:
In Dynamics 365, adding icons to view cells based on field values can make the interface more user-friendly and visually clear. Instead of reading text, users can quickly understand the status or type of a record just by looking at the icon. This small change can improve data visibility and speed up decision-making
Step:

///namespace NISL { export namespace AccountView { export function displayIconForStatusReason(rowData: string, userLCID: number): [string, string] { try { const parsedData = JSON.parse(rowData); const statusCode = parsedData.statuscode_Value; let imgName = ""; let tooltip = ""; if (statusCode == 1) { imgName = "nisl_/icon/YellowSquare"; tooltip ="Active"; } else if (statusCode == 665000001) { imgName = "nisl_/icon/RedSquare"; tooltip = "Pending"; } else if (statusCode == 665000002) { imgName = "nisl_/icon/GreenSquare"; tooltip = "Completed"; } return [imgName, tooltip]; } catch (error) { console.error("Error parsing rowData or accessing profit value", error); return ["", "Error"]; } } } }



Comment