I am trying to trigger a script when a the end date is changed on the contracts screen. I tested the script itself and it works fine, but I cant get it to trigger when I want it to. The field I need to update is a custom field called Months Remaining and is linked to contracts.user_def5.
I linked the script to End Date.
Here is the client script:
var contractID = getControlValue('contract', 'contract_id');
var contractLength = getDBValue('1', contractID);
setControlValue('contract', 'user_def5', contractLength);
alert("done");
And the sql script it calls:
SELECT DATEDIFF(M,GETDATE(),CONTRACT.END_DT) FROM CONTRACT WHERE CONTRACT_ID = '{0}'
Are there other ways of triggering this?