Input Enabled formula in controlled access section

Hi,I am trying to use Input Enabled formula.

My field is in a controlled access section.

My formula is below:

FIELD CanInput:=CanInput;

FIELD Approver:=Approver;

FIELD Approver_1:=Approver_1;

Eval:=

@If(@IsNewDoc;“Not”;

@If(@IsNotMember(“[LOVAuth]”;@UserRoles);“Not”;

@If(@Contains(CanInput;“Not”);“Not”;

@If(@Name([CN];@UserName)!=Approver_1;“Not”;

“Is”))));

@If(Eval=“Is”;@True;@False)

What happens is you send for authorisation. Then, only the person who is the authoriser (listed in Approver_1 field), may edit the field…

What actually happens is, initially the field can be edited, but after you change it GRRR it doesn’t allow edit!

Thats just silly, whats the point of honouring a Input Enabled formula AFTER you edit the field!

Any ideas to make it honour the formula immediately?

A work around is to change the section access controlled formula, but that is not ideal for the application…

Subject: Input Enabled formula in controlled access section

Some versions require setting the field to “Native OS Style” for this function to work. The setting in on the first tab of the Field Properties box. Simple, but it stumped me for a few days why the thing wouldn’t work no matter what I tried.

Subject: Input Enabled formula in controlled access section

The formula was a little confusing the way you wrote it so I am simplifying it. You don’t need FIELD statements, you don’t need to nest @Ifs like that, and if you want to return a true or false value, just return a true or false value; there’s no need to have an extra internal code string that means true or false – it just complicates matters.

@If(@IsNewDoc; @False;

@IsNotMember(“[LOVAuth]”;@UserRoles); @False;

@Contains(CanInput;“Not”); @False;

@Name([CN];@UserName)!=Approver_1; @False;

@True)

You say the field is editable when you compose the document. I created a form that uses the exact formula shown above, with the field in a controlled access section, and I do not have the same experience; the field is not editable when the document is composed, though I can edit other fields in the section. Perhaps there is more that you’re not telling us?

Subject: RE: Input Enabled formula in controlled access section

Andre,I tried your exact formula.

It still doesn’t work.

The process is:

  1. Create Document. Fill in the top of the form, and the first section. The relevant field is in the second section;

  2. Send for authorisation.

The authoriser can edit the second section (with the field in it).

Again, just as before, initially they can edit it, but as soon as they have edited it it decides to honour the formula.

Perhaps it’s because, some of it is based on the previous section, that the authoriser does not have access to? Although I just tried it giving myself both roles (all access) and it still doesn’t work properly…

Here is the Text Computed CanInput field. I have moved this, so it is in the same section as the Input Enabled field, and so it is above the CanInput field. Formula is:

@If(LICenglish=“”;“Not”;

@If(NamingStandards=“”;“Not”;

@If(LOVremoved=“”;“Not”;

@If(Compliance=“”;“Not”;

@If(LICChanged=“”;“Not”;

@If(HighRKey=“”;“Not”;

@If(Approver=“”;“Not”;

@If(@Name([CN];@UserName)!=Approver;“Not”;

@If(@IsNewDoc;“Not”;“”)))))))))

I guess we could simplify this formula; though I expect doing so will make little difference.

The controlled access section formula is:

FIELD Noone:=Noone;

@If(@IsNewDoc ;@Name([Canonicalize];Noone+“/”);

“[LOVAuth]”)

For now, I’ve built a workaround by simply creating two fields, one computed one editable, based on the following hide:

@If(@Name([CN];@UserName)!=Approver_1;@True;@False)

and the reverse for the other field:

@If(@Name([CN];@UserName)=Approver_1;@True;@False)

Subject: RE: Input Enabled formula in controlled access section

Additionally, the Input Enabled field has:1) Validation:

valStatus:=

@If(Status=“Pending: for Corporate Authorisation”;“Yes”;

@If(Status=“Pending: for Business Authorisation”;“Yes”;

“No”));

@If(valStatus=“Yes” & @ThisValue=“” ;@Failure(“Please select whether the request is authorised for QA and Production Load”);@Success)

  1. An OnChange event:

Sub Onchange(Source As Field)

Dim session As New NotesSession

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Set uidoc = workspace.CurrentDocument

If uidoc.FieldGetText(“AuthForQAProd”) = “Yes” Then

Call uidoc.FieldSetText _

( “AuthName”, session.CommonUserName )

Dim whenNow As String

whenNow = Today()

Call uidoc.FieldSetText _

( “AuthDate”, whenNow)

Call uidoc.FieldSetText _

(“Status”,“Open: Authorised (Ready for QA Load)”)

'Call uidoc.Save

Else

tAuthName = uidoc.FieldGetText( “AuthName” )

tAuthDate = uidoc.FieldGetText(“AuthDate”)

tThisValue = uidoc.FieldGetText(“AuthForQAProd”)

If tThisValue <> “Yes” And tAuthName <> “” And tAuthDate <> “” Then

Call uidoc.FieldSetText _

( “AuthName”, “”)

Call uidoc.FieldSetText _

( “AuthDate”, “”)

End If

End If

tThisValue = uidoc.FieldGetText(“AuthForQAProd”)

If tThisValue = “No” Then

Call uidoc.FieldSetText _

(“Status”,“Open: Returned to Requestor”)

End If

End Sub

Let me know if there is something else you think I am not telling you, and I’ll post it…