Context menu to enable/disable multiple devices

Hi, I’m trying to create a Context Menu just to set a Lookup (“State”) to a specific Value (“Available”) or (“In use”) and is not working.
Is there any reference to the client api to create this JS menus?

Thanks in advance