How to trigger automations

Aug 18, 2010 at 1:55 PM

Hello,

I have written my first simple automation. It reads a textbox on one hostedapp webpage(source), then updates this value onto a hostedapp webpage (target).

I've built the DLL & created an uii_action on the source hostedapp record.

I need to set the automation so it is triggered on the event that a button on the source page is pressed.

Any help would be appreciated.

Regards,

Johan

Aug 18, 2010 at 3:14 PM

Hello!

You need to add a activite da Registre an action to the button Event on the source page.

For do this:

  1. Create a new sequencial workflow
  2. Add an activity RegisterActionForEvent
  3. Set attributes
    • ActionApplicationName: Name of application that contains the action that wil be trigger
    • ActionName: name of the action
    • ApplicationName: Your source application(Source page)
    • ControlName: The button that is pressed in your source page
    • EventName: The event ex.click
  4. Save
  5. Build
  6. In your Default action of your source application, set to run your new automation
  7. Save

Now Every time that a new session is open it´ll register a action when the button is pressed.

cheers,

Aug 18, 2010 at 3:56 PM

Thanks for the detailed instructions.

I followed them, but I think I am doing something wrong when I fill in the UII_Action in MSCRM.

I get the following error when I load page

Unable to load type SampleProj.Installer, c:\dev\sampleproj\bin\debug\sampleproj.dll

The namespace is SampleProj and the workflow is Installer.

Do you have any ideas?

Thanks again,

Johan 

Aug 18, 2010 at 4:12 PM

Can you send  a picture to see?

It´s sound like correctly configuration.

regards.

Aug 18, 2010 at 9:24 PM

Have you published the solution to your CRM server from HAT?

Matt-B

Aug 19, 2010 at 8:43 AM

Hi Matt & Canikrause,

I have built the dll & included the path in the UUI_Action record. If there is another step for publishing, then I have not completed it.

I have some screenshots on my skydrive at http://cid-ec3edcd38d1ec7cc.photos.live.com/browse.aspx/CCA?uc=3. These include the source code, the error message, and the UII_Action record in MSCRM.

I used the videos from microsoft as a how to guide to get a feel for the environment (CCA for Dynamics CRM Level 300/400 DYN47PAL).
Could either of you suggest a better walk through for creating your first workflow? If not maybe I'll have to write a guide it as I go (once I master it!).

Thanks,

Johan

 

Aug 19, 2010 at 2:28 PM

Johan

in your action in the attribute Work Assembly Type, write the information type this:

NameSpace.Class,File://path to dll

ex: Microsoft.UII.Crs.Core, file://c:\Microsoft.Crs.Core.Dll

Try to do what Matt said in your last post too.

Aug 19, 2010 at 4:26 PM
Edited Aug 19, 2010 at 4:27 PM

Hi,

I tried your suggested and still had the same error.

Then I deleted my UII_hostedapplication records, and my UII_action records and started again because I couldn't find the error. This time I have a new error.

It seems like it is finding the assembly this time, but the assembly is causing an error. This makes me think I've come one step further forwards!

DESKTOP_ERR_FATAL_ERROR:A possibly fatal error has occurred.  The application may now exit.

I've looked into the code and seen that this error message is a generic error message. So I debugged and found the real error message from the exception which was

One or more exceptions occurred while firing the topic 'topic://RequestActionEvent'
At Microsoft.Practices.CompositeUI.EventBroker.EventTopic.CallSubscriptionHandlers(Object sender, EventArgs e, EventTopicFireDelegate[] handlers)\r\n   at Microsoft.Practices.CompositeUI.EventBroker.EventTopic.Fire(Object sender, EventArgs e, WorkItem workItem, PublicationScope scope)\r\n   at Microsoft.Practices.CompositeUI.EventBroker.EventTopic.Fire(Publication publication, Object sender, EventArgs e)\r\n   at Microsoft.Practices.CompositeUI.EventBroker.Publication.PublicationHandler(Object sender, EventArgs e)\r\n   at Microsoft.Uii.Csr.HostedWebApplication.FireRequestAction(RequestActionEventArgs args)\r\n   at Microsoft.Uii.Csr.HostedWebApplication.adapter_AdapterFireRequestActionEvent(RequestActionEventArgs args)\r\n   at Microsoft.Uii.Csr.HostedApplicationAdapter.AdapterFireRequestAction(RequestActionEventArgs args)\r\n   at Microsoft.Uii.HostedApplicationToolkit.AutomationHosting.AutomationAdapter.<>c__DisplayClass1.<AdapterFireActionFromAutomation>b__0(Object )\r\n   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)\r\n   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

Thanks, yet again,

Johan

Aug 19, 2010 at 6:27 PM

Verify your UII activitie.

I think that your eventname is wrong.

below the descripton in the developmente guide:

EventName:Name of the event initiated by the application/control.

Aug 20, 2010 at 12:10 PM

Hi,

I tried different event names to get it working, and this hasn't changed the result.

I couldn't find in the three documentation files a list of the events that are available for the controls in hosted applications. Do you have a list?

thanks,

Johan