0

I have two managed metadata columns :-

  1. Country --- America, India

  2. City --- Sydney, New York, Bombay, Pune.

If I select America as Country I should only be able to see/select Sydney and New York in city column and if I select India as country I should only be able to see/select Bombay and Pune in city column.

How can this be done using event receivers?

1

I know you asked for code but sometimes the code makes the solution more challenging. Can you use a single managed metadata column that stores the relationships as a hierarchy? For example, create a term set called City with each city being a nested term under the country it is in.

  • United States
    • New York City
    • Atlanta
  • India
    • Pune
    • Bombay

If you still need the columns split you can use the event handler to split the single field into two separate columns in your list based on the dot location (Country.City). If you prefer the column to show in Country.City format then be sure to change the Display Format on the column so that full path is displayed in the column otherwise you will only see the city name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.