Hello,
I want to retrieve available hours so i can put a booking rule on the universal resource schedule board when execute my query it return this error : Expression expected at position 0 in ''.
this is my code
var parameters = {}; parameters.ResourceId = "8BF4DC80-6E5C-E911-A974-000D3A391A6A"; parameters.Start = JSON.stringify(new Date("06/10/2019 03:30:00").toISOString()); parameters.End = JSON.stringify(new Date("06/12/2019 08:00:00").toISOString()); var timecodes1 = {}; timecodes1 = "Microsoft.Dynamics.CRM.TimeCode.Available"; parameters.TimeCodes = [timecodes1]; var queryScheduleRequest = { ResourceId: parameters.ResourceId, Start: parameters.Start, End: parameters.End, TimeCodes: parameters.TimeCodes, getMetadata: function() { return { boundParameter: null, parameterTypes: { "ResourceId": { "typeName": "Edm.Guid", "structuralProperty": 1 }, "Start": { "typeName": "Edm.DateTimeOffset", "structuralProperty": 1 }, "End": { "typeName": "Edm.DateTimeOffset", "structuralProperty": 1 }, "TimeCodes": { "typeName": "Collection(mscrm.TimeCode)", "structuralProperty": 4 } }, operationType: 1, operationName: "QuerySchedule" }; } }; debugger; Xrm.WebApi.online.execute(queryScheduleRequest).then( function success(result) { if (result.ok) { debugger; var results = JSON.parse(result.responseText); return results; } }, function(error) { debugger; Xrm.Utility.alertDialog(error.message); } );
this is my rest api builder screenshot :
i don't know what should i put in the red circle
*This post is locked for comments