Coming soon: Your brand new Help Center & Community! Get a sneak-peek here

Is it still possible to somehow use hook-scripts to slightly alter standard screens like Edit Company or Edit Contact?

We used to be able to do this with creating a script with include_ids like:

HtmlPage.lang_ticket_editCompany.beforeSetFromCgi

But with the last SO9 versions this is not impossible since the <!-- eventName: "HtmlPage.lang_ticket_editCompany" --> has changed and is not avialable to find out.

So my question is: Can I still use this technique to disable edit functionality for extra-fields that I do not want the user to be able to change?

Making them hidden will not solve my problem since I want them visible in SO CRM when searching.

Original source to solution:

https://community.superoffice.com/en/content/content/customer-service/using-hook-scripts-to-slightly-alter-standard-screens/

 

RE: Is it still possible to somehow use hook-scripts to slightly alter standard screens like Edit Company or Edit Contact?

Hi

I have not tested this fully, but it might be possible to accomplish with these Triggers

Von: Michel Krohn-Dale 19. Mrz 2021

RE: Is it still possible to somehow use hook-scripts to slightly alter standard screens like Edit Company or Edit Contact?

Thanks, That will definitely work.

Integer i = 0;
while(i < getNumHtmlElements())
{
HtmlElement h = getHtmlElement(getHtmlElementName(i));
String type = h.getTypeName();
String value = h.toString();

 

h.setDisabled(true);
h.setNotEditable(true);
h.setErrorMessage("Du får ej ändra!.");
i++;
}