JamesDalton
5 years agoQrew Trainee
Make Formula-URL fields conform to dynamic form rules
Hello,
I am working on a button that changes statuses from one to the next in a strict order. Most of these statuses were originally linked to dynamic form rules that would allow or disallow a status to be changed based on other factors. For instance, if a user were to choose 'Quote Sent' the user would not be allowed to select that status until a quote record was created. This was all controlled by form rules. I tried adding in a button mentioned above to make it easier for the user and prevent them from choosing a previous status by mistake. The button seemed to work at first, but later it seemed to override the form rules. For example there are messages that are supposed to be displayed informing the user of why they cannot change the status at the time.
Here is my Formula-URL code and a screenshot of my status field. If there is anything I can do to make this work or if this is impossible, I would appreciate any help. OR is there a way to make Formula-URL fields 'read-only'/disabled?
------------------------------
James Dalton
------------------------------
I am working on a button that changes statuses from one to the next in a strict order. Most of these statuses were originally linked to dynamic form rules that would allow or disallow a status to be changed based on other factors. For instance, if a user were to choose 'Quote Sent' the user would not be allowed to select that status until a quote record was created. This was all controlled by form rules. I tried adding in a button mentioned above to make it easier for the user and prevent them from choosing a previous status by mistake. The button seemed to work at first, but later it seemed to override the form rules. For example there are messages that are supposed to be displayed informing the user of why they cannot change the status at the time.
Here is my Formula-URL code and a screenshot of my status field. If there is anything I can do to make this work or if this is impossible, I would appreciate any help. OR is there a way to make Formula-URL fields 'read-only'/disabled?
var text nextStatus = If([Status] = "Pending Initial Action", "Assigned To Underwriter", [Status] = "Assigned To Underwriter", "Quote Sent", [Status] = "Quote Sent", "Awaiting Payment", [Status] = "Awaiting Payment", "Payment Received/Make Live", [Status] = "Payment Received/Make Live", "Policy Live/Money Received", [Status] = "Policy Live/Money Received", "All Appropriate Documents Received", [Status] = "All Appropriate Documents Received", "Policy Documents Sent to Broker");
var text changeStatus= URLRoot()&"db/"&[_DBID_RENEWALS]&"?a=API_EditRecord&rid="&URLEncode([Record ID#])&"&apptoken=d24xdccdwjqg6s9cdce8bq29d8n"&"&_fid_10="&URLEncode($nextstatus);
"javascript:" &
"$.get('" &
$changestatus &
"',function(){" &
"location.reload(true);" &
"});"
------------------------------
James Dalton
------------------------------