Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions XrmOrg/XrmOrg.XrmSolution/BusinessLogic/Helpers/HelperPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,32 @@ public static T GetEntity<T>

return entity.ToEntity<T>();
}
/// <summary>
///
/// </summary>
/// <param name="context"></param>
/// <param name="trace"></param>
/// <returns></returns>
public static Guid? GetSubordinateId
(IPluginExecutionContext context, ITracingService trace)
{
if (!context.InputParameters.Contains("SubordinateId"))
{
trace.Trace("Context does not contain 'SubordinateId'");
return null;
}

if (!(context.InputParameters["SubordinateId"] is Guid?))
{
var typeName = context.InputParameters["SubordinateId"].GetType().Name;
trace.Trace("'SubordinateId' is not an Guid. It's of type: {0}", typeName);
return null;
}

var subordinateId = (Guid?)context.InputParameters["SubordinateId"];

return subordinateId;
}

public static Tuple<EntityReference, OptionSetValue, OptionSetValue>
GetEntityMoniker<T>(IPluginExecutionContext context, ITracingService trace)
Expand Down