Only show annotation on new record forms?

perkinsarm
Mega Guru

We would like to provide some instructions, but only on a new record form. There is a use case to allow some users access to the regular form but in specific cases we want to make sure that appropriate record producers are used. We added an Annotation to the form containing instructions and links to those record producers. The annotation isn't appropriate when a record already exists.

Is there a simple way to remove the Annotation from the form if the record is not new?

I've seen proposed solutions where you try to hide it with CSS hacks but they leave a space where it would normally appear.

Is there a possibly better alternative solution?


Thanks,

Brad

1 ACCEPTED SOLUTION

perkinsarm
Mega Guru

The solution I found was to avoid using an Annotation altogether. Trying to hide it with the View Rules solution would require too much effort. Hiding it by manipulating the DOM was theoretically possible, but I couldn't make a Client Script to do that.   Instead I removed my annotation and simply created an On Load client script that uses g_form.addInfoMessage(same annotation text) to the same effect.


function onLoad() { // Display instructions and links if the form is displaying an existing record. if(g_form.isNewRecord()){ g_form.addInfoMessage([html that mimics the desired annotation]'); } }


View solution in original post

10 REPLIES 10

I like it.