|
Malaphus Novice
Joined: 11 Aug 2003 Posts: 34 Location: USA
|
Posted: Sun Aug 17, 2003 6:20 am
Problem with item database triggers *NEW QUESTION* |
OK, I found out the problem... the only thing wrong now is that it is still adding duplicate records... this is my current IF statement, but i don't think its working because the %find function i think only works for string lists, not db vars (which is what @newrecord is)... How would I fix this?:
#VAR itemDoesExist %find( %item( @newrecord, 1), All)
#IF (@itemDoesExist = "") {
#WIN Chat Item does not exist, adding!
#WIN Chat @newrecord
#NEW All @newrecord
}
At the moment it seems like the itemDoesExist variable is always being ""... even if the item does exist |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Aug 17, 2003 8:45 am |
%item is a list function. If @newrecord is a database variable, use a database function, such as %db. Assuming the first column of your database is Name:
#VAR itemDoesExist %find( %db( @newrecord, Name), All)
#IF (@itemDoesExist = "") {
#WIN Chat Item does not exist, adding!
#WIN Chat @newrecord
#NEW All @newrecord
} |
|
|
|
Malaphus Novice
Joined: 11 Aug 2003 Posts: 34 Location: USA
|
Posted: Sun Aug 17, 2003 8:55 am |
Thanks a ton LightBulb! Your help is always appreciated!
|
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|