-6

I have a requirement that in Filed client_Logo__c(URL) whenever user enters any URL : IF it dosen't begin with http or https then it must throw a validation error.

closed as off-topic by Derek F, David Reed, Reshma, Himanshu, Pranay Jaiswal Jan 21 at 18:29

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on problems in code you've written must describe the specific problem and include valid code to reproduce it. For help writing short, self-contained syntactically-valid examples, see: SSCCE.org" – David Reed, Reshma, Himanshu, Pranay Jaiswal
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Possible duplicate of Validation Rule for URL – Derek F Jan 21 at 15:03
  • 1
    You seem to be asking the same question multiple times. Can you explain how this question is different from your previous ones? Have you tried any of the suggestions you've gotten so far? Usually, if your questions are being closed, that means that you need to include additional information or ask the question in a different way. I'd strongly suggest reading How to Ask. Also, what have you tried so far? The purpose of this site is not so much "do my work for me" as it is "here's what I have, I'm stuck on this part, how can I move forward?" – Derek F Jan 21 at 15:08
1

Welcome to the exchange!

Have a look at the following link for some more in-depth explanation Click me!

For your case, if this is a default field, create a Validation Rule on your object.

Error Condition Formula

NOT(
   OR(
      BEGINS( client_Logo__c, "http"), 
      BEGINS( client_Logo__c, "https"),
      ISBLANK( client_Logo__c )
   )
)

The rest (Rule Name, Error message) can be whatever you like

Edited: Updated formula for further requirements

Have a look at the following

Examples of Validation Rules

Create Validation Rules - Trailhead

  • Even if it is blank then it is asking for the particular URL: Sorry for updating late that it may be blank also. – Abhijeet Kumar Jan 21 at 15:04
  • @AbhijeetKumar I've updated the code for your requirements and included a couple links that should help you learn validation rules, aswell as some examples to use! Have a read of How do I ask a good question? for the future! – David Picksley Jan 21 at 15:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.