Content Builder Menu Filter

  • mihaela
  • Away
  • Administrator
  • Administrator
  • Posts: 2651
  • Karma: 92
  • Thank you received: 354

mihaela replied the topic: Content Builder Menu Filter

Hello,

Yes, you are right, you can't use that value for the menu filter. That is because it doesn't change the actual value in that field, but only what is displayed in the list view of records.

Writing an SQL query would be a good solution.

This is an example of a query in Before Form pieces that would do as you want:
$this->execPieceByName('ff_InitLib');
$db = JFactory::getDBO();//Get Database Object

$db->setQuery("UPDATE #__facileforms_subrecords SET value ='Yes' WHERE element = 8999 AND value < curdate()"); 
$db->execute();

The only thing is that this solution would work only for date format "yyyy-mm-dd", would that be acceptable for you?

Regards,

Mihaela
#237959
  • kenryanjr
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 144
  • Thank you received: 0

kenryanjr replied the topic: Content Builder Menu Filter

Wouldn't that update it going into the database? I need it updated after the record has expired. I think I have a solution for this. But it is ugly. I'll let you know.
#237962
  • mihaela
  • Away
  • Administrator
  • Administrator
  • Posts: 2651
  • Karma: 92
  • Thank you received: 354

mihaela replied the topic: Content Builder Menu Filter

Hello again,

The code in Before Form would be executed each time a record is created.

The main point, in this case, was the query that would in all records, for which the expiry date is in the past, set the value of that field to "Yes".

I hope that the solution that you have will work out.

Regards,

Mihaela
#237969
  • kenryanjr
  • Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 144
  • Thank you received: 0

kenryanjr replied the topic: Content Builder Menu Filter

That doesn't work. I need the record to fall out off of the list when it reaches the expirey date. I have a workaround for this. If I can get the BF insert and update working properly into another database table I can then run a cron job that runs an update on that table every night to see if the date is expired and then set another column to "yes". Then I can use the menu filter to look for only records that are "no" in that column which I set in a hidden input field when the user submitted the form. But I am having all kinds of issues with insert and update.

If I turn update integrator off then it works fine. But if it is on, then the records is added twice to me external table. I think it has to do with my listing ID that I am using a random number generator set for me so it will be unique. I can't use a userID or email as users will be able to add more than one record.

I am going to try the way that you sent me in email and see if that works as intended.
#237975
Moderators: ForumSupporttomeperica
Time to create page: 0.065 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

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!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here