Apologies, I still don’t know much JavaScript, but I am sure this is something that can be addressed fairly easily. Any guidance is much appreciated.
I have a model for Case and a model for FutureAppointments, I am currently using a MODEL_LOOKUP formula to pull the Next Appointment up to the Case Table, BUT it is not a sortable column, which is what I would like to accomplish.
Because Next Appointment will always be a moving target, I am looking to create a JavaScript Snippet that can be invoked whenever a model is queried (page load, and subsequent queries - maybe through a Refresh button on the Page) - any time the snippet is invoked the snippet would loop through all Appointment__c records and find the first record in the FutureAppointments model related to the Case ID.
Assume there will be more than 1 case listed on this page, the Appointment Table is just there for reference, but would be removed. Just after a list of Cases, and the ability to sort by Next Appointment.