Does anyone have an example of a web resource used to create a booking rule in Field Resource? Also- is RSO the only way to avoid stacking bookings on top of each other when work orders are scheduled automatically?
Sorry, I made a new website a little while ago. Here is my new webiste - www.daymandynamics.com
Lads, can we post code as well as the links!!
For anyone who wanders across this I managed to track down the site. And here's the code being referred to:
function newBookingRule(sbContext) { debugger; var ruleResult = { IsValid: false, Message: '', Type: 'error' }; var resourceReqId = sbContext.newValues.ResourceRequirementId; var workOrderId = null; var req = new XMLHttpRequest(); req.open("GET", encodeURI(Xrm.Page.context.getClientUrl() + "/api/data/v8.2/msdyn_resourcerequirements(" + resourceReqId + ")?$select=_msdyn_workorder_value"), false); req.setRequestHeader("Accept", "application/json"); req.setRequestHeader("Content-Type", "application/json;charset=utf-8"); req.setRequestHeader("OData-MaxVersion", "4.0"); req.setRequestHeader("OData-Version", "4.0"); req.setRequestHeader("Prefer", "odata.include-annotations=OData.Community.Display.V1.FormattedValue"); req.send(); if (req.readyState === 4) { req.onreadystatechange = null; if (req.status === 200) { var result = JSON.parse(req.response); workOrderId = result["_msdyn_workorder_value"]; } else { Xrm.Utility.alertDialog(req.statusText); } } if (workOrderId != null) { ruleResult.IsValid = true; ruleResult.Message = "Success"; ruleResult.Type = 'success'; alert("WorkOrder Id: " + workOrderId); } else { ruleResult.IsValid = false; ruleResult.Message = 'No WorkOrder Id found'; ruleResult.Type = 'error'; } return ruleResult; }
Hi Matthew,
I made a blog post on how to use a booking rule - http://www.kentom.co.uk/?p=455
You could use a booking rule to stop overlapping ;)
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... 290,900 Super User 2024 Season 2
Martin Dráb 229,297 Most Valuable Professional
nmaenpaa 101,156