Thread Duplicacy on commit
Summary
Connect PHP API commit causes Thread DuplicacyContent
Hi,
When I run the following code, the Thread is written twice to the incident. Not sure why.
But, when I remove the RNCPHP\ConnectAPI::commit() statement, the thread is written once once.
Anyone has any idea why this is happening? How to avoid this without removing the commit statement.
Appreciate your help.
Thanks,
Geetha
Version
19ACode Snippet
$inc = RNCPHP\Incident::fetch(101338); $thread_count = count($inc->Threads); $inc->Threads[$thread_count] = new RNCPHP\Thread(); $inc->Threads[$thread_count]->EntryType = new RNCPHP\NamedIDOptList(); $inc->Threads[$thread_count]->EntryType->ID = 3; $inc->Threads[$thread_count]->ContentType = new RNCPHP\NamedIDOptList(); $inc->Threads[$thread_count]->ContentType->LookupName = "text/html"; $inc->Threads[$thread_count]->Text = "<p>Test Thread Text</p>"; $inc->Threads[$thread_count]->Contact = RNCPHP\Contact::fetch(1); $inc->save(); RNCPHP\ConnectAPI::commit();
Tagged:
2