salesforce rule to display selected values in picklist on selection of another picklist - salesforce

I am new in salesforce and learning it.
There is a task which i want to perform, Description is as follows:
I've created a custom object Property and few fields for this object.
There are two picklist type of fields for this object Country and City.
Country field contains following values: United States, United Kingdom, India, China, Japan and etc.
City field contains following values: New York, Los Angeles, Glasgow, London, Tokyo, Beijing, New Delhi, Dehradun etc.
What i want to do is when user selects a specific value in Country field only related City should display for selection in City field.
For example: If user selects United States in Country field then only New York and Los Angeles should be displayed for selection in City field or If user selects United Kingdom in Country field then only Glasgow, Manchester and London should be displayed for selection in City field and then user will select one value from available City value.
Thanks in advance, Any help is appreciated.

Field dependices will do this for you

Related

How to split city, state, country string using postgresql

I need to split "Indianapolis, Indiana, United States" into "Indianapolis" in one column and "Indiana, United States" in another.
However users_geo.location_name has examples such as:
"Kane, Illinois, United States"
"New Jersey, United States"
"Washington, D.C., United States"
Where the city doesn't always exist in the first position. Ideally, I would like to filter for strings with atleast 3 words, then take the first word and put it into a new column.
I have tried:
SELECT location_name,
regexp_split_to_table(users_geo.location_name, E',') AS city
FROM public.users_geo;
However it turns out like the screenshot which causes duplication.(https://i.stack.imgur.com/eFiXq.png)

STRAPI REST API Endpoint to get items with certain values in two relations

I struggle to get strapi rest api to return a restaurant that has certain values in two realations. The documentation does not tell me the answer.
My structure:
Restaurants has two relations and some data fields:
Name (data)
Image (data)
City (relation)
Foodtype (relation)
City has mutliple values
Berlin (id:1)
London (id:2)
Foodtype has multiple values
French (id:1)
Chinese (id:2)
I would like to create an API call that populates me all All images of Restaurants in Berlin with French food
I managed to populate All images of Restaurants in Berlin (so London is filtered out) but I would also like to reduce it to the restaurants with French food I used this GET call so far http://localhost:1337/api/cities/1?populate=restaurants.image
cities/1 reduces it to the City relation by ID. Can anybody advise me how I extend the API call to reduce it further to the foodtype relation for ID 1?

How to access district by district name in antv using React js?

I want to create a map for showing the number of products selling in a particular district of India. in the backend, I have data like "West Delhi" name of the district and total count.I want to display the data in ant vision L7 district map. But not able to understand How they are consuming the data.

CakePHP saving data in multiple tables

I have shop struct like
1: Shop has many Categories
2: Categories have 1 to many Sizes and Products
3: Each product belongs to exactly one Category
4: As Sizes belongs to Categories so each product belonging to a category will have same sizes.
Now my problem is in Product add form.
I have form the contains product's input fields and a selectbox to select the Category.
As soon as I select a category, an Ajax request will be created, which return sizes as inputbox assigned to the selected category. The input boxes will be used to enter the price
for each size of the product. (As the input fields will be generated in Ajax, how may i use the form helper?)
Now I want that on clicking the save button, the product information should be stored in product table, and the prices should be saved in
Product_Prices table which contains product_id, size_id, price columns.
How should i name my inputboxs? and how should i call the save method so that the informations are properly saved?
To save one-size
//$this->Form->create('Product');
$this->Form->input('category_id');
To save many-size
//$this->Form->create('Shop');
$this->Form->input('category_id');
or use checkbox instead list
$this->Form->input('category_id', array('multiple' => 'checkbox'));
If you want to save property of another model together with you main model you add model name (alias) as prefix and use saveAssociated() or saveAll().
echo $this->Form->input('ProductPrice.price');
see: http://book.cakephp.org/2.0/en/models/saving-your-data.html#model-saveall-array-data-null-array-options-array

Get Longitude and Latitude from Country Name

I have Gmaps embedded in my site which pulls out a list of dealers from my database around the world and plots their location with a marker based on the dealer postcode in Gmaps. This works great however I need to extend this functionality to support dealers who do not have a postcode but rather, they are assigned to Countries.
So for example, Test Dealer could be assigned to Germany and Belgium so I need to somehow get a generic longitude and latitude value for the country names "Germany" and "Belgium" and then show a marker for those long/lat values.
Is this possible?
If so, where do I start?!
Thanks for reading.
kris
Try using google's geocoder. Just provide a generic address, in your case a country and it will return the center point of that country together with the coordinates(latitude and longitude)
Here's a link. https://developers.google.com/maps/documentation/javascript/geocoding

Resources