GetNotification


Description

This method retrieves a specific workflow notification, based on its key.

Parameters

Parameter

Type

Description

key

NotificationKey

The notification key that uniquely identifies the notification.


Return Value:

Value

Type

Description

GetNotificationResult

Notification

A workflow notification.


Examples

The following C# example retrieves a specific workflow notification, based on its key value (a GUID). The GUID value typically would have been stored in some external location, such as a database. Information about the notification is displayed in a dialog.

Be sure to use the URL and port for your workflow server.


using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using Microsoft.Dynamics.Workflow.Proxy;

namespace WorkflowWebServiceSample
{
	 class Program
	 {
		 static void Main(string[] args)
		 {
			Notification notification;
			NotificationKey notificationKey;
			Guid keyValue;

			// Create an instance of the web service
			DynamicsWorkflow wsWorkflow = new DynamicsWorkflow();

			// Specify the URL used to access the Workflow web service
			wsWorkflow.Url = "http://WorkflowServer:10072/_vti_bin/WorkflowService.asmx";

			// Be sure that default credentials are being used
			wsWorkflow.UseDefaultCredentials = true;

			notificationKey = new NotificationKey();
			keyValue = new Guid("d011fbb7-02b4-4bf1-b5ad-709843063ac5");
			notificationKey.Id = keyValue;

			// Get the notification
			notification = wsWorkflow.GetNotification(notificationKey);

			// Display details of the notification
			MessageBox.Show(notification.Subject + " -- " + notification.AssignedTo);
	}
}
}


Documentation Feedback