>My rule object is dropped directly onto the parent form. I was under the impression that this would work considering this is how it was done in the Pizza example.
Try putting it in the DM container. See if the behaviour changes.
>Following is the code I wanted to put in the IsEditAllowedRule()
>
>LPARAMETERS cWorkarea, cField
>IF m.cWorkarea == "Frames" AND frames.groupshot
> IF m.cfield $ 'Pack1,Pack2,Pack3,Pack4,Pack5,Pack6,Pack7,Pack8,Pack9,Pack10,Pack11,Lname,Fname'
> this.replace("frames",m.cfield,"")
> RETURN .f.
> ENDIF
>ENDIF
When you toggle the checkbox, it calls the form.Refresh(), right? If so, does the check box's control source value have anything to do with the above logic? The only way you are going to get a differing return value of True or False from IsEditAllowedRule() is if toggling the check box alters the logic of your code above. If changing the check box control source value doesn't flip the logic of the above code, your return value will stay the same and the controls' enabled status will remain unaltered. However, if the event isn't even firing, well thats another story. If you look in the Codmine help file, it specifically states that a rule class should be placed in the DM container if you are not using it in a CDE.
Just an observation, this code is primarily to return a True or False value to decide whether an edit state is permitted. It is not really the place to change data as per your replace() call. You should evaluate an expression or series of expressions and return a True/False value, nothing more.
>RETURN DODEFAULT(m.cworkarea,m.cfield)
No need for this as there is no parent code (press F9 in the method code to see whether there is any parent code).
>I know there is a way to post formatted code. I just don't know how to do it.
Just use the PRE and /PRE tags (wrapped with angle brackets).
HTH
-=Gary