Community
Showing results for 
Search instead for 
Do you mean 
Reply

Parsing/Updating Activity Details

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

Parsing/Updating Activity Details

I'm trying to add to the Details field in an ACT! Activity. When I read the Details field using the SDK, I get the following:

 

"{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}} {\colortbl ;\red0\green0\blue0;} \viewkind4\uc1\pard\cf1\f0\fs16 DETAILS: 4/28/2011 kek: OC - NA - LM to RC\par \cf0\fs17 This is a test of the emergency broadcast system. This is only a test.\par }"

 

Here's the actual text in the Details field in ACT!:

 

"DETAILS: 4/28/2011 kek: OC - NA - LM to RC
This is a test of the emergency broadcast system. This is only a test."

 

I would like to add more text (e.g. "Updated: 01/04/2012") to the Details field. How do I do that?


Accepted Solutions
Solution
Accepted by topic author kimkamp22
‎09-25-2015 03:20 AM
Copper Super Contributor
Posts: 88
Country: USA

Re: Parsing/Updating Activity Details

Matt, you are a genius.

 

I did not know the Details field was Rich Text Formatted. Once I inserted your code, it worked perfectly.

 

Thanks!

View solution in original post


All Replies
Employee
Posts: 1,163
Country: USA

Re: Parsing/Updating Activity Details

In this thread I posted some code that sets a few of the properties of a newly created activity. It's basically the same for an existing activity, and I don't believe details are read only.

 

Hope this helps.

Matthew Wood
Act! SDK Support
Community Moderator
Copper Super Contributor
Posts: 88
Country: USA

Re: Parsing/Updating Activity Details

Thanks, Matt, for the reply.

 

It is easy to insert text in the Detail field if the Detail field is empty. Just update the Activity with changed Detail, and it works great.

 

The issue is when there is already some text in the Detail field. Then, I get the contorted string I show as an example above.

 

I would like to be able to append some text to the existing text.

 

Any recommendations?

Employee
Posts: 1,163
Country: USA

Re: Parsing/Updating Activity Details

After you have the activity you want, store the details as a string and once you've parsed out the rich text formatting you can concatenate or modify the details however you wish.

 

MSDN has an article on how to convert rtf to plain text. I also did a quick search for rtf to plain text parser and there are a lot of results.

 

 

Matthew Wood
Act! SDK Support
Community Moderator
Solution
Accepted by topic author kimkamp22
‎09-25-2015 03:20 AM
Copper Super Contributor
Posts: 88
Country: USA

Re: Parsing/Updating Activity Details

Matt, you are a genius.

 

I did not know the Details field was Rich Text Formatted. Once I inserted your code, it worked perfectly.

 

Thanks!