Hi BJ89,
-> Firstly I retrieve all related contacts of current account, that because even thought deactivated contacts won't display in subgrid,
but both active and deactive contacts can be retrieved by Web API code.
I called this function getRelatedContacts.
-> Secondly, after I've retrived out list of contact records, then I create a HTML table to render result.(template function)
Due to we can distince active and deactive contacts by statecode record, (0 stands for active, 1 stands for inactive)
so in template function, by following code:
if (item["statecode"] === 1) {
html += "<tr style=\'background-color: #f3c869\'>';
} else {
html += "<tr>";
}
I render row background color(tr tag stands for a row) by checking statecode value in conditional statement.
if (item["statecode"] === 1) then give a color which stands for inactive/deactive status, #f3c869 looks like orange color,
you can change it to #ff0000, that's hex code for red color.
-> Finally, you could make a comparison between web resource result and subgrid result,
for example, create an test account record and add 5 contacts to this company, then deactivate 1 of them,
the expected result is that you can only see 4 contacts in account subgrid, but you can see all contacts in web resource,
and the deactivated contact record background will be colored.
Regards,
Clofly