Submitted by jan_rifkinson on 2009/06/11 10:16
Current Auto assign for Boolean Pndg field
 
A:WikiTag=AddKeyWord(WikiTag,"{pndg}")|E:WikiTag=RemoveKeyWord(WikiTag,"{pndg}")
 
I also want to add
when text contains word 'Lmsg', then Pndg is 'yes'
 
What's the syntax for this combined w the current statement?
 
bumped 06/11/09 09:23 pm EDT
 
Thanks.
 
--
Jan Rifkinson
Ridgefield CT USA
 
 

Comments

I don't have the time to test it, but you can try using the HasKeyword VBScript:
 
AM:Pndg=HasKeyword(YourTextFieldToSearch,"Lmsg")|E:Pndg=
 
Try it and report back.

> when text contains word 'Lmsg', then Pndg is 'yes'
 
Which text ?? The item text ? the wikitag text ??

jan_rifkinson

2009/06/12 08:10

In reply to by Armando

Item text
 
--
Jan Rifkinson
Ridgefield CT USA
HP Blackbird Vista Ultimate SP-1

Armando

2009/06/12 13:01

In reply to by jan_rifkinson

then replace "yourtextfield" (in Pierre's post) with the item field.
Did you try it ?

jan_rifkinson

2009/06/12 13:40

In reply to by Armando

yes & it produced an error
 
--
Jan Rifkinson
Ridgefield CT USA
HP Blackbird Vista Ultimate SP-1

Pierre_Admin

2009/06/12 13:44

In reply to by jan_rifkinson

This works fine:
AM:Pndg=HasKeyword(Item,"Lmsg",-1)|E:Pndg=
 
(In my other post, I forgot the ending: ",-1")
 
Last parameter should be -1 for case specific and 0 otherwise
 

Armando

2009/06/12 17:13

In reply to by Pierre_Admin

Nice one.
Maybe Jan should also be told that removing the keyword "Lmsg" from the item field will result in pndg=no

jan_rifkinson

2009/06/12 17:30

In reply to by Armando

Consider him told.
 
Actually, there's another setting that I have that changes pndg --> no when it is marked done. Item background & font also change color like magic.
 
Now if I could just learn to figure this stuff out by myself I would be less of a PITA but I don't hold out much hope for myself in this regard.
 
--
Jan Rifkinson
Ridgefield CT USA
HP Blackbird Vista Ultimate SP-1

Armando

2009/06/12 19:55

In reply to by jan_rifkinson

Is that a question for how to do ::
 
> [...]  changes pndg --> no when it is marked done. Item background & font also change color like magic.
 
 
Or are you describing something you already did yourself ?

jan_rifkinson

2009/06/12 20:04

In reply to by Pierre_Admin

Since the actual field is called 'GTD_Pndg' I changed the equation as follows:
 
A:WikiTag=AddKeyWord(WikiTag,"{pndg}")|E:WikiTag=RemoveKeyWord(WikiTag,"{pndg}")|A:ItemColor=&HCAFFFF|E:ItemColor=|AM:GTD_Pndg=HasKeyword(Item,"Lmsg",-1)|E:GTD_Pndg=
 
The result is that nothing happens but no error either
 
However, if I manually check GTD_Pndg, the rest of the formula works ok, i.e.
the item changes color
the wikitag {pndg} Is attached
Changing GTD_Pndg to 'no' removes background color & wikitag
Likewise marking it 'done'
 
I tried the last equation by itself, i.e.
AM:GTD_Pndg=HasKeyword(Item,"Lmsg",-1)|E:GTD_Pndg=
and it did not work here.
Since it is working for you, I am undoubtedly doing something wrong
 
Maybe you can try the entire formula & see if it still works for you.
 
Thank you.
 
--
Jan Rifkinson
Ridgefield CT USA
HP Blackbird Vista Ultimate SP-1
 
 

Armando

2009/06/12 20:45

In reply to by jan_rifkinson

This is because, this part should be in the item field (auto assign rules) :
 
AM:GTD_Pndg=HasKeyword(Item,"Lmsg",-1)|E:GTD_Pndg=
 
 
And this one should be in the GTD_Pndg field (auto assign rules) :
 
A: WikiTag = AddKeyWord ( WikiTag,"{pndg}" ) | E: WikiTag = RemoveKeyWord ( WikiTag,"{pndg}" ) | A:ItemColor=&HCAFFFF | E:ItemColor=
 
 
I can explain why if you don't understand.

jan_rifkinson

2009/06/12 21:46

In reply to by Armando

Armando, thank you.
If you hadn't pointed out the logic of this I would never have figured it out (probably) but let's see if I got this right:
 
AM:GTD_Pndg=HasKeyword(Item,"Lmsg",-1)|E:GTD_Pndg=
refers to a condition in the item
 
A: WikiTag = AddKeyWord ( WikiTag,"{pndg}" ) | E: WikiTag = RemoveKeyWord ( WikiTag,"{pndg}" ) | A:ItemColor=&HCAFFFF | E:ItemColor=
refers to a condition affecting the GTD_Pndg field, i.e. it is changed to yes (or no)
 
Essentially between these two equations:
the first one can trigger the second one
but
the 2nd one doesn't trigger the first one
 
Am I close?
 
--
Jan Rifkinson
Ridgefield CT USA
HP Blackbird Vista Ultimate SP-1