Apex code for salesFetch application