Hi

I'm using the compute field to generate an api key, only I don't want it to re-run the script every time I save the page, only on insert.

I'm not sure what approach I should take.

Thanks in advance

Matt

Comments

jaxta’s picture

I could really do with some help on this as well (for slightly different reasons!).

Can anyone help?

thx

mattyb’s picture

To get the computed field to only generate first time around is a simple as wrapping this around your computed code

if ($node_field[0]['value'] == '' )
{ $node_field[0]['value'] = "hello" ; /* only work on insert and not on upates */ }

Thanks to jaxta who helped on this

Matt
www.crawlscore.com