Submitted by jan_rifkinson on 2010/12/20 11:23
I thought the following would work but it doesn't seem to & I don't know why.
Could someone explain the logic breakdown in this equation please.
 
Purpose
If I write any item that includes the word "MIRMA"
I want a boolean field named MIRMA checked off so I can easily create a grid later on.
(I guess I could do it by searching the entire dB for the word later on & doing a group assign & create a grid but anyway,)
 
What's wrong w the following
 
AM:MIRMA=HasKeyword(Item,"MIRMA",-1)|
E:MIRMA=|
 
TIA

Comments

Your auto assignment rules are correct as such. But where are they located ? they should be in the item field as this is where the action takes place (i.e. : This is where the data is parsed/analysed), Break down : AM:MIRMA=HasKeyword(Item,"MIRMA",-1)| AM: Means that whenever the field in which you located the rule (in this case : the "item" field) will be modified, the function/equation will be activated. MIRMA=HasKeyword(Item,"MIRMA",-1) : if you look at the code in the "system code" tab of the VB editor, it means that whenever the "MIRMA" string, case specific (uppercase in this...case) is found in the "item" field, the value of the "MIRMA" field is set to "true" (or -1). HTH

jan_rifkinson

2010/12/20 12:07

In reply to by Armando

This helped a lot.
The only part I didn't understand was the reference to the VB editor
 
The auto assignment rules are located in the item field equations
 
I closed IQ down & opened it again but the assignment to the MIRMA field doesn't seem to occur
 
There are several other equations a head of this which I've copied below but I don't see a problem with that but maybe there is one.
 
AM:GTD_Pndg=HasKeyword(Item,"Lmsg",-1)|
E:GTD_Pndg=|
AM:GTD_FoloUp=HasKeyword(Item," Call ",-1)|
E:GTD_FoloUp=|
AM:BDIxpns=HasKeyword(Item,"Movie",-1)|
E:BDIxpns=|
AM:MIRMA=HasKeyword(Item,"MIRMA",-1)|
E:MIRMA=
 
I also tried it this way (with final "|" character
 
AM:GTD_Pndg=HasKeyword(Item,"Lmsg",-1)|
E:GTD_Pndg=|
AM:GTD_FoloUp=HasKeyword(Item,"Call",-1)|
E:GTD_FoloUp=|
AM:BDIxpns=HasKeyword(Item,"Movie",-1)|
E:BDIxpns=|
AM:MIRMA=HasKeyword(Item,"MIRMA",-1)|
E:MIRMA=|
 
TIA

Armando

2010/12/20 23:31

In reply to by jan_rifkinson

I honestly don't know why it's not working. 2 things you could check though : 1- you shouldn't put the "|" character at the complete end. 2- your MIRMA field should really be named MIRMA. That's important as it won't work otherwise. 3- Other field with rules affecting MIRMA (or even MIRMA itself) could prevent your auto assignment to work. You could post screenshots of your Item and MIRMA fields (fields management) it you wish. == P.S. : "VB editor" is the same as "Visual Basic Editor" Can be seen by clicking on Tools -> Visual Basic Editor. You probably know that already. There you cans see all Basic functions which can used in IQ's equations & Auto-assign sections.

jan_rifkinson

2010/12/21 12:10

In reply to by Armando

I FOUND THE PROBLEM !! Yeaaa !!
The field was marked "Read Only" for some reason. This happened once before & I don't remember checking that off.
 
The VB editor scares me because altho I understand -- in principal what it does -- I don't understand scripting at all.
I noticed there was a function in there that looked like it was meant to figure out the best basketball player..... ?????
 
While I'm here, when is it appropriate to use equation vs option vs VB script?
Just curious

Armando

2010/12/21 13:42

In reply to by jan_rifkinson

[quote=jan_rifkinson]
I FOUND THE PROBLEM !! Yeaaa !!
The field was marked "Read Only" for some reason. This happened once before & I don't remember checking that off.
[/quote]
 
Good ! But what's strange is that "read only" shouldn't affect rules and equations at all. It's only for user input. Unless something recently changed.
 
[quote=jan_rifkinson]
The VB editor scares me because altho I understand -- in principal what it does -- I don't understand scripting at all.
I noticed there was a function in there that looked like it was meant to figure out the best basketball player..... ?????
 
While I'm here, when is it appropriate to use equation vs option vs VB script?
Just curious
[/quote]
 
The VB scripts editor is where you can create or modify functions like the HasKeyword one you used for your MIRMA field. A function needs to be defined there before you can use it in the equation or auto-assign section. What you wrote in the auto-assign rules text box is only to "call" the function, it's not the complete function which is actually a small program located in the VB editor.
 
Plain equations are different and don't need to be established in the VB editor as they are self sufficient math expressions -- they are complete and don't need further definition.
 
Options seems to use mostly SQL syntax (another language) and can affects content and appearance of cell's content... but I don't use it enough to really comment and give more details than what's already in the manual.