Only compute when a record is inserted, not updated - example needed.

mattyb - March 11, 2008 - 00:21
Project:Computed Field
Version:5.x-1.2
Component:Code
Category:support request
Priority:normal
Assigned:mattyb
Status:closed
Description

Hi, could you tell me what code I'd need to wrap around my current compute code so that it only actioned whe a record was inserted and not afterwards for updates.

example code

$node_field[0]['value'] = "hello" ;

Many Thanks

#1

jaxta - March 11, 2008 - 09:16

Hey, I could really do with some help on EXACTLY the same problem!

Can anyone help?

Many thanks

#2

jaxta - March 11, 2008 - 09:27

Fixed!

I just put the code :

if ($node_field[0]['value'] == '') {
example in here ;
}

....in computed code field settings.

#3

mattyb - March 11, 2008 - 09:35
Status:active» closed

if ($node_field[0]['value'] == '') {$node_field[0]['value'] = "hello" ; }

Cool cheers jaxta

 
 

Drupal is a registered trademark of Dries Buytaert.