I am having trouble finding the method I can use to return the column name of relation. ie contact_to_certificate should return contact_id
You have to use the solutionmodel, it will look something like this:
var _relation = solutionModel.getRelation("contact_to_certificate");
var _relationItems = _relation.getRelationItems();
var _column = _relationItems[0].primaryDataProviderID;
Perfect, thanks.