I'm not sure what you mean under "You cannot use getControl with duration field". Do you mean that it's not allowed? I posted fragment from the code of application, which is certified by ServiceNow and which is available on https://store.servicenow.com/.