Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Add Resource Group to Service

$
0
0

Hello,

I would like to add a resource group to a service instead of the resources within the group, which my code seems to be doing

My resource spec looks like this

var resourceSpec = new ResourceSpec {
    BusinessUnitId = new EntityReference(BusinessUnit.EntityLogicalName, businessUnitId),
    ObjectiveExpression = @"<Expression><Body>udf ""Random""(factory,resource,appointment,request,leftoffset,rightoffset)</Body><Parameters><Parameter name=""factory"" /><Parameter name=""resource"" /><Parameter name=""appointment"" /><Parameter name=""request"" /><Parameter name=""leftoffset"" /><Parameter name=""rightoffset"" /></Parameters><Properties EvaluationInterval=""P0D"" evaluationcost=""0"" /></Expression>",
    RequiredCount = 1,
    Name = "Selection Rule",
    GroupObjectId = groupId
};

and my service looks like this

var service = new Service {
    Name = name,
    Duration = duration,
    InitialStatusCode = new OptionSetValue(1),
    Granularity = $"FREQ=MINUTELY;INTERVAL={duration};",
    ResourceSpecId = new EntityReference(ResourceSpec.EntityLogicalName, resourceSpecId)
};

All of my code is straight from the plumber van example.

Any help would be really appreciated.

Mark


Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>