I have an object array in Javascript but it kept showing as undefined when I try to fetch a specific value.
May I know how can I read the values in the array?
Thank you.
function approveOrRejectTRF(primaryControl) {
'use strict';
if (!primaryControl) { return; }
var formContext = primaryControl;
var Id = formContext.data.entity.getId();
var pageInput = {
pageType: "webresource",
webresourceName: "hsl_/html/TravelRequest/ApproveRejectButtonHtml.html",
data: "&EntityId=" + Id
};
var navigationOptions = {
target: 2,
width: 800,
height: 450,
position: 1,
title: "Approve/Reject"
};
Xrm.Navigation.navigateTo(pageInput, navigationOptions).then(
function success(returnValue) {
console.log(returnValue);
console.log("Action : " + returnValue[0].actionVal);
console.log("Comments : " + returnValue[0].commentsVal);
},
function error(e){
// Handle errors
}
);
}