+ Start a Discussion
snippets@sfsnippets@sf 

Mailing Address in Lightning - MailingCountry and MailingState

Requirement : To get All States based on country selected in Lightning Custom Component. [Behaviour similar to MailingAddress in Contact Object]

Scenario : MailingCountry and MailingState are Compound fields in MailingAddress.

                 If onlly those two fields are required, in the custom object we would have to create a Custom Dependent Picklist Define all values.
                 This force for a maintenance whenever the data changes globally 
Classic Version: 
                  In Classic version of VF Page and Controller we could do the following.
                  Create a virtual contact varirable c and use like c.MailingCountry and c.MailingState
                  and map the same in CustomObject via controller logic [This Workarrond works perfectly without any maintenance involved]

Lightning Version:
                 We could use only the mailingaddress as compound field in the component,
                 But this would give me all the other fields too...  like Postal code, and city etc...
                
                 I would like to see only those two fields. How can we achieve this in lightning without custom maintenace of Country and State.

Thanks in advance! for taking time to read this completely to get a solution.
                I am open for sharing screenshots over this requirement. please let me know if it is needed.




 
Best Answer chosen by snippets@sf
snippets@sfsnippets@sf
Found this to be a salesforce issue. I am replying to my own questions. for people who land here can save thier time.