Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
ZooY committed Feb 13, 2020
1 parent 4dac376 commit 3616377
Show file tree
Hide file tree
Showing 32 changed files with 117 additions and 49 deletions.
4 changes: 2 additions & 2 deletions Source/Tools/E-mail/E-mail/E-mail.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
<HintPath>..\..\..\packages\PZone.SDK.XRM.Plugins.8.0.1.0\lib\net452\PZone.SDK.Xrm.Plugins.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="PZone.SDK.Xrm.Workflow, Version=8.0.3.0, Culture=neutral, PublicKeyToken=4394d41fdc99a9c8, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\PZone.SDK.XRM.Workflow.8.0.3.0\lib\net452\PZone.SDK.Xrm.Workflow.dll</HintPath>
<Reference Include="PZone.SDK.Xrm.Workflow, Version=8.0.3.1, Culture=neutral, PublicKeyToken=4394d41fdc99a9c8, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\PZone.SDK.XRM.Workflow.8.0.3.1\lib\net452\PZone.SDK.Xrm.Workflow.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Activities" />
Expand Down
6 changes: 3 additions & 3 deletions Source/Tools/E-mail/E-mail/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Programming Zone")]
[assembly: AssemblyProduct("CRM Tools")]
[assembly: AssemblyCopyright("Copyright © 2017-2019 Programming Zone")]
[assembly: AssemblyCopyright("Copyright © 2017-2020 Programming Zone")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("8.0.2.0")]
[assembly: AssemblyFileVersion("8.0.2.0")]
[assembly: AssemblyVersion("8.0.3.1")]
[assembly: AssemblyFileVersion("8.0.3.1")]
10 changes: 9 additions & 1 deletion Source/Tools/E-mail/E-mail/Workflow/Send.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,20 @@ public class Send : WorkflowBase
public InArgument<EntityReference> Email { get; set; }


/// <summary>
/// Выполнение запросов в CRM от имени системного пользователя.
/// </summary>
[Input("Execute as SYSTEM User")]
public InArgument<bool> ExecureAsSystem { get; set; }


/// <inheritdoc />
protected override void Execute(Context context)
{
var emailRef = Email.Get(context);
var request = new SendEmailRequest { EmailId = emailRef.Id, TrackingToken = "", IssueSend = true };
context.Service.Execute(request);
var service = ExecureAsSystem.Get(context) ? context.SystemService : context.Service;
service.Execute(request);
}
}
}
2 changes: 1 addition & 1 deletion Source/Tools/E-mail/E-mail/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
<package id="PZone.SDK.Core" version="1.1.0.0" targetFramework="net452" />
<package id="PZone.SDK.XRM" version="8.0.3.0" targetFramework="net452" />
<package id="PZone.SDK.XRM.Plugins" version="8.0.1.0" targetFramework="net452" />
<package id="PZone.SDK.XRM.Workflow" version="8.0.3.0" targetFramework="net452" />
<package id="PZone.SDK.XRM.Workflow" version="8.0.3.1" targetFramework="net452" />
</packages>
4 changes: 2 additions & 2 deletions Source/Tools/Entity/Entity/Entity.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
<HintPath>..\..\..\packages\PZone.SDK.XRM.8.0.3.0\lib\net452\PZone.SDK.Xrm.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="PZone.SDK.Xrm.Workflow, Version=8.0.3.0, Culture=neutral, PublicKeyToken=4394d41fdc99a9c8, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\PZone.SDK.XRM.Workflow.8.0.3.0\lib\net452\PZone.SDK.Xrm.Workflow.dll</HintPath>
<Reference Include="PZone.SDK.Xrm.Workflow, Version=8.0.3.1, Culture=neutral, PublicKeyToken=4394d41fdc99a9c8, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\PZone.SDK.XRM.Workflow.8.0.3.1\lib\net452\PZone.SDK.Xrm.Workflow.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Activities" />
Expand Down
6 changes: 3 additions & 3 deletions Source/Tools/Entity/Entity/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Programming Zone")]
[assembly: AssemblyProduct("CRM Tools")]
[assembly: AssemblyCopyright("Copyright © 2017-2019 Programming Zone")]
[assembly: AssemblyCopyright("Copyright © 2017-2020 Programming Zone")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("8.0.2.0")]
[assembly: AssemblyFileVersion("8.0.2.0")]
[assembly: AssemblyVersion("8.0.3.1")]
[assembly: AssemblyFileVersion("8.0.3.1")]
10 changes: 9 additions & 1 deletion Source/Tools/Entity/Entity/Workflow/CreateAnnotation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ public class CreateAnnotation : WorkflowBase
/// </summary>
[Input("File Content (BASE64 Encoding)")]
public InArgument<string> FileBase64Content { get; set; }


/// <summary>
/// Выполнение запросов в CRM от имени системного пользователя.
/// </summary>
[Input("Execute as SYSTEM User")]
public InArgument<bool> ExecureAsSystem { get; set; }


/// <inheritdoc />
Expand All @@ -81,7 +88,8 @@ protected override void Execute(Context context)
entity["mimetype"] = FileMimeType.Get(context);
entity["documentbody"] = FileBase64Content.Get(context);
}
context.Service.Create(entity);
var service = ExecureAsSystem.Get(context) ? context.SystemService : context.Service;
service.Create(entity);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ public class CreateAnnotationWithTextFile : WorkflowBase
/// </summary>
[Input("File Content")]
public InArgument<string> FileContent { get; set; }


/// <summary>
/// Выполнение запросов в CRM от имени системного пользователя.
/// </summary>
[Input("Execute as SYSTEM User")]
public InArgument<bool> ExecureAsSystem { get; set; }


/// <inheritdoc />
Expand All @@ -84,7 +91,8 @@ protected override void Execute(Context context)
entity["mimetype"] = FileMimeType.Get(context);
entity["documentbody"] = string.IsNullOrWhiteSpace(content) ? "" : Convert.ToBase64String(Encoding.UTF8.GetBytes(content));
}
context.Service.Create(entity);
var service = ExecureAsSystem.Get(context) ? context.SystemService : context.Service;
service.Create(entity);
}
}
}
8 changes: 8 additions & 0 deletions Source/Tools/Entity/Entity/Workflow/Delete.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,19 @@ public class Delete : WorkflowBase
[RequiredArgument]
[Input("Entity GUID")]
public InArgument<string> EntityId { get; set; }


/// <summary>
/// Выполнение запросов в CRM от имени системного пользователя.
/// </summary>
[Input("Execute as SYSTEM User")]
public InArgument<bool> ExecureAsSystem { get; set; }


/// <inheritdoc />
protected override void Execute(Context context)
{
var service = ExecureAsSystem.Get(context) ? context.SystemService : context.Service;
context.Service.Delete(EntityName.Get(context), Guid.Parse(EntityId.Get(context)));
}
}
Expand Down
12 changes: 11 additions & 1 deletion Source/Tools/Entity/Entity/Workflow/DeleteCurrent.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
using System.Activities;
using Microsoft.Xrm.Sdk.Workflow;
using PZone.Xrm.Workflow;


Expand All @@ -9,12 +11,20 @@ namespace PZone.EntityTools.Workflow
/// </summary>
public class DeleteCurrent : WorkflowBase
{
/// <summary>
/// Выполнение запросов в CRM от имени системного пользователя.
/// </summary>
[Input("Execute as SYSTEM User")]
public InArgument<bool> ExecureAsSystem { get; set; }


/// <inheritdoc />
protected override void Execute(Context context)
{
if (string.IsNullOrEmpty(context.EntityName) || context.EntityId == Guid.Empty)
return;
context.Service.Delete(context.EntityName, context.EntityId);
var service = ExecureAsSystem.Get(context) ? context.SystemService : context.Service;
service.Delete(context.EntityName, context.EntityId);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected override void Execute(Context context)
Properties = new MetadataPropertiesExpression { AllProperties = false, PropertyNames = { "LogicalName" } }
}
};
var response = (RetrieveMetadataChangesResponse)context.Service.Execute(retrieveMetadataChangesRequest);
var response = (RetrieveMetadataChangesResponse)context.SystemService.Execute(retrieveMetadataChangesRequest);
if (response.EntityMetadata.Count == 1)
EntityName.Set(context, response.EntityMetadata[0].LogicalName);
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Tools/Entity/Entity/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net452" />
<package id="PZone.SDK.Core" version="1.1.0.0" targetFramework="net452" />
<package id="PZone.SDK.XRM" version="8.0.3.0" targetFramework="net452" />
<package id="PZone.SDK.XRM.Workflow" version="8.0.3.0" targetFramework="net452" />
<package id="PZone.SDK.XRM.Workflow" version="8.0.3.1" targetFramework="net452" />
</packages>
4 changes: 2 additions & 2 deletions Source/Tools/FetchXML/FetchXML/FetchXML.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
<HintPath>..\..\..\packages\PZone.SDK.XRM.8.0.3.0\lib\net452\PZone.SDK.Xrm.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="PZone.SDK.Xrm.Workflow, Version=8.0.3.0, Culture=neutral, PublicKeyToken=4394d41fdc99a9c8, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\PZone.SDK.XRM.Workflow.8.0.3.0\lib\net452\PZone.SDK.Xrm.Workflow.dll</HintPath>
<Reference Include="PZone.SDK.Xrm.Workflow, Version=8.0.3.1, Culture=neutral, PublicKeyToken=4394d41fdc99a9c8, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\PZone.SDK.XRM.Workflow.8.0.3.1\lib\net452\PZone.SDK.Xrm.Workflow.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Activities" />
Expand Down
6 changes: 3 additions & 3 deletions Source/Tools/FetchXML/FetchXML/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Programming Zone")]
[assembly: AssemblyProduct("CRM Tools")]
[assembly: AssemblyCopyright("Copyright © 2017-2019 Programming Zone")]
[assembly: AssemblyCopyright("Copyright © 2017-2020 Programming Zone")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("8.0.2.0")]
[assembly: AssemblyFileVersion("8.0.2.0")]
[assembly: AssemblyVersion("8.0.3.1")]
[assembly: AssemblyFileVersion("8.0.3.1")]
5 changes: 3 additions & 2 deletions Source/Tools/FetchXML/FetchXML/Workflow/AssignOwner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ public abstract class AssignOwner : FetchXmlWorkflow

protected void Execute(Context context, EntityReference ownerRef)
{
var service = ExecureAsSystem.Get(context) ? context.SystemService : context.Service;
var fetchXml = FetchXml.Get(context);
var entities = context.Service.RetrieveMultiple(fetchXml).Entities;
var entities = service.RetrieveMultiple(fetchXml).Entities;
var affectedEntities = 0;
foreach (var entity in entities)
{
try
{
var request = new AssignRequest { Assignee = ownerRef, Target = entity.ToEntityReference() };
context.Service.Execute(request);
service.Execute(request);
affectedEntities++;
}
catch (Exception ex)
Expand Down
4 changes: 3 additions & 1 deletion Source/Tools/FetchXML/FetchXML/Workflow/Average.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ protected override void Execute(Context context)
if (string.IsNullOrWhiteSpace(query))
return;

var result = context.Service.RetrieveMultiple(query);
var service = ExecureAsSystem.Get(context) ? context.SystemService : context.Service;

var result = service.RetrieveMultiple(query);
if (result.Entities.Count < 1)
return;

Expand Down
4 changes: 3 additions & 1 deletion Source/Tools/FetchXML/FetchXML/Workflow/Count.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ protected override void Execute(Context context)
if (string.IsNullOrWhiteSpace(query))
return;

var result = context.Service.RetrieveMultiple(query);
var service = ExecureAsSystem.Get(context) ? context.SystemService : context.Service;

var result = service.RetrieveMultiple(query);
ResultAsDecimal.Set(context, result.Entities.Count);
ResultAsDouble.Set(context, Convert.ToDouble(result.Entities.Count));
ResultAsInteger.Set(context, Convert.ToInt32(result.Entities.Count));
Expand Down
8 changes: 4 additions & 4 deletions Source/Tools/FetchXML/FetchXML/Workflow/Delete.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ protected override void Execute(Context context)
if (string.IsNullOrWhiteSpace(query))
return;

var entities = context.Service.RetrieveMultiple(query).Entities;
var service = ExecureAsSystem.Get(context) ? context.SystemService : context.Service;

var entities = service.RetrieveMultiple(query).Entities;

FindedCount.Set(context, entities.Count);

Expand All @@ -56,9 +58,7 @@ protected override void Execute(Context context)
{
Target = entity.ToEntityReference()
}));

var service = context.SourceActivityContext.GetExtension<IOrganizationServiceFactory>().CreateOrganizationService(null);


var responses = (ExecuteMultipleResponse)service.Execute(request);
if (!responses.IsFaulted)
{
Expand Down
7 changes: 7 additions & 0 deletions Source/Tools/FetchXML/FetchXML/Workflow/FetchXmlWorkflow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,12 @@ public abstract class FetchXmlWorkflow : WorkflowBase
[RequiredArgument]
[Input("FetchXML Query")]
public InArgument<string> FetchXml { get; set; }


/// <summary>
/// Выполнение запросов в CRM от имени системного пользователя.
/// </summary>
[Input("Execute as SYSTEM User")]
public InArgument<bool> ExecureAsSystem { get; set; }
}
}
4 changes: 3 additions & 1 deletion Source/Tools/FetchXML/FetchXML/Workflow/Median.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ protected override void Execute(Context context)
if (string.IsNullOrWhiteSpace(query))
return;

var result = context.Service.RetrieveMultiple(query);
var service = ExecureAsSystem.Get(context) ? context.SystemService : context.Service;

var result = service.RetrieveMultiple(query);
if (result.Entities.Count < 1)
return;

Expand Down
3 changes: 2 additions & 1 deletion Source/Tools/FetchXML/FetchXML/Workflow/Sum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public class Sum : FetchXmlWorkflow
protected override void Execute(Context context)
{
var query = FetchXml.Get(context);
var result = context.Service.RetrieveMultiple(query);
var service = ExecureAsSystem.Get(context) ? context.SystemService : context.Service;
var result = service.RetrieveMultiple(query);
if (result.Entities.Count < 1)
return;

Expand Down
4 changes: 3 additions & 1 deletion Source/Tools/FetchXML/FetchXML/Workflow/Value.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ protected override void Execute(Context context)
if (string.IsNullOrWhiteSpace(query))
return;

var result = context.Service.RetrieveMultiple(query);
var service = ExecureAsSystem.Get(context) ? context.SystemService : context.Service;

var result = service.RetrieveMultiple(query);
if (result.Entities.Count < 1)
return;

Expand Down
2 changes: 1 addition & 1 deletion Source/Tools/FetchXML/FetchXML/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net452" />
<package id="PZone.SDK.Core" version="1.1.0.0" targetFramework="net452" />
<package id="PZone.SDK.XRM" version="8.0.3.0" targetFramework="net452" />
<package id="PZone.SDK.XRM.Workflow" version="8.0.3.0" targetFramework="net452" />
<package id="PZone.SDK.XRM.Workflow" version="8.0.3.1" targetFramework="net452" />
</packages>
4 changes: 2 additions & 2 deletions Source/Tools/File/File/File.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
<HintPath>..\..\..\packages\PZone.SDK.XRM.8.0.3.0\lib\net452\PZone.SDK.Xrm.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="PZone.SDK.Xrm.Workflow, Version=8.0.3.0, Culture=neutral, PublicKeyToken=4394d41fdc99a9c8, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\PZone.SDK.XRM.Workflow.8.0.3.0\lib\net452\PZone.SDK.Xrm.Workflow.dll</HintPath>
<Reference Include="PZone.SDK.Xrm.Workflow, Version=8.0.3.1, Culture=neutral, PublicKeyToken=4394d41fdc99a9c8, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\PZone.SDK.XRM.Workflow.8.0.3.1\lib\net452\PZone.SDK.Xrm.Workflow.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Activities" />
Expand Down
6 changes: 3 additions & 3 deletions Source/Tools/File/File/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Programming Zone")]
[assembly: AssemblyProduct("CRM Tools")]
[assembly: AssemblyCopyright("Copyright © 2017-2019 Programming Zone")]
[assembly: AssemblyCopyright("Copyright © 2017-2020 Programming Zone")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("8.0.2.0")]
[assembly: AssemblyFileVersion("8.0.2.0")]
[assembly: AssemblyVersion("8.0.3.1")]
[assembly: AssemblyFileVersion("8.0.3.1")]
Loading

0 comments on commit 3616377

Please sign in to comment.