Home > Forum > Tips&Tricks > Delete comments

Delete comments
0

Hi,
Is there any way to remove saved comments from an element?
I would like to use the native comment field, but I need to delete the old comments in a certain step. Is this possible, or should I use the AttLong attribute instead of the native comment field?

Best regards,
Bartek

Hi,

you can use the action - execute the SQL procedure. In the configuration, you can trigger the query:

update [BPS_Content]. [dbo]. [WFElements]
SET [WFD_Description] = NULL
WHERE WFD_ID = {WFD_ID}

In this case, all comments associated with the item will be deleted. The comments are saved in the database along with the information about the author and the date they were added. There is an appending mode here.
A long field with an append mode can implement a similar functional scope.

Best regards,
Darek

MVP
In reply to: Dariusz Tułacz

Hi,

you can use the action - execute the SQL procedure. In the configuration, you can trigger the query:

update [BPS_Content]. [dbo]. [WFElements]
SET [WFD_Description] = NULL
WHERE WFD_ID = {WFD_ID}

In this case, all comments associated with the item will be deleted. The comments are saved in the database along with the information about the author and the date they were added. There is an appending mode here.
A long field with an append mode can implement a similar functional scope.

Best regards,
Darek

Hi,

while I would wise against using any kind of insert/update/delete statement against a BPS database, I also didn't find an alternative.

In the SDK you only have the option to add read all existing comment and add a new one. There's no option to remove old ones, so there's no supported way.

I'm not aware what the EULA says to something like this, but I somehow doubt that using a write statement against the BPS database is supported.

Best regards,

Daniel

WEBCON
In reply to: Martin Meze (Freelancer)

It would be really nice to hear what the guys at Webcon think about that.... :)

One of the most important functionalities of the WEBCON BPS platform is audibility (history of changes). Any change to the database made with external tool disrupts the audiability.
So I can write about EULA, about SLA, loss of support etc... but you should consider the business aspect first - it is more important I think.

And of course - any changes to the database made with external tools are not supported.
SDK is the best option for that case.