I have a URL field called CampaignLink__c which I pass a URL to, however, the url that is inserted is malformed.

Desired Result:
Inserting a URL to a custom field of the Lead object on Salesforce.

This is a Web-To-Lead form with this code:

<input type="hidden" name="CampaignLink__c" value="www.schechter.org.il/land/landing/mishley/?f=facebook-ctw-Jerusalem/">
<input type="hidden" name="ArticleName__c" value="land/landing/mishley/">

I tried to insert a URL with http or without but all I get is this: http://facebook-ctw-Jerusalem, also tried with urlencode(), same result.

Any idea why the URL is not inserted as it looks on the form HTML? how can I check for something like "input mask" or "input validation" (not sure of the terminology on Salesforce) for that field in Salesforce.


  • Have you tried debugging this by enabling debug logs? By adding a debug statement in before trigger operation?
    – Suneel
    May 27 '18 at 9:37

As that is a URL, you have to URL encode it.

so if URL was "www.schechter.org.il/land/landing/mishley/?f=facebook-ctw-Jerusalem/"

it will be

  • Same thing, URL is malformed in the same way.
    – odedta
    May 27 '18 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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