Community
Showing results for 
Search instead for 
Do you mean 
Reply

Creating ActivityType

Accepted Solution Solved
Copper Super Contributor
Posts: 59
Country: USA
Accepted Solution

Creating ActivityType

Hi Guys,

 

Does anyone know if it's possible to create activity types through the SDK and if so, which methods should I be looking at.

 

Thanks in advance 

Hugo Vale
Datastream Custom Solutions
http://www.datastreamcs.com

Accepted Solutions
Solution
Accepted by topic author hugovale
‎09-25-2015 03:20 AM
Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: Creating ActivityType

Hiya,

 

Strange works for me. I''m not too sure about VB.Net since I'ver forgotten a lot of VB syntax but here is a copy of a working method I just tested out in C#:

public static void CreateCustomActivityType() { BareCustomHistoryType[] bcht = new BareCustomHistoryType[] { new BareCustomHistoryType("Completed Test Activity Type", "Completed it (Description)", HistoryClearType.COMPLETED, true), new BareCustomHistoryType("Not Completed Test Activity Type", "Not COmpleted it (Description)", HistoryClearType.NOTCOMPLETED, false) }; oFramTarget.Activities.InsertCustomActivityType("Test 1", "Test Type 1 from SDK", new Bitmap("C:\\Program Files\\ACT\\ACT for Windows\\attachfile.ico"), true, bcht); }

 

HTH

 

Vivek

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog

View solution in original post


All Replies
Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: Creating ActivityType

Hiya,

 

The way I use is the Act.Framework.Activities.InsertCustomActivityType() method.

 

HTH

 

Vivek

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog
Copper Super Contributor
Posts: 59
Country: USA

Re: Creating ActivityType

I've tried that, but the custom activity type doesn't show in the ACT user interface, at least not in the manage activity types UI or when creating a new activity. Where should these custom activity types be?

 

Here's the code I've used:

Dim historyTypeCompleted AsNew BareCustomHistoryType(historyTypeName,historyDescription, Histories.HistoryClearType.COMPLETED,       True)

Dim historyTypeNotCompleted AsNew BareCustomHistoryType(historyTypeName,historyDescription,  Histories.HistoryClearType.NOTCOMPLETED, False)

Dim historyTypeErased AsNew BareCustomHistoryType(historyTypeName,historyDescription, Histories.HistoryClearType.ERASED, False)

 

fw.Activities.InsertCustomActivityType(historyTypeName, _

                                       historyDescription, _

                                       My.Resources.CreditCharge.ToBitmap, _

                                       True, _

                                       New BareCustomHistoryType() {historyTypeCompleted,_

                                                                    historyTypeNotCompleted,_

                                                                    historyTypeErased})

 

  

Hugo Vale
Datastream Custom Solutions
http://www.datastreamcs.com
Solution
Accepted by topic author hugovale
‎09-25-2015 03:20 AM
Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: Creating ActivityType

Hiya,

 

Strange works for me. I''m not too sure about VB.Net since I'ver forgotten a lot of VB syntax but here is a copy of a working method I just tested out in C#:

public static void CreateCustomActivityType() { BareCustomHistoryType[] bcht = new BareCustomHistoryType[] { new BareCustomHistoryType("Completed Test Activity Type", "Completed it (Description)", HistoryClearType.COMPLETED, true), new BareCustomHistoryType("Not Completed Test Activity Type", "Not COmpleted it (Description)", HistoryClearType.NOTCOMPLETED, false) }; oFramTarget.Activities.InsertCustomActivityType("Test 1", "Test Type 1 from SDK", new Bitmap("C:\\Program Files\\ACT\\ACT for Windows\\attachfile.ico"), true, bcht); }

 

HTH

 

Vivek

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog
Copper Super Contributor
Posts: 59
Country: USA

Re: Creating ActivityType

Hi Vivek,

 

Thank you so much for your help, it worked perfectly! The problem with my code is that I was using the same name for Activity Type and respective BareCustomHistoryTypes. Apparently this is a nono, after changing to other different names my code worked also.

Hugo Vale
Datastream Custom Solutions
http://www.datastreamcs.com
Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: Creating ActivityType

Ahh interesting I didn't know that! and yet another ACT! SDK Gotcha to my ever growing list! Haha!

 

Vivek

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog