We have inserted a button in the contact module which calls a deluge function. The function is designed to demote a contact that is no longer active and reassign it as a lead. The function's script is below but for some reason it doesn't appear to work. Could you highlight where we are going wrong?
