• Anju Kumar
  • NEWBIE
  • 35 Points
  • Member since 2021

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi,
I had created data in the custom metadata for city and zipcode...
I want to write the apex trigger to autopopulate the cityname If I select the zipcode which s present in the custom metadata...
Could you please help me to write the trigger for the above scenario...
I had written the apex code to fetch the custom metadata
And now I want to write the trigger to autopopulate the city name if we choose the zipcode.
trigger Autopopulate on Contact (after insert) {
// When a new account is created, fill in the city and state based on zip code

           if (trigger.isAfter && trigger.isInsert) {

                      zipcodemetda.fetchAllMetadata();
               

           }

}


 
Hi,
I had created data in the custom metadata for city and zipcode...
I want to write the apex trigger to autopopulate the cityname If I select the zipcode which s present in the custom metadata...
Could you please help me to write the trigger for the above scenario...
I had written the apex code to fetch the custom metadata
And now I want to write the trigger to autopopulate the city name if we choose the zipcode.
trigger Autopopulate on Contact (after insert) {
// When a new account is created, fill in the city and state based on zip code

           if (trigger.isAfter && trigger.isInsert) {

                      zipcodemetda.fetchAllMetadata();
               

           }

}