.............
var resourceId = (sbContext.newValues.ResourceId !== undefined) ? sbContext.newValues.ResourceId : "";
var resourceReqId = (sbContext.newValues.ResourceRequirementId !== undefined) ? sbContext.newValues.ResourceRequirementId : "";
var timeDependency = formContext.getAttribute("wwsl_timedependency").getValue();
var bookingStatus = formContext.getAttribute("bookingstatus").getValue();
var rr = Xrm.Page.getAttribute('msdyn_resourcerequirements');
if (rr != null && rr.getValue() != null && rr.getValue().length > 0) {
resourceReqId = rr.getValue()[0].id;
}
var resourceId = sbContext.newValues.ResourceId;
var startTime = sbContext.newValues.StartTime;
var endTime = sbContext.newValues.EndTime;
if() {
ruleResult.IsValid = true;
ruleResult.Message = "Success";
ruleResult.Type = 'success';
}
else {
ruleResult.IsValid = false;
ruleResult.Message = "For Multiple Resource Bookings, Time Dependency is selected as" + timeDependency
resourceReqId , resourceId , startTime - endTime;
ruleResult.Type = 'warning';
}
alert("End Business Rule ...");
return ruleResult;
}
function actionInputParameters(ctx) {
'use strict';
var inputParameters = {};
inputParameters = {
"bookingstartdate": ctx.newValues.StartTime,
"bookingenddate": ctx.newValues.EndTime,
"newBookableResource": ctx.newValues.ResourceId
};
return JSON.stringify(inputParameters);
}
I wrote like this but I'm not sure. If booking status is for ex. ABC, this alert should be come. can you help me please.