I have what we call an "Interesting Moment" entity which pulls activity data from our marketing system into our Dynamics system (2016/365 on prem). Also pulled from marketing is a urgency and a relative score which is kept on the contact entity record. I have a web resource that displays on contact entity list views the relative score and urgency in the form of icons displaying how hot or cold the contact is based on various marketing scores. I want to display these same graphics on any interesting moment list views relating the value from the contact record. The web resource works fine on the contact entity, but does not function when the field is a related entity. I checked the rowData and saw that on the related entity pull it's affixing the contact entity GUID before the field name. Where on the contact entity the field is mkt_relativescore_Value on the related pull it is a_79b92758721ee91180dc00155d649803.mkt_relativescore_Value. However if I hardcode my web resource to look at a_79b92758721ee91180dc00155d649803.mkt_relativescore_Value then it doesn't function at all on the related entity. The rowData displays the value correctly, but the coldata will not properly apply that value to select the proper image. My code is as follows:
function bestbetstaricons(rowData) {
var str = JSON.parse(rowData);
var coldata = str.a_79b92758721ee91180dc00155d649803.mkt_relativescore_Value;
var imgName = "";
var tooltip = "";
switch (parseInt(coldata,10)) {
case 1:
imgName = "star1";
tooltip = "Medium Quality";
break;
case 2:
imgName = "star2";
tooltip = "Good Quality";
break;
case 3:
imgName = "star3";
tooltip = "Best Quality";
break;
default:
imgName = "star0";
tooltip = "Low Quality";
break;
}
var resultarray = [imgName, tooltip];
return resultarray;
}
Any Suggestions as to why my code might not be functioning properly?
*This post is locked for comments
Figured it out. The key was having to do a full replace on the entire line with the field name as it is on the Contact entity. as so:
function bestbetfireicons(rowData) {
rowData = rowData.replace('"a_79b92758721ee91180dc00155d649803.mkt_urgency_Value"','"mkt_urgency_Value"');
var str = JSON.parse(rowData);
var coldata = str.mkt_urgency_Value;
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156