Getting state code and country code from area code of phone number - salesforce-communities

I need to extract the state code and the country code from incoming web-to-lead phone number in Salesforce
Example if the area code of a phone number is (421)
I need a way to populate the state code and the country code with the appropriate data

there is a way for this but it needs backend coding for this in which whenever a lead is generated from the web it checks the area code from the phone number and decides what will be the appropriate state code and country code for the given area code.
And with the help of backend coding, we can set the add and remove the area codes dynamically.
But right now salesforce doesn't have any automated based feature for this requirement.

Related

Vee-validate - show error if input does not return an object

I'm using Vee-validate in my Vue.js project, where in the purchase flow I have an input where I write a postal code and a list of Dealers show appear if they serve the postal code.
However, and my question, is there a way for vee-validate to check if there are no dealers associated to that postal code? So that the user knows to write up another postal code until they can find a dealer.
Thanks for your help!

How to Collect dijit/form/combobox Selected Values in Repeat Control

An XPage is used to display the number of points a person has collected, and the number of points remaining (see below).
I have a repeat control which gets a collection of documents meeting a specific criteria. The last column in the control contains 5 digit/form/comboboxes, which are displayed or hidden, according to the number of fields on each document that contain data.
The layout contains gift cards worth a certain amount of points, and the person can select how many of each gift card they want. eg.
Company Available in Values of Points Required Quantity Requested
The Quantity Requested column contains the digit/form/comboboxes. As the person selects values in the checkbox, I want the number of points remaining to be recalculated.
The onChange event of the digit/form/comboboxes calls a function in an Output Script which calls an RPC, which in turn calls an SSJS function. The SSJS function cycles through the documents displayed in the repeat control, gathering the points required information. I then wanted it to also grab the Quantity Requested. I understand from a previous posting that because of the way the digit/form/combox is rendered, I can only get the value using CSJS with dijit.byId and perhaps putting the value in a hidden field and retrieving it from there.
I can't seem to wrap my head around how I will do this when the repeat control will make it possible for there to be many combobox1 and combobox2, etc.
The XPage is not bound to a form, because all the items are just calculated on the fly and then discarded.
What is the best way to do this?
The JSON RPC service can't interact with any changes made in the browser, see https://www.intec.co.uk/json-rpc-service-component-tree-manipulation-openlog/. This could be the cause of your problems.
You may be able to get around it by triggering a partial refresh (POST) before calling the JSON RPC. In theory that might work, because the component tree (server-side map of the XPage) would get updated by the partialRefreshPost and the updates picked up by the JSON RPC. It's possible though that the Restore View picks up a version of the XPage other than the one for the browser, I don't know. I've never investigated that.
It's been a while since I've worked with server java script, I have been doing it the managed bean way with ActionListeners. If you have the data in the UI, then can you avoid server side processing and do it client side?
You can also use the DOM XSP Object like XSP.setSubmittedValue to have a key value pair sent with your post request to the server side, you can only have one... it can be JSON or any other value you set it to from the client side javascript.
I figured out how to do this. If anyone wants the code, let me know and I'll provide it.

Minimum fields to Maximize Payment Conversions?

I took a look at Bluesnap's Auth Capture API - https://developers.bluesnap.com/v8976-XML/docs/auth-capture specifically the "card-holder-info" element.
What minimum fields needs to be passed to maximize payment conversions? I want to map these fields to my checkout UI page where I would like to have my customers enter minimum number of fields to strike a balance between being frictionless vs maximize conversions.
Thanks.
The minimal details of the card holder are first name, last name and zip code. That's all the information BlueSnap requires to process the purchase.
The process is already pretty streamlined. From the optional fields you may add, adding country and state might have some effect as some processors use this information to validate the shopper.

Can we track the user location without internet in IOS?

Actually i build the travel app which helps to track the user location but if there is no internet how can i store the location ?is there any trick to findout the location with GSM ?
Yes It is very much possible but gets useless to you.
You can get the approximate (lati & longi) position(if operator allows, I dont think they do) but what would you do because It wouldn't be possible to communicate back to traveler/user. At most you can do is send user SMS.
Mobile network is consisting of up of a number of adjacent radio cells, each of which is characterized by an identifier made up of four data items:
Cell ID
LAC, or Local Area Code
MCC, an acronym for Mobile Country Code
MNC, or Mobile Network Code, which obviously identifies the phone company itself
For this reason, once a cell name and coordinates(latitude and longitude) are known, and considering the maximum distance allowed between this cell and a phone before the phone connects to a new cell, it is possible to find out, approximately, the most distant position of the phone itself.
Its not possible to use GSM.GSM service providers can get the location details but they don't share those data to public.

Geocoding with rails search

I've been running into some location based searches using the Google Maps API (more of a structural issue on my end than any criticism of the mapping api)
For example, if a user searches for "Victoria, Canada" it will bring up results for "Victoria, Canada" as expected. However, if a user searches for "Canada," google returns a longitude and latitude for the middle of the country, which is essential for correctly centering the map. However, it will not display any results since the nearest location is too far away from the location returned by google. I'm filtering out results that are about 20 miles away.
Can the Google Maps API return anything that I could use to tell if a user has entered a state or country name? If not, has anyone developed a work around solution?
Ideally, I would like to avoid just ordering the results by nearest location. I don't want items for "Spain" showing up at the bottom of a list when a user searches for "United States." I would try to determine if the query is a state or country prior to the search, but this seems very daunting task given the different possible spelling of country and region names. If I was only expecting english spellings, it would be a much easier approach.
Assuming this is a form on a site that has a controller parse the form and send the request to Google's API, you could break the form out into address, city, state, and country (if needed) form elements then make the address and city required fields.
I'm doing a similar approach with a site I'm building using Google Places API and it seems to work for me.