Skip to content

Commit

Permalink
1.0.55.0 -
Browse files Browse the repository at this point in the history
New Feature: New 'Top Attachments (Most Recent)' as an input parameter to EntityAttachmentToEmail (thanks to https://github.com/gabrieljunckes)
New feature: New Output Parameter "Without Spaces" in String Functions:
New Feature: New Action ConcatenateFromQuery (thanks to https://github.com/rajrao)
Bug Fixed: QueryValues when attribute value1 is empty
Bug Fixed: SetProcessStage: fixed issue retreiving the entity schema name  (thanks to https://github.com/Robimbrie)
  • Loading branch information
Demian Adolfo Raschkovan committed May 1, 2019
1 parent 74b5c28 commit 925c33c
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 17 deletions.
Binary file modified msdyncrmWorkflowTools/.vs/msdyncrmWorkflowTools/v15/.suo
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected override void Execute(CodeActivityContext executionContext)
var tools = new msdyncrmWorkflowTools_Class(objCommon.service);

var children = tools.GetChildRecords(_relationshipName, parentId);

foreach (var item in children.Entities)
{
var newRecordId = objCommon.CloneRecord(item.LogicalName, item.Id.ToString(),fieldstoIgnore, prefix );
Expand All @@ -136,6 +136,7 @@ protected override void Execute(CodeActivityContext executionContext)
objCommon.service.Update(update);

}


}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ protected override void Execute(CodeActivityContext executionContext)
if (results.Entities.Count > 0)
{
objCommon.tracingService.Trace(String.Format("Setting results"));
if (results.Entities[0].Attributes[_Attribute1] != null)
if (results.Entities[0].Attributes.Contains(_Attribute1))
{
objCommon.tracingService.Trace(String.Format("Setting result1: {0}", results.Entities[0].Attributes[_Attribute1]));
if (results.Entities[0].Attributes[_Attribute1] is Microsoft.Xrm.Sdk.OptionSetValue)
Expand All @@ -142,7 +142,7 @@ protected override void Execute(CodeActivityContext executionContext)
this.ResultValue1.Set(executionContext, results.Entities[0].Attributes[_Attribute1].ToString());
}
}
if (results.Entities[0].Attributes[_Attribute2] != null)
if (results.Entities[0].Attributes.Contains(_Attribute2))
{
objCommon.tracingService.Trace(String.Format("Setting result2: {0}", results.Entities[0].Attributes[_Attribute2]));
if (results.Entities[0].Attributes[_Attribute2] is Microsoft.Xrm.Sdk.OptionSetValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ protected override void Execute(CodeActivityContext executionContext)
};
RetrieveProcessInstancesResponse procOpp1Resp = (RetrieveProcessInstancesResponse)objCommon.service.Execute(procOpp1Req);




// Declare variables to store values returned in response
Entity activeProcessInstance = null;
Guid _processOpp1Id = Guid.Empty;
Expand All @@ -117,13 +120,20 @@ protected override void Execute(CodeActivityContext executionContext)
// later to retrieve the active path of the process instance

Console.WriteLine("Current active process instance for the Opportunity record: '{0}'", activeProcessInstance["name"].ToString());
_procInstanceLogicalName = activeProcessInstance["name"].ToString().Replace(" ", string.Empty).ToLower();

// Get the BPF underlying entity logical name
var uniqueProcessNameAttribute = "uniquename";
var processEntity = objCommon.service.Retrieve("workflow", process.Id, new ColumnSet(uniqueProcessNameAttribute));
_procInstanceLogicalName = processEntity.Attributes[uniqueProcessNameAttribute].ToString();

//_procInstanceLogicalName = activeProcessInstance["name"].ToString().Replace(" ", string.Empty).ToLower(); // TO BE REMOVED: Incorrect as it only gets the display name.
}
else
{
Console.WriteLine("No process instances found for the opportunity record; aborting the sample.");
Environment.Exit(1);
}

objCommon.tracingService.Trace("Starting the update");
Entity processInstanceToUpdate= new Entity(_procInstanceLogicalName, _processOpp1Id);
processInstanceToUpdate.Attributes.Add("activestageid", new EntityReference("processstage", stageId.Value));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ public class StringFunctions : CodeActivity
[Output("Lowercase Text")]
public OutArgument<string> LowercaseText { get; set; }

[Output("Without Spaces")]
public OutArgument<string> WithoutSpaces { get; set; }

#endregion

protected override void Execute(CodeActivityContext executionContext)
Expand Down Expand Up @@ -143,12 +146,12 @@ protected override void Execute(CodeActivityContext executionContext)

string capitalizedText="", paddedText = "", replacedText = "", subStringText = "", regexText = "", uppercaseText = "", lowercaseText="";
bool regexSuccess=false;

string withoutSpaces = "";
msdyncrmWorkflowTools_Class commonClass = new msdyncrmWorkflowTools_Class(objCommon.service, objCommon.tracingService);
bool test=commonClass.StringFunctions(capitalizeAllWords, inputText, padCharacter, padontheLeft, finalLengthwithPadding, caseSensitive,
replaceOldValue, replaceNewValue, subStringLength, startIndex, fromLefttoRight, regularExpression,
ref capitalizedText, ref paddedText, ref replacedText, ref subStringText, ref regexText,
ref uppercaseText, ref lowercaseText, ref regexSuccess);
ref uppercaseText, ref lowercaseText, ref regexSuccess, ref withoutSpaces);



Expand All @@ -164,6 +167,8 @@ protected override void Execute(CodeActivityContext executionContext)
this.UppercaseText.Set(executionContext, uppercaseText);
this.LowercaseText.Set(executionContext, lowercaseText);

this.WithoutSpaces.Set(executionContext, withoutSpaces);

}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
// Puede especificar todos los valores o usar los valores predeterminados (número de compilación y de revisión)
// usando el símbolo '*' como se muestra a continuación:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.54.2")]
[assembly: AssemblyFileVersion("1.0.54.2")]
[assembly: AssemblyVersion("1.0.55.0")]
[assembly: AssemblyFileVersion("1.0.55.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Crm.Sdk.Proxy, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

<HintPath>..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.5\lib\net452\Microsoft.Crm.Sdk.Proxy.dll</HintPath>

<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\Devtools\Tools\PluginRegistration\Microsoft.Crm.Sdk.Proxy.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ public bool StringFunctions(bool capitalizeAllWords, string inputText, string pa
int finalLengthwithPadding, bool caseSensitive, string replaceOldValue, string replaceNewValue,
int subStringLength, int startIndex, bool fromLefttoRight, string regularExpression,
ref string capitalizedText, ref string paddedText, ref string replacedText, ref string subStringText, ref string regexText,
ref string uppercaseText, ref string lowercaseText, ref bool regexSuccess)
ref string uppercaseText, ref string lowercaseText, ref bool regexSuccess, ref string withoutSpaces)
{
capitalizedText = "";
if (capitalizeAllWords)
Expand Down Expand Up @@ -462,6 +462,8 @@ public bool StringFunctions(bool capitalizeAllWords, string inputText, string pa

uppercaseText = inputText.ToUpper();
lowercaseText = inputText.ToLower();

withoutSpaces = inputText.Replace(" ", "");
return true;

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
<ItemGroup>
<Reference Include="Microsoft.Crm.Sdk.Proxy, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>

<HintPath>..\packages\Microsoft.CrmSdk.CoreAssemblies.9.0.2.5\lib\net452\Microsoft.Crm.Sdk.Proxy.dll</HintPath>

<HintPath>..\..\..\..\..\..\..\Devtools\Tools\PluginRegistration\Microsoft.Crm.Sdk.Proxy.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.6.1.7600.16394\lib\net35\Microsoft.IdentityModel.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ public void StringFunctions1()
var classObj = new msdyncrmWorkflowTools_Class(objService.service);
string capitalizedText = "", paddedText = "", replacedText = "", subStringText = "", regexText = "", uppercaseText = "", lowercaseText = "";
bool regexSuccess = false;
string withoutSpaces = "";

bool test = classObj.StringFunctions(true, "Demian", "w", true, 150, true,
"w", "w", 150, 0, true, "w",
ref capitalizedText, ref paddedText, ref replacedText, ref subStringText, ref regexText,
ref uppercaseText, ref lowercaseText, ref regexSuccess);
ref uppercaseText, ref lowercaseText, ref regexSuccess, ref withoutSpaces);

Assert.AreEqual(capitalizedText, "Demian");
Assert.AreEqual(paddedText, "wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwDemian");
Expand All @@ -36,11 +37,12 @@ public void StringFunctions2()
var classObj = new msdyncrmWorkflowTools_Class(objService.service);
string capitalizedText = "", paddedText = "", replacedText = "", subStringText = "", regexText = "", uppercaseText = "", lowercaseText = "";
bool regexSuccess = false;
string withoutSpaces = "";

bool test = classObj.StringFunctions(true, "Demian", "w", true, 10, true,
"w", "w", 150, 0, true, "w",
ref capitalizedText, ref paddedText, ref replacedText, ref subStringText, ref regexText,
ref uppercaseText, ref lowercaseText, ref regexSuccess);
ref uppercaseText, ref lowercaseText, ref regexSuccess, ref withoutSpaces);

Assert.AreEqual(capitalizedText, "Demian");
Assert.AreEqual(paddedText, "wwwwDemian");
Expand Down

0 comments on commit 925c33c

Please sign in to comment.