Quantcast
Channel: Discussion Forum > Connect Data Services
Viewing all articles
Browse latest Browse all 2504

Sometimes wrong Thread Channel ID when reading Threads in CPM EventHandler (3 Comments)

$
0
0

Topic by David Riedel

Content

I am in front of a really strange problem.

In my Incident Eventhandler I am reading the Thread Array from the Incident and I am logging it to a txt file to check the results.

 

When the result is OK it returns the correct channel ID e.g. 9 or 3

Key: 0 Channel: 9 --- <div>
<div><span>rückmeldung test4</span></div>
</div>


Key: 1 Channel: 9 --- <div>
<div><span>rückmeldung test3</span></div>
</div>


Key: 2 Channel: 3 --- <div>
<div><span>telefon kundeneintrag</span></div>
</div>


Key: 3 Channel: 9 --- <div>
<div><span>rückmeldung 2 per email</span></div>
</div>


Key: 4 Channel: 9 --- <div>
<div><span>rückmeldung per email</span></div>
</div>


Key: 5 Channel: 3 --- <div>
<div><span>testnachricht thread1 abc</span></div>
</div>

 

 

When the result is NOT OK it returns a very strange number for all the channel IDs:

Key: 0 Channel: 1717986674 --- <div>
<div><span>rückmeldung 5 per email</span></div>
</div>


Key: 1 Channel: 1717986674 --- <div>
<div><span>rückmeldung test4</span></div>
</div>


Key: 2 Channel: 1717986674 --- <div>
<div><span>rückmeldung test3</span></div>
</div>


Key: 3 Channel: 1717986674 --- <div>
<div><span>telefon kundeneintrag</span></div>
</div>


Key: 4 Channel: 1717986674 --- <div>
<div><span>rückmeldung 2 per email</span></div>
</div>


Key: 5 Channel: 1717986674 --- <div>
<div><span>rückmeldung per email</span></div>
</div>

 

I have absolute no idea why!?

In test harness the result is always OK.

In deployed mode sometimes it's OK and sometimes KO.

The CPM is executed upon an UPDATE event on Incident.

 

I think it's KO when I am adding a new Thread element and save the ticket but I can't ensure it relates only to that at the moment.

 

Here is my code (should be OK!?):

//Log Thread Comm.Channel and Text
                $threadLog = "";
                foreach ($object->Threads as $key => $thread) {
                    $threadLog .= "\r\nKey: " . $key . " Channel: " . $thread->Channel->ID . " --- " . $thread->Text;
                }

 

N.b. All other fields I am reading from the Incident are always delivered OK.

The problem is only with the Thread Channel ID. 

 

Thanks for any help!

David

 

Version

Service Cloud May 2016, Connect 1.3

Viewing all articles
Browse latest Browse all 2504

Trending Articles