SBX - Search With Button

SBX - Forum Post Title

Publish Action using C# to D365

Microsoft Dynamics CRM Forum

Ivan Bilokon asked a question on 2 Aug 2018 10:03 AM

Question Status

Suggested Answer

Hello!

I'm trying to automate Dynamics solutions development. Currently I'm struggling with custom workflow action publish. The msdn article says that it is possible via code but the trouble is it requires XAML for the activity. The XAML is probably the most complex thing in this process. So my question is if anybody knows how can I build the XAML knowing only assembly and type details. Maybe I could publish "empty" action and add activities to it via C# somehow. 

Thank you in advance.

Reply
Flydancer responded on 2 Aug 2018 1:37 PM
My Badges
Suggested Answer

See for a little sample.

I'm not sure if there is an elegant way to publish specific items by having only assembly data, so I'd just use PublishAllXML:

                PublishAllXmlRequest publishReq = new PublishAllXmlRequest();
                org.Execute(publishReq);


Reply
Ivan Bilokon responded on 3 Aug 2018 2:46 AM

Thank you for the reply. But how to build that "AllXml"?

Reply
Flydancer responded on 8 Aug 2018 9:06 AM
My Badges

Hi Ivan,

what do you mean with how to build? See my first answer for the needed codesnippet.

Reply
Ivan Bilokon responded on 10 Aug 2018 3:44 AM

I mean if the class is called PublishAllXmlRequest then it should publish some XML that is already on the server. My original question is actually how to make that XML to exist on server? Because your code snipped does nothing if there is nothing in the dynamics to publish. There is a way to create Custom Action via code and export it as XAML (docs.microsoft.com/.../serializing-workflows-and-activities-to-and-from-xaml) but it is related to Windows Workflow Foundation and I'm not sure if it will work with dynamics. Didn't have a chance to test it.

Reply
Flydancer responded on 2 Aug 2018 1:37 PM
My Badges
Suggested Answer

See for a little sample.

I'm not sure if there is an elegant way to publish specific items by having only assembly data, so I'd just use PublishAllXML:

                PublishAllXmlRequest publishReq = new PublishAllXmlRequest();
                org.Execute(publishReq);


Reply

SBX - Two Col Forum

SBX - Migrated JS