Submitted by markfoley on 2009/06/10 04:56
I have a grid with a text field called 'test'.  I want it to default to something whenever I add a record.  I realise I couId set a default for the field in manage fields, but I'm trying to get auto assign working and besides that change would affect all grids.  Using the below command works in Manage Fields -> Equations -> Auto assignment rules, but not in "Manage Grids -> Auto assign the following fields" :
 
A:test="this is a test"
 
I am putting this in the field I want to drive the change with (the trigger field)
 
Is that because this box is to constrain which fields in the grid are affected by the 'field driven' auto assign rules, or can this box contain rules?  I notice it mentions comma separation instead of | (pipe) separation.
 
Thanks
 

Comments

I can confirm that "Manage Grids -> Auto assign the following fields" does not work as I would expect it to - or at all, for me.
 
Where is auto-assignment documented?
 
Mark Gregory, Rennes, France - GMT +1/+2; EST +6

markfoley

2009/06/11 05:20

In reply to by Tom

Tom (or others) - is this field working as you would expect or do you find it is inoperative at the moment?

Tom

2009/06/11 06:10

In reply to by markfoley

[quote=markfoley]
Tom (or others) - is this field working as you would expect or do you find it is inoperative at the moment?
[/quote]
I didnt really understand the original post - what do you mean by 'default' ?
Could you give some more details of what you want to happen ?
 
do you want every item in the grid to have the same thing filled in particular fields? - forms might be better for that - see 'Using the Forms: applying Form values to a new item or to the current item' in 4. Forms
 
also, sorry I think I gave the wrong link - for grids: See 6. Manage Grids Dialog but there's not much info there - just:
> Auto assign the following fields (comma separated list)
I havent really used it but it should simply assign fields to new items in the grid - maybe it only work with Yes/No fields?
 
Anyone else know more about this ?

markfoley

2009/06/11 07:17

In reply to by Tom

Hi Tom,
 
Basically, the auto assign fields say "when something happens to field A, do something to field B".  These can be set for the fields themselves (in Manage Fields) or at grid level (in the auto assign box in Manage Grids dialog).  The field ones are 'global' and apply no matter what grid you're using. 
 
If you want to have this at grid level (eg set "meetingfield = yes" when I add a line in my 'Meetings' grid) then you'd use the grid autoassign function.  Formulas that work fine in the field dialog don't work in this box however, and it mentions comma delimiting rather than pipe-delimiting so I figure it may work differently.
 
Pierre you may be the man to answer this!

Tom

2009/06/11 10:06

In reply to by markfoley

[quote=markfoley]
Formulas that work fine in the field dialog don't work in this box however, and it mentions comma delimiting rather than pipe-delimiting so I figure it may work differently.[/quote]
that's why I think that it only fills a yes/no field.
Try it out - it works for that.  [Pierre can you confirm that?]
 
Did you check out the forms page I linked to ?  I think that will be the way to go if you want something more than just changing yes/no field (obviously pending reply from Pierre or someone more expert)
 
PS I meant I hadnt used auto-assign in the Manage Grids dialog before!
 
[edit] removed N/A  [/edit]

> Using the below command works in Manage Fields -> Equations -> Auto assignment rules, but not in "Manage Grids -> Auto assign the following fields"
 
This textbox ("Manage Grids -> Auto assign the following fields") is not meant to be used like the other one. Notice that it doesn't say "Auto assignment rules" but, rather "Auto assign the following fields".
 
This serves to assign a value (NO --> YES) to fields written there (separated by commas).
 
If you want to have more complex "rules" (or even scripts bound to certain fields...), you can always assign fields which themsefl have rules bound to them. Easy, and much less confusing than to have rules upon rules, upon rules, etc.

markfoley

2009/06/12 00:57

In reply to by Armando

Thanks Armando.  I have got an item becoming true per what you've mentioned.  The point around having rules in too many places makes sense to me.
 
It'd be good if it could basic values values though.  Like "test=true, location="blah",myflag=false".  Then you could set defaults for the grid you're working in.
 
Having said that, those funky rules you mentioned you'd think about may be able to achieve the same.  I haven't tried binding code yet (I will be doing that though!) - can you access what the active grid is and add values based on that? 
 
eg pseudocode:
 
if Activegrid = "meetings" then meetingdetails = location & thedate & attendees
 

Armando

2009/06/12 13:15

In reply to by markfoley

> Having said that, those funky rules you mentioned you'd think about may be able to achieve the same.  I haven't tried binding code yet (I will be doing that though!) - can you access what the active grid is and add values based on that? 
 
eg pseudocode:
 
if Activegrid = "meetings" then meetingdetails = location & thedate & attendees
 
 
Well, yes. You just need to add the rules to the fields (in the "auto assign rules" space) which are automatically assigned to a specifIC.
 
Let's say a grid as the "Contact" field to be autoassigned to every item inserted in it. This Contact field coud have a rule like :
 
A: AddressBook=1 | E: AddressBook= | A:Notes="Friend" | E: Notes="Not friend anymore" |  A:Icon_Type=AddKeyword(Icon_Type, "<img>crazy hair</img>") | E:Icon_Type=RemoveKeyword(Icon_Type, "<img>crazy hair</img>")
 
So you see, just checking "Contact", will do a bunch of (simple) things. It can get a bit more sophisticated by using "Options" section of the field management window, + VB scripts.
 

markfoley

2009/06/12 20:38

In reply to by Armando

 Hi Armando, thanks for that example.  I will give it a shot!

Tom

2009/06/12 11:24

In reply to by Armando

[quote=Armando]"Auto assign the following fields".
 
This serves to assign a value (NO --> YES) to fields written there (separated by commas). [/quote]
as I thought.  I added that info to 6. Manage Grids Dialog