-
How to get the IP address of the user's system in apex when they try to create a case in Salesforce?
Hi, I am facing an issue with cases in Salesforce, recently they were a lot of spam cases that have been created from web to case.
and this is not the first time it happened earlier also. So we have created validation rule on case to avoid spamming based on the subject, body, sender, etc but it's just a temporary solution because every time we receive a different kind of data, as soon as we get to know about spamming we are checking the values and adding those values in the validation rules to avoid further case creation.But now we have come up with the below solution.
Creating an IP address field on case object, on the creation of case in salesforce we are saving the IP address of the system which we received the data from. so our motto is whenever more cases are created from the same IP address (10+ cases within 24 hours from the same IP address) then we are going to block that IP address temporarily. So I think by implementing this we can prevent spam cases creation in salesforce.
Question is:
How to get the IP address of the user's system in apex when they try to create a case?
And please do let me know if you have a better solution.
-
This discussion was modified 5 years ago by
Manjunatha.
-
This discussion was modified 5 years ago by
Forcetalks.
-
This discussion was modified 5 years ago by
Forcetalks.
-
This discussion was modified 5 years ago by
Log In to reply.
Popular Salesforce Blogs
![](https://images.forcetalks.com/wp-content/uploads/2021/07/13131503/sa_1626182041b181-1024x535.jpg)
Lightning Platform Mobile for Mobile App Development with Salesforce
Mobile has always had an effective and transformational impact on companies. But unfortunately, many companies face trouble delivering an intuitive user experience as a customer…
![Flows in Salesforce](https://images.forcetalks.com/wp-content/uploads/2021/11/12170711/Flows-in-Salesforce.jpg)
Flows in Salesforce - Brief Guide
Well, now the automation procedures in Salesforce can be taken to another level using Salesforce Flows. Flow is doing an extraordinary job that enables you…
Popular Salesforce Videos
Driving Sales Productivity and Motivations from Your Salesforce Data
Meet OneUp Sales, the revolutionary sales motivation platform built for modern sales teams. By leveraging data extracted from systems you already use, OneUp powers lively…
How Salesforce is Paving The Way To Greater Digital Transformation
Digital transformation success is often a question of speed & implementation. Companies know how important technology is to their business, but can they evolve and…
Pass Salesforce Certification Exam In Your First Attempt
This Salesforce Training Video will help you understand the concepts of Salesforce and Salesforce exam so that you can pass the Salesforce exam in the…
Popular Salesforce Infographics
![](https://images.forcetalks.com/wp-content/uploads/2018/07/25073706/sa_1532504106Salesforce%20in%20UK%20Bannermin.png)
Salesforce in the UK: Fun Facts & Figures
The UK and Salesforce: now, if that relationship wasn’t love at first sight, nothing is! As platinum partners of Salesforce and with an office in…
![Salesforce Customer](https://images.forcetalks.com/wp-content/uploads/2021/12/14193332/Salesforce-Customer-1.jpg)
What is Salesforce Customer 360?
According to our State of the Connected Customer report, 76% of customers expect consistent interactions across departments. However, 54% say it often feels like sales, service,…
![right salesforce partner](https://images.forcetalks.com/wp-content/uploads/2020/06/10170541/right-salesforce-partner.png)
How to Choose the Right Salesforce Partner | Infographic
Choosing the right partner is a key factor that can make or break the success of your project. Salesforce is a powerful CRM platform, which…