TOPIC:

How to delete all records from a specific form 1 week 3 days ago #261516

  • Topic Author
  • easytherm
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 411
  • Thanks: 2
Hi

I have a joomla project which uses breezingforms and collects data with a couple of forms.

I need to split this project in two different one. Each new project needs to keep data from the remaining forms (in that particular project).

My idea is to clone tha base project in two, then delete the unused BF form and BF records from each cloned project.

I have thousands of records for every form. How can I efficiently delete these ? Using "Manage Records" from the backend is quite slow

Can you suggest a quick way to do this task, for example with a sql query?

regards

Jacques

Please Log in or Create an account to join the conversation.

How to delete all records from a specific form 1 week 3 days ago #261517

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6455
  • Karma: 3
  • Thanks: 456
Hi,

1) in each form you can add this code in Before form pieces (form->advanced->more options->form pieces->before form):
$this->execPieceByName('ff_InitLib');
$db = JFactory::getDBO();
$db->setQuery('Select id From #__facileforms_records Where name="FormName" '); //replace FormName with name of your form (not title)
$ids = $db->loadColumn();

$id = implode("', '", $ids);
$db->setQuery("Delete From #__facileforms_records Where id In ('$id')");
$db->execute();
$db->setQuery("Delete From #__facileforms_subrecords Where record In ('$id')");
$db->execute();
The code first gets a list of records' id's that has 'FormName',
then you have to implode it to get a string and then you delete from _records and _subrecords tables all the entries that have that id.

2) in Manage records you can select a specific form and then delete all records of that selected form

Hope this helps

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Last edit: Post by tihana.krivic.

How to delete all records from a specific form 1 week 3 days ago #261519

  • Topic Author
  • easytherm
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 411
  • Thanks: 2
I allready tried the second one which is still a bit slow. I'll try the first solution now
thank you for your help

Please Log in or Create an account to join the conversation.

How to delete all records from a specific form 1 week 3 days ago #261520

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6455
  • Karma: 3
  • Thanks: 456
HI,

ok, please let me know the result

Regards,
Tihana

Please Log in or Create an account to join the conversation.

How to delete all records from a specific form 1 week 3 days ago #261523

  • Topic Author
  • easytherm
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 411
  • Thanks: 2
Hi Tihana, I'll do that now and some clarifications

first your code which I modifed for the form named "saisie_des_vols"

so my piece of code:


$this->execPieceByName('ff_InitLib');
$db = JFactory::getDBO();
$db->setQuery('Select id From #__facileforms_records Where name="saisie_des_vols" '); //replace FormName with name of your form (not title)
$ids = $db->loadColumn();

$id = implode("', '", $ids);
$db->setQuery("Delete From #__facileforms_records Where id In ('$id')");
$db->execute();
$db->setQuery("Delete From #__facileforms_subrecords Where record In ('$id')");
$db->execute();

Now...

I think that the purpose of you code is to delete all data related to this form name, every time this form is called. Is this correct ?
If I understand correctly, the sql execution will be launched directly from the before form pieces, no other action beeing necessary. Is this correct ?


I have to put this at the beginning of Before form pieces of that form

this form allready has a before form pieces (used to pull data before form execution).
how to combine it with the new code. Do I just have to put your code before mine and then all old records will be cleared and a new record will be generated after form execution ?

Is that correct?

Thank you in advance for your response

Jacques

Please Log in or Create an account to join the conversation.

How to delete all records from a specific form 1 week 3 days ago #261525

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6455
  • Karma: 3
  • Thanks: 456
Hi,

I think that the purpose of you code is to delete all data related to this form name, every time this form is called. Is this correct ?
If I understand correctly, the sql execution will be launched directly from the before form pieces, no other action beeing necessary. Is this correct ?

Yes, you are right. In before form you can add other action too

this form allready has a before form pieces (used to pull data before form execution).
how to combine it with the new code. Do I just have to put your code before mine and then all old records will be cleared and a new record will be generated after form execution ?
Is that correct?

All records with this form name will be deleted

Regards,
Tihana

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Time to create page: 0.050 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!