function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AJ-ITIAJ-ITI 

Formula for limiting number of leads registering online with a web-to-lead form

I am trying to create a web form (using web-to-lead) where customers can register for a webinar. I know how to do that.

 

I need to limit each webinar date to 20 spots - so only 20 leads can register for each through the web-to-lead form. It should stop accepting leads and post a "this class is full" notice when 20 is reached. I called and asked SF support how to limit the number of leads that come through, and they said with a formula field. Can someone help me write a formula as well as tell me where to place this formula?

 

Thanks so much,

Ariel

colemabcolemab

I would recommend using a VF page on a public site with a controller extension instead of a simple HTML web2lead form.

 

Then you can put an SOQL aggeragte query in the controller that looks at the date in question and if the total / sum returned is over a constant, redirect to a full / thank you page.

 

here is a link to a cook book recipe that can you get started down the VF web2lead path.  Be sure to read my comments on the bottom of that page and the relevant threads I link to about some security settings you need to probably change.

colemabcolemab

and here is a link to the SOQL aggregate functions documentation.