New release of Ultimate Workflow Toolkit is available.
On one hand this release contains a lot of new cool features. On the other this release is not directly compatible with earlier versions. I will provide guide that will describe how to install this version if you have earlier versions installed already.
Here is what I’ve done so far:
- I merged relationship-related (N-1 and N-N) operations with View-Oriented operations.
- Distribute Action feature was added. Configuration is not that easy though but it works perfectly and does what it should.
- Update of child records prepared based on configurable list of other entity/generic list of values.
- Geolocation of address using BingMaps services.
- Convertion of attachments from one format to another using CloudConvert service (up to 25 free conversions).
- Duplicate detection – results can be sent as a list of urls or embedded to an email as a table with results.
- Add Business Days to date with possibility to define weekends (for some countries weekends are Thursday-Friday or Friday-Saturday) and even holidays (you can use custom entity for storing of holidays plus FetchXml query to pass it inside Workflow Step).
Hi Andrii,
Thank you for sharing your awesome job with Ultimate Workflow Toolkit!
I tried to find examples how to use Ultimate Workflow Toolkit steps. For instance, UWT: Request Builder:Build Request From Entity. But could not find any user guide how to use it.
Do you have any use guide?
Thanks.
Best,
Aliona
Hello Aliona,
Documentation is on the way. I will work on it and you can find it on GitHub Wiki.
Thanks,
Andrew
Sounds great!
Look forward to reading all of it 🙂
Thanks,
Aliona
I would love to use this tool. Where is the documentation on GitHub Wiki?
I want to use this to Inactivate Connection records when the related entity record is Inactivated.
(e.g., when a Contact is Inactivated, Connections to the Contact would be inactivated). Thanks!
Hello Allison,
Wiki is available here – https://github.com/a33ik/UltimateWorkflowToolkit/wiki
Step that you need is “Cascade Status” and really similar scenario is described here – https://github.com/a33ik/UltimateWorkflowToolkit/wiki/Bulk-Operations—Cascade-Status
Feel free to try and live a comment if you experience any issues.
Andrew
Thanks for providing this tool. I created a new Process on our custom entity “Site” (et_site) to Start when: “Record status changes”. I added one step: “UWT: Bulk Operations: Cascade Status”
Properties of the step:
State Code for Child Record: 1, Status Code for Child Record: 2, Record: {Record URL(Dynamic)(Site)}, Relationship Name: et_site_connections2, Continue After First Error: True, Throw an Exception on Error: True.
I tried deactivating some Site (et_Site) records, but the Process was not triggered.
Allison,
Have you activated workflow?
Andrew
Yes, I activated the workflow before attempting to trigger it by Deactivating a record.
Can you please provide a screenshot of workflow execution log?
Where can I share a screenshot? Email address?
The Workflow Job Associated View shows:
“No System Job records are available in this view.”
Workflow Job Retention is set to not Automatically delete completed workflow jobs.
You can save screenshots here – https://snag.gy/
Can you please post screenshot of workflow as well? Are you online or onprem?
Thanks for your help on this, Andrew!
Workflow https://snag.gy/e5lXHJ.jpg
Step Detail https://snag.gy/IqiWjU.jpg
Process Sessions https://snag.gy/8WX15J.jpg
Try to change “Scope” to “Organization”.
YES! That worked! I was Deactivating a record I didn’t Own, so the process didn’t trigger. Changing it to Organization let the process run. The Cascading Inactivation of the related record worked! Happy Dance! Thank you!
I’m glad it was helpful.
Hi Andrew,
Great job and thank you very much.
I would like to ask about Multiselect OptionSet function, the usage of and how to use Get Field Label, Field Contains All Values, and difference between “Set Field Value” and “Add Values to Field”?
Best,
CRMist
Hello,
“Get Field Label” returns concatenated Labels of all Optionset values selected.
“Field Contains All Values” – returns boolean value that define if all values you passed to input selected in field.
Difference between “Set Field Value” and “Add Values to Field” – let’s assume that you have optionset with Red, Yellow and Green options and Red and Yellow are selected. If you use “Set Field Value” and pass “Green” then new field value will be just “Green” but if you add “Add” with the same “Green” – the result will be “Red”, “Yellow” and “Green”.
Thanks,
Andrew
thanks Andrew, now clear now.
A different question, is there a function to share secured fields? I have seen the one to share record, but i didnt see any for share secured fields. Did i miss anything?
Hello,
There are steps to share secured fields – UWT: Security: Share Secured Fields with User/Team.
Thanks,
Andrew
Great. Very handy step.
When i use the UWT: Security: Share Secured Fields with Team, i get this message:
Unhandled Exception: Microsoft.Crm.CrmException: System.NullReferenceException: Microsoft Dynamics CRM has experienced an error.
In the workflow properties, i made sure that all 6 columns are filled up – Team, Record Reference, Field List(with just one field schema name), Read Access, Write Access, and Throw error. Any idea why?
Hello,
Can I get a screenshot of step please?
Thanks,
Andrew
Hi Andrew,
Sure, i uploaded to https://ibb.co/cbbSZd
Now I test it out using UWT: Security: Share Secured Fields with User instead of Team, and get the NullReferenceException too.
Tha {Share FLS User(Account)} is a lookup field to user. The rest are self-explanatory.
Everything looks correct. Can you please turn on Plugin tracing here – https://www.powerobjects.com/2016/07/05/debugging-your-plug-ins-with-the-plug-in-trace-log/,
Run a workflow, open Plugin logs and send a copy of log here?
Hi Andrew,
the Message Block is empty, i pasted the Exception Details below:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.NullReferenceException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #588AA906Detail:
19b08594-f7a2-4c9a-a4ba-42654aa15ce7
-2147220970
System.NullReferenceException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #588AA906
2018-06-20T07:01:55.1278114Z
false
PluginExecution
System.Reflection.TargetInvocationException
at System.ComponentModel.ReflectPropertyDescriptor.GetValue(Object component)
at System.Activities.Activity.ReflectedInformation..ctor(Activity activity, ReflectedType reflectType)
at System.Activities.CodeActivity.CacheMetadata(CodeActivityMetadata metadata)
at System.Activities.CodeActivity.OnInternalCacheMetadata(Boolean createEmptyBindings)
at System.Activities.Activity.InternalCacheMetadata(Boolean createEmptyBindings, IList`1& validationErrors)
at System.Activities.ActivityUtilities.ProcessActivity(ChildActivity childActivity, ChildActivity& nextActivity, Stack`1& activitiesRemaining, ActivityCallStack parentChain, IList`1& validationErrors, ProcessActivityTreeOptions options, ProcessActivityCallback callback)
at System.Activities.ActivityUtilities.ProcessActivityTreeCore(ChildActivity currentActivity, ActivityCallStack parentChain, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors)
at System.Activities.ActivityUtilities.CacheRootMetadata(Activity activity, LocationReferenceEnvironment hostEnvironment, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors)
at System.Activities.Hosting.WorkflowInstance.ValidateWorkflow(WorkflowInstanceExtensionManager extensionManager)
at System.Activities.WorkflowApplication.EnsureInitialized()
at System.Activities.WorkflowApplication.Invoke(Activity activity, IDictionary`2 inputs, WorkflowInstanceExtensionManager extensions, TimeSpan timeout)
at System.Activities.WorkflowInvoker.Invoke(Activity workflow, IDictionary`2 inputs, TimeSpan timeout, WorkflowInstanceExtensionManager extensions)
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Crm.Sandbox.SandboxAppDomainHelper.Execute(IOrganizationServiceFactory organizationServiceFactory, String customActivityTypeName, IExecutionContext requestContext, Dictionary`2 sandboxServices, Boolean useDrawbridgeEnabled, Boolean chaosFailAppDomain)
at Microsoft.Crm.Sandbox.SandboxAppDomainHelper.Execute(IOrganizationServiceFactory organizationServiceFactory, String customActivityTypeName, IExecutionContext requestContext, Dictionary`2 sandboxServices, Boolean useDrawbridgeEnabled, Boolean chaosFailAppDomain)
at Microsoft.Crm.Sandbox.SandboxWorker.ExecuteCustomWorkflowActivity(SandboxCallInfo callInfo, SandboxCustomActivityExecutionContext requestContext, Guid pluginAssemblyId, Int32 sourceHash, String assemblyName, Guid pluginTypeId, String pluginTypeName, SandboxRequestCounter& workerCounter, Boolean returnTraceInfo)
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.Crm.Sandbox.ISandboxHost.ExecuteCustomWorkflowActivityAndReturnTraceInfo(SandboxCallInfo callInfo, SandboxCustomActivityExecutionContext requestContext, Guid pluginAssemblyId, Int32 sourceHash, String assemblyName, Guid pluginTypeId, String pluginTypeName, String assemblyContents, Boolean returnTraceInfo)
at Microsoft.Crm.Sandbox.SandboxCustomActivity.Execute(SandboxClient client, SandboxCallTracker callTracker, IExecutionContext requestContext, String assemblyContents, Boolean returnTraceInfo)
at Microsoft.Crm.Sandbox.SandboxCodeUnit.Execute(IExecutionContext context)
Hello,
This is weird that you get this error and log unfortunately doesn’t say a lot to me. What timezone are you at? I want to take a look at.
Andrew
Hi Andrew,
My time now is 11pm. So do you mean it is working fine in your enviroment? If yes, i will then try again in other environment.
Another question on UWT: Request Builder:Set Lookup Field 🙂
May i know is it right to just use this step to update a lookup field, by passing {id: “Record Guid”, entityType: “account”} to “Field Value” parameter?
I try not to publish anything that I haven’t tested successfully. So answer – yes, it was tested and considered as working as it was expected.
Regarding Request Builder: Set Lookup value – yes, it should work that way. But at the moment you can use Request Builder only for distributing of action among recordset or bulk update of recordset. If this is how you plan to use it – then it should work fine.
Please find release with bugfix – https://github.com/a33ik/UltimateWorkflowToolkit/releases/tag/v1.5.0.1
Hi Andrew, thanks! I almost want to open a issue request.
Go ahead and do it 🙂
Hello Andrew,
I’m trying to use your Distribute Workflow code but I’m not having much success.
I want to fire off a workflow on phonecalls after an account field is updated. I’ve selected my workflow in your plugins interface but I dont know what to put in the fields of “Record” and “Relationship Name”.
I think i have the Relationship Name correct with ‘Account_Phonecalls’ but the ‘Record’ field has me stumped.
I’ve tried these: phonecall, Phonecall, PhoneCall and Phonecalls.
No matter which one i try i get an error in the workflow: ype is not resolved for member ‘Newtonsoft.Json.JsonReaderException,….
Can you tell what I’m dong wrong?
thanks!
Hello Andrew,
I’m trying to use your Distribute Workflow code but I’m not having much success.
I want to fire off a workflow on phonecalls after an account field is updated. I’ve selected my workflow in your plugins interface but I dont know what to put in the fields of “Record” and “Relationship Name”.
I think i have the Relationship Name correct with ‘Account_Phonecalls’ but the ‘Record’ field has me stumped.
I’ve tried these: phonecall, Phonecall, PhoneCall and Phonecalls.
No matter which one i try i get an error in the workflow: Type is not resolved for member ‘Newtonsoft.Json.JsonReaderException,….
Can you tell what I’m dong wrong?
thanks!
Hello David,
To pass reference to record use “Dynamic Record Url” approach – https://github.com/a33ik/UltimateWorkflowToolkit/wiki/Record-Reference—polymorphic-lookup and I believe in your case it’ll be reference to account. Regarding Relationship – it should be N-N or 1-N relationship between Account and Phonecalls. Don’t try to guess – open default solution and find relationship name.
Andrew
Hi Andrew,
Thanks for the reply!
Yes, after I posted that I changed to the dynamicRecord for the Record but now I have different errors.
If I use the ‘Account_Phonecall’ relationship I get this error:
‘PhoneCall’ entity doesn’t contain attribute with Name = ‘phonecallid’ and NameMapping = ‘Logical’.
And since this is an activity and there isn’t a field ‘phonecallid’ I tried using the Activity relationship, ‘Account_ActivityPointers’.
When I try it that way the error is: ‘ActivityPointer’ entity doesn’t contain attribute with Name = ‘activitypointerid’ and NameMapping = ‘Logical’. ;
I wish I could specify the id field it should be looking for (activityId) but of course I cant.
Any idea what I should try now?
thanks!
Update: I tried to use fetchXML instead and I had partial success. If the fetchxml specifies the regardingobjectid (which is the accountid) then it processes correctly and the workflow I’ve specified runs on the phone call records for that account.
So how do I pass the dynamicRecordUrl (or equivalent) into the Fetchxml?
thanks!
David,
In this can you can extract id of account using UWT: Core Operations -> Get Record Id. You will have to pass Dynamic Record Url inside and in output you’ll get record id that you can combine with your query.
Andrew
David,
It looks like you found a bug. I will work on a fix. Can you please create and Issue here – https://github.com/a33ik/UltimateWorkflowToolkit/issues ?
Hi Andrew,
Thanks for the replies!
1. I don’t think you really explained how to update my fetchxml to receive the recordUrl.
2. I downloaded your source code and have adjusted accordingly to fit my needs. The fetchxml in the BulkOperationBase needed to be updated to NOT assume the Id field was just the entity name with “Id” at the end.
Thanks for your efforts but I’m all set now!
-David
David,
I’m glad you achieved your goal.
In trying to use “Add User to Record Team” I encountered an error when trying to choose the Team (Access Team) in the workflow designer – when trying to use the search on the entry field. “To use this saved view, you must remove criteria and columns that refer to deleted or non-searchable items. If you contact support, please provide the technical details. …
The returned ErrorDetails were:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Server was unable to process request.Detail:
d48d425e-5fb6-4f75-9083-b31798504446
-2140991216
Server was unable to process request.
2018-10-18T19:52:44.2272002Z
false
System is Dynamics 365 OnLine v9
Any ideas as to the cause/solution???
Hello Ross,
You can use following tip to solve your issue – https://crmtipoftheday.com/747/if-your-view-is-broken/
I experienced this issue in my instances as well. Feel free to get in touch if you still have issues.
Thanks,
Andrew
Hi Andrij.
Thank you for your tools!
My question: your wrote -“I will provide guide that will describe how to install this version if you have earlier versions installed already.” I have earlier version of UWT. Could you please provide any user guide – how I can install the last version? Thank you!
Roman,
I’ll provide instructions early the next week. Can you please open an issue here – https://github.com/a33ik/UltimateWorkflowToolkit/issues
Thanks,
Andrew
Andrij, thank you.
I’ll try.
Hello Roman,
It took more than I expected but here is instruction how to update UWT when you have earlier version – https://github.com/a33ik/UltimateWorkflowToolkit/wiki/How-to-install-UWT-1.5.0.0–when-you-have-any-lower-version
Hello Andrij,
thank you ! You are very reliable person!
Reliable, but terrible slow 🙂
Доречі, бачили, що я працюю над івентом – http://365saturday.com/dynamics/ukraine-2019/
Сподіваюся, що буде цікаво.
Дякую за нагадування! Відмітив у календарі 🙂
I’m nor sure that my previous comment was published.
Andrij, thank you for your UWT kit!
My question : you wrote – “I will provide guide that will describe how to install this version if you have earlier versions installed already.” Could you please provide link where I can read this instruction?
Thank you.
Hi Andrew,
Can you please share information how use the step Add Business Days? Thank you so much!
Looking forward to meeting you in Kiev in May.
Best, Aliona
Andrew, do you have any examples of adding a many to many relationship that you could show with your toolkit? In my case we have created a many to many relationship to a custom entity and the account entity so that we can create “tags” to associate one or more to an account. Right now we use the XRMToolbox for this, but it is slow and doesn’t allow for us to build other logic in. How would we use the associate to assign a tag from our custom entity to accounts?
Bill,
Check this post an tell if anything is not clear – http://butenko.pro/2018/04/26/copying-of-n-n-related-records-with-no-code-using-uwt/
Andrew
The example was using a copy of existing N-N relationship. In my case I am simply associating to the account a very specific record from the custom entity, so there is no existing relationship to copy from. In my case I have a custom entity with N number of records, each record can be associated to one or more accounts. I want to be able to associate a specific record from the custom entity to one or more accounts. Is that possible?
Bill,
I believe it’s possible. How do you define that specific record from custom entity to associate to accounts?
Andrew
Is it possible to send you screenshots of the config, does not appear I can do so via these blog responses? The account N:N relationship is via relationship name po_accounttag_account which refers to the custom entity po_accounttag. The custom entity itself is pretty bare – just a key and the name fields are present (again it is being used as a tag type of entity to associate attributes without having to create custom fields on the account record). Manual association of an existing tag is on the account form where we have an sub-grid added that allows for adding or removing of a tag. Creating new tags is simply adding/updating/deleting a tag from the custom entity.
Bill,
Can you save screenshots online (for example here – https://snag.gy/) and put urls here?
Andrew
Unfortunately our company locks down any external sharing sites, so I am not able to use them. I am forced to relay this via old style email.
Bill,
You can send it to a33ik@bigmir.net
Andrew
Hi Andrew,
I feel like an idiot compared to the others asking questions here. I am not able to figure out how to install the tool initially. I have downloaded it but am not sure. Is it a solution I install in CRM? Thank you for your help!
Laura,
That is a solution you should install to your system. Do you have issues with it?
Andrew
I am sure not, just wanted to confirm if that was how to use it. thank you! Laura
Hi Andrew,
Awesome plugin! I just have a quick question about the Holiday Query (Add Business Days). Am i querying to find a specific date field of a specific record? What if i query for a range of dates using the date on filed1 and date field2 (operator=”between” ), will it skip all dates between the two dates
Holiday Query field can be used only in case if you store holidays in special entity. In any other cases it’s useless.
Andrew
Special Entity as in the native Dynamics holiday records under service management, or my own custom entity? So say i create a special dedicated entity specifically for this purpose (with many date fields), will it work? If so, what am i looking for with the FetcxhXML query?
Special Entity as own custom entity. And there should be only 1 field for date. So 1 holiday – 1 record. Multiple datetime fields on the same entity would not work.
Your query should return the list of holidays you want to count as “day-off”. Use ‘holiday’ alias for datetime field.
Ah, so a holiday with two days, would require two records. Each record would contain a single datetime attribute called “holiday”?
Joe,
That’s correct. One thing that you can’t create exactly holiday attribute but you can use alias “holiday” in fetchxml query. Check this as a reference -https://www.inogic.com/blog/2014/03/use-of-alias-in-fetchxml/
Hi, I’m trying to use the EMail functionality, but I do not know what data should be given in the email field, I want to use the UltimateWorkflowToolkit.CoreOperations.Email.CreateEmailFromTemplate functionality and I could run it and generate the email, but I need to pass that email generates this functionality to this other in the email field, UltimateWorkflowToolkit.CoreOperations.Email.SendEmailToUnresolvedRecipient, but I get an error, is that feasible?
Sandra,
What error do you get?
Thanks,
Andrew
hi Andrew, i have 2 error
1- It gives that the value indicated in emial is not correct. I’m giving {Id. of primary activity (UltimateWorkflowToolkit.CoreOperations.Email.CreateEmailFromTemplate: Email (Email))}.
Error: “Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at UltimateWorkflowToolkit.CoreOperations.Email.SendEmailToUnresolvedRecipient.ExecuteWorkflowLogic (CodeActivityContext executionContext, IWorkflowContext context, IOrganizationService service, IOrganizationService sysService)
at UltimateWorkflowToolkit.Common.CrmWorkflowBase.Execute (CodeActivityContext executionContext)
at System.Activities.CodeActivity.InternalExecute (ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody (ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation) “
Sandra,
You should pass “Record Url” to “Record Reference” field that point to type of your template. It’s shown here – https://github.com/a33ik/UltimateWorkflowToolkit/wiki/Record-Reference—polymorphic-lookup
Andrew
Yes, (Sandra,
You should pass “Record Url” to “Record Reference” field that point to type ) for UltimateWorkflowToolkit.CoreOperations.Email.CreateEmailFromTemplate.
becouse
for UltimateWorkflowToolkit.CoreOperations.Email.SendEmailToUnresolvedRecipient use {Id. of primary activity (UltimateWorkflowToolkit.CoreOperations.Email.CreateEmailFromTemplate: Email (Email))} for “Email” parameter.
Can you please post a screenshot somewhere and put url to it to your next reply? I’m not sure what’s wrong there.
2-But also in the parameter Recipient Email I am giving a text field that has a series of email separated by “;” for example sansolar20@gmail.com; sansolar20@gmail.com; sansolar20@gmail.com and then gives an error that says
”
Invalid e-mail address. For more information, contact your system administrator. “
Sandra,
Unfortunately that will not work that way. ATM you can pass only one email address inside. So to resolve your issue you will have to sequentially call “Send Email to Unresolved Recipient” for every of emails.
Andrew
2- But also in the parameter Recipient Email I am giving a text field that has a series of email separated by “;” for example sansolar200@gmail.com; sansolar201@gmail.com; sansolar202@gmail.com and then gives an error that says
”
Invalid e-mail address. For more information, contact your system administrator. “
Andrew, have documentation of email funtion?
thank you
To be honest I do really bad work documenting all the possibilities of my toolkit. Everything that I have at the moment is here – https://github.com/a33ik/UltimateWorkflowToolkit/wiki
Hi Andrew,
I noticed in the comments above you mentioned to someone being able to Get Field Label using a Multiselect Optionset function. I have installed version 1.5.1.1 but cannot seem to find this function anywhere. Am I missing something?
I need to add the text from a multiselect optionset into an email generated by workflow and was hoping this would help.
https://snag.gy/k3Xad0.jpg
Thanks,
Scott
Scott,
This functionality became part of our company’s intellectual property so I had to remove it from solution. Sorry for the inconvenience.
Andrew
Hello Andrew,
For the UWT: Security:Share Record with Team, what is to be entered in first parameter for Record Reference?
Hello Voni,
Here is the wiki page that describes what should be added – https://github.com/AndrewButenko/UltimateWorkflowToolkit/wiki/Record-Reference—polymorphic-lookup
Andrew
Hi Andrew,
first of all, thank you for taking the time to answer all the questions being posted – that´s remarkable.
I think I´m having an issue with setting a Lookup Field to null. Is this even possible with the Action “”? If not, is there any other way to achive this? My current approach is as follows:
1. Get Record ID (for the Fetch XML in Step 3)
2. Request Builder – Set Field to Null
3. Bulk Operations – Update records (with reference to Request from step 1)
https://snipboard.io/kUFelO.jpg
https://snipboard.io/Rt7C5v.jpg
https://snipboard.io/fysVSl.jpg
Note: The Workflow runs without an error, however, the Lookup field will not be set to null. For debugging, I´ve also tried to set a String field to null which didn´t work either.
I have an Else Branch in the Workflow which is setting a Lookup value – this works perfectly fine. Therefore, I don´t think that my Fetch XML is invalid.
Do you have any idea what could be wrong?
Thank you very much in advance!
Florian,
Everything looks good for me. Can you please just in testing purposes save “Updated Request” value after setting of the field to null and post it here?
Andrew
Hi Andrew,
thanks for the fast reply. Here are the requests.
Fill KA Lookup on Opportunity
b240a458-bd15-ea11-813d-005056aa30eb
sta_keyaccount
Clear KA Lookup on Opportunity
I´ve thouroughly tested again (deactivated all other processes). Setting the KA Lookup value definately works as desired.
Thanks again!
Sorry, seems like the XML got lost somehow in the comment. Here is a screenshot:
https://snipboard.io/m3AVtR.jpg
Florian,
That looks odd… What is your scenario? Let’s see if there is a workaround.
Andrew
Hey Andrew,
thanks for the feedback. The scenario:
On the Account entity there is a Lookup to a custom entity called “Key Account” [sta_keyaccount].
On Opportunity entity there is a Lookup to this custom “Key Account” entity, as well.
1) When the “Key Account” Lookup on Account entity is updated, the “Key Account” Lookup of all Opportunities associated with this Account should be filled with the “Key Account” ID that was just set on the Account.
>> this works perfectly fine with your Workflow Tool
2) When the “Key Account” Lookup on Account entity is cleared, the “Key Account” Lookup of all Opportunities associated with this Account should be cleared as well.
>> unfortunately this doesn´t seem to work and results in the odd request
So basically, it´s about synchronising the “Key Account” Lookup on Account and Opportunity
Is it maybe possible to manually provide the Request in the Action “Bulk Operations – Update records” in order to null the “Key Account” Lookup on the Opportunity entity? What would the request look like?
Thank you so much for your assistance!
Florian
Florian,
Here is alternative way you can utilize:
1. Create on-demand workflow for opportunity entity that will copy value (real value or null) from account to opportunity.
2. Create on-change workflow for account that will use “Bulk Operations” -> Distribute Workflow action from my toolkit that will start workflow created in the step 1.
Andrew
Hi Andrew,
thank you very much for your advice and support. I just tried it and it works fine 🙂
Thanks again and all the best.
Florian
Hi Andrew,
I use UltimateWorkflowToolkitNew (v1.5.0.0)
I would like to ask you a question. Can I use it with BulkUpdate of records of entity ?
I have plugin, where I select 1000 records by linq query and for each row I update specified field and add to collection.
Then give that collection to BulkUpdate.
There is business process(workflow) that fires on when this specified field changes.
In that workflow I call BulkOperations.DistributeWorkflow
result: For first record it works. starting from second record i receive an error
“An ActivityContext can only be accessed within the scope of the function it was passed into.
Object name: ‘System.Activities.CodeActivityContext’.”
Thanks.
Hello Marina,
That was the goal of that Custom Workflow Activity. Can you please open an issue on the GitHub and provide a little more details for me to reproduce/troubleshoot/fix?
Thanks,
Andrew
Hello Andrew,
Great tool! I have a challenge using the UWT Annotation:Delete File action.
It keeps giving me an error. I suspect the it is the Record Reference field that does not like the value I provide but it seems i’m running out of options.
My objective is to delete a note attachment when certain criterias are met.
Do you have extra guidelines on using this action?
Thanks in advance.
Hello Alexandre,
I’m glad that my toolkit helps you with the workflows. In order to pass the value to the “Record Reference” you should pass “Record Url(Dynamic)” to the “Record Reference” input. You can check similar scenario here – https://github.com/AndrewButenko/UltimateWorkflowToolkit/wiki/Rename-file-(from-attachments)
Andrew
Hi Andrew,
Thanks for your quick reply.
It seems I now get this error:
===
Plugin Trace:
[UltimateWorkflowToolkit.CoreOperations: UltimateWorkflowToolkit.CoreOperations.Annotation.DeleteFile]
[UWT: Annotation: Delete File]
Value of ‘Record Reference’ attribute equals to https://imtpreprod.crm.dynamics.com:443/main.aspx?etc=5&id=93b001d0-7f50-ef1c-ad0b-269d5dc3e80f&histKey=59180396&newWindow=true&pagetype=entityrecord
Value of ‘Current File Name’ attribute equals to Nemacolin-Property-Maps-min.pdf
Value of ‘Throw an Exception on Error’ attribute equals to True
Error Message:
Unhandled exception:
Exception type: Microsoft.Xrm.Sdk.InvalidPluginExecutionException
Message: File Nemacolin-Property-Maps-min.pdf is not available for current record
— End stack trace —
====
But the file is actually on the note as you can see here: https://synergyweb-my.sharepoint.com/:i:/g/personal/aprovost_inmindtechnologies_com/Eadjf-f2Ny1DjA8OiMrBQokB4x7544Th8Sa7XgjyEnVDFQ?e=ZHu9z4
Any idea?
Thanks!
Hello,
Ok. I see where the issue comes from. Pass to the “Record Reference” URL that points to the parent record of the annotation and not to the annotation itself.
Andrew
Hello Andrew,
The Rename action worked with the parent record URL but when I tried the Delete action it deleted the annotation record itself. My objective is to delete the attachment only and keep the annotation. Any hint?
Thanks again.
Alexandre,
I’m afraid this is not how it was designed. If you want to delete the attachment itself without deleting the annotation record – you will have to use something else.
Andrew
Ok, I assumed since the action refered to “file” that the result would concern the attached file only.
Thanks for your help.
I’m sorry for the confusion. Cleaning of the attachment should relatively easy task for development.
Andrew
Hi Andrew,
How is the fetch XML on the add business days designed to work?
It doesn’t seem like the C# is configured to accept the attribute alias value of holiday.
Any help would be greatly appreciated.
Thanks,
Alex
Hello Alex,
Can you please provide FetchXml you used with “Holidays” input?
Andrew
Hi Andrew,
Thanks for getting back. I have tried numerous methods to try and get it working. The initial attempt was:
I have created a custom entity for capturing holidays and I have one date field on there to record the holidays. Is it designed to use a link entity for getting holidays related to a user?
I am attempting to use it in the scenario of adding custom holidays such as bank holidays.
Thanks,
Alex
Hi Andrew,
I am also having troubles in creating a “good” FetchXML query to get the holidays from a custom table.
This is my query
(osc_festivita is my custom table.)
May you please help me?
Thank you in advance,
Andrea
Hello Andrea,
The FetchXml was removed for some reason. Can you please post it here one more time?
Andrew
*fetch version=”1.0″ output-format=”xml-platform” mapping=”logical” distinct=”false” *
*entity name=”osc_festivita” *
*attribute name=”osc_datagiornofestivo” alias=”Holiday” /*
*/entity*
*/fetch*
Andrea,
Try to use “holiday” instead of “Holiday”. In this casing matters.
Thanks,
Andrew
Hi Andrew,
I have tried with “holiday”, but I get a “Specified cast is not valid” error.
This is the full error log: “Calcolo data scadenza offerta” is my workflow name, and “Data scadenza = data ricevimento + 10 gg lavorativi” is the name of the step in which I try to add working days to a date.
Exception Message: Specified cast is not valid.
ErrorCode: -2147220891
HexErrorCode: 0x80040265
ErrorDetails:
ApiExceptionSourceKey: Plugin/$Microsoft.Crm.Workflow.Services.ProxyCustomActivity
ApiStepKey: 4b3e1ea1-2c93-ec11-b3fe-000d3abc4602
ApiDepthKey: 1
ApiActivityIdKey: a063a2ea-c0c8-4fee-b3df-8c8dca7ab8d6
ApiPluginSolutionNameKey: System
ApiStepSolutionNameKey: System
ApiExceptionCategory: ClientError
ApiExceptionMessageName: IsvUnExpected
ApiExceptionHttpStatusCode: 400
OperationStatus: 0
SubErrorCode: -2146233088
Plugin:
PluginTrace: [Microsoft.Crm.ObjectModel: Microsoft.Crm.ObjectModel.SyncWorkflowExecutionPlugin]
[4b3e1ea1-2c93-ec11-b3fe-000d3abc4602: ]
Entered Microsoft.Dynamics.Sales.Plugins.PreOperationQuoteUpdate.Execute(), Correlation Id: 82e0319e-d1a2-441d-8a81-e9c0e245177e, Initiating User: 1e3f8b03-ae77-ec11-8d21-6045bd8d1746
Exiting Microsoft.Dynamics.Sales.Plugins.PreOperationQuoteUpdate.Execute(), Correlation Id: 82e0319e-d1a2-441d-8a81-e9c0e245177e, Initiating User: 1e3f8b03-ae77-ec11-8d21-6045bd8d1746
Starting sync workflow ‘Motivo estensione data scadenza’, Id: 4d12fe63-eb92-ec11-b3fe-000d3abc45a7
Entering ConditionStep1_step:
Entering SetFieldRequiredLevelStep3_step:
Entering ConditionBranchStep3_step:
Sync workflow ‘Motivo estensione data scadenza’ completed successfully
Starting sync workflow ‘Calcolo data scadenza offerta’, Id: 433e1ea1-2c93-ec11-b3fe-000d3abc4602
Entering ConditionStep1_step: Controllo se dati presenti
Entering ConditionStep3_step:
Entering CustomActivityStep10_step: Data scadenza = data ricevimento + 10 gg lavorativi
Sync workflow ‘Calcolo data scadenza offerta’ terminated with error ‘Specified cast is not valid.’
TraceText:
[Microsoft.Crm.ObjectModel: Microsoft.Crm.ObjectModel.SyncWorkflowExecutionPlugin]
[4b3e1ea1-2c93-ec11-b3fe-000d3abc4602: ]
Entered Microsoft.Dynamics.Sales.Plugins.PreOperationQuoteUpdate.Execute(), Correlation Id: 82e0319e-d1a2-441d-8a81-e9c0e245177e, Initiating User: 1e3f8b03-ae77-ec11-8d21-6045bd8d1746
Exiting Microsoft.Dynamics.Sales.Plugins.PreOperationQuoteUpdate.Execute(), Correlation Id: 82e0319e-d1a2-441d-8a81-e9c0e245177e, Initiating User: 1e3f8b03-ae77-ec11-8d21-6045bd8d1746
Starting sync workflow ‘Motivo estensione data scadenza’, Id: 4d12fe63-eb92-ec11-b3fe-000d3abc45a7
Entering ConditionStep1_step:
Entering SetFieldRequiredLevelStep3_step:
Entering ConditionBranchStep3_step:
Sync workflow ‘Motivo estensione data scadenza’ completed successfully
Starting sync workflow ‘Calcolo data scadenza offerta’, Id: 433e1ea1-2c93-ec11-b3fe-000d3abc4602
Entering ConditionStep1_step: Controllo se dati presenti
Entering ConditionStep3_step:
Entering CustomActivityStep10_step: Data scadenza = data ricevimento + 10 gg lavorativi
Sync workflow ‘Calcolo data scadenza offerta’ terminated with error ‘Specified cast is not valid.’
ID impegno: f4a0a892-f525-4511-bd92-322407eaa17e
Another problem I am noticing is that if the calculated date is a week-end day (I left the default “0|6” value), it is returned instead of moving on to the next Monday (any other week-end in the period is correctly skipped).
Thank you in advance,
Andrea
Andrea,
What type of field is that osc_datagiornofestivo?
Andrew
Hi Andrew,
osc_datagiornofestivo is a Date and Time field with the default settings of:
– Field Type: Simple
– Behavior: User Local
– Format: Date Only
Thanks,
Andrea
Hi Andrew,
I think the XML is not allowed in the comments…
I have replaced the opening “” with *:
*fetch version=”1.0″ output-format=”xml-platform” mapping=”logical” distinct=”false” *
*entity name=”osc_festivita” *
*attribute name=”osc_datagiornofestivo” alias=”Holiday” /*
*/entity*
*/fetch*