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
FinTechFinTech 

Comparing Strings

 I was wondering if anyone could give me guidance on the following.

I'm trying to compare two strings (two phone numbers). One from the document form and one from the Salesforce.com contact object. I'm just doing a document.getElementId("Phone").value != contact.get("Phone"...comparison...When I submit the system thinks the values are not the same when they are...How do you compare strings?
The_FoxThe_Fox
Hi FinTEch,

Can you a bit of your code, please

Regards

FinTechFinTech
Hi Fox. Thanks for helping out...sure. Here it is...

            var contact = queryresult.records[0];
            var _contact = new Sforce.Dynabean("Contact");
   ...

            if (document.getElementById("MobilePhone").value != contact.get("MobilePhone")) {
                _contact.set("MobiilePhone", document.getElementById("MobilePhone").value);
                _contact.set("MobilePhone_Updated__c", "true");
            };

<Input name="MobilePhone" id="MobilePhone"</Input>
The_FoxThe_Fox
Hi,

I think there is a typo in your _contact.set("Mobii...)

Otherwise I dot not see why for the moment

Regards
FinTechFinTech
That's a typo..I changed the values for your post.