-1

Hello SFDC Experts and Community People, Thanks for all your help so far to help me with the JS code which was inserted in Web2Lead HTML form code to obtain Lead's country info. However as the business requirement is to update the Country field on Lead object I have created a custom Formula field called Country on Lead object which should be able to fetch Country code from the Address field(this field is already getting updated by using JS inside web2lead form generated by OOTB feature of Salesforce). However while I am trying to update the Country field with the below formulas getting different errors:

VALUE(Address.country)
I am getting this error

Error: Field Address does not exist. Check spelling. TEXT(Address): Incorrect parameter type for function 'TEXT()'. Expected Number, Date, DateTime, Picklist, received Location

Any help would be appreciated in this regard.

0

1 Answer 1

0

You cannot reference the Address field on Lead in formula fields.

However, you can reference the Country field. In your formula, replace Address.Country with Country. (You won't need to wrap it in TEXT or VALUE)

Given that you can just reference the Country field directly, you don't need a formula field.

4
  • How are you creating this formula field? I have tested this myself and it works fine. The formula field is on Lead and is of type Text and the formula is Country
    – fred
    Jun 30, 2023 at 15:44
  • I was wrong..yes it's working ..you are amazing and that's why I MARKED YOUR ANSWER AS THE CORRECT ONE. THANKS A LOT AS IT HELPED ME A LOT. FYI I TRIED TO EDIT MY COMMENT GIVEN ABOVE ON TOP OF YOUR ANSWER BUT COULD NOT(NOT SURE WHY). PLEASE DON'T MIND. HOPE TO GET IN TOUCH WITH YOU AGAIN. APPRECIATE YOUR HELP A LOT. THANKS AGAIN! Jun 30, 2023 at 15:49
  • ANY IDEA HOW TO UPDATE THE LEAD SOURCE FIELD TO 'WEB' WHILE CAPTURING THE LEAD INFO VIA WEB2LEAD FORM? Jun 30, 2023 at 15:53
  • No sorry. Ask a new question and see if someone else knows
    – fred
    Jun 30, 2023 at 15:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .