Could someone please provide an example of a custom workflow activity in
which objects are passed as parameters?

Further to an earlier question of mine, I would like to pass a SalesOrder
and a Product in to the Workflow so I can then add an appropriate OrderDetail
for the SalesOrder.

Re: CRM4: Example for custom workflow activity with objects as by Aamir

Aamir
Wed Mar 26 04:25:01 CDT 2008

Hi,

There is example in SDK.

Here are some ways to pass the parameters in workflow

//lookup

public static DependencyProperty objectIDProperty =
DependencyProperty.Register("objectID", typeof(Lookup),
typeof(calculate));

[CrmInput(" objectID")]
[CrmReferenceTarget("incident")]
public Lookup objectID
{
get
{
return (Lookup)base.GetValue(objectIDProperty);
}
set
{
base.SetValue(objectIDProperty, value);
}


}

// date as input parameter

public static DependencyProperty startdateProperty =
DependencyProperty.Register("startdate", typeof(CrmDateTime),
typeof(calculate));

[CrmInput(" startdate")]

public CrmDateTime startdate
{
get
{
return (CrmDateTime)base.GetValue(startdateProperty);
}
set
{
base.SetValue(startdateProperty, value);
}
}

regards
Aamir

Re: CRM4: Example for custom workflow activity with objects as par by BevanEdwards

BevanEdwards
Wed Mar 26 18:04:00 CDT 2008

Thanks Aamir, I had missed the CrmReferenceTarget setting :(

"Aamir" wrote:

> Hi,
>
> There is example in SDK.
>
> Here are some ways to pass the parameters in workflow
>
> //lookup
>
> public static DependencyProperty objectIDProperty =
> DependencyProperty.Register("objectID", typeof(Lookup),
> typeof(calculate));
>
> [CrmInput(" objectID")]
> [CrmReferenceTarget("incident")]
> public Lookup objectID
> {
> get
> {
> return (Lookup)base.GetValue(objectIDProperty);
> }
> set
> {
> base.SetValue(objectIDProperty, value);
> }
>
>
> }
>
> // date as input parameter
>
> public static DependencyProperty startdateProperty =
> DependencyProperty.Register("startdate", typeof(CrmDateTime),
> typeof(calculate));
>
> [CrmInput(" startdate")]
>
> public CrmDateTime startdate
> {
> get
> {
> return (CrmDateTime)base.GetValue(startdateProperty);
> }
> set
> {
> base.SetValue(startdateProperty, value);
> }
> }
>
> regards
> Aamir
>