Adding Custom Button in Metadata Schema



We have done the customization in metadata schema based on our project , Please find below our requirement:

  1.      We have to create a custom button on metadata schema.
  2.      Once the metadata  is filled for any two specific fields.
  3.       By clicking on the button, it should make a ajax call.
  4.       Then the remaining metadata fields should be populated as a response from ajax.