Appex sample code