Preventing form from entering into edit mode


Author
Message
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Smile glad you found it
Scott
Scott
StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)
Group: Forum Members
Posts: 176, Visits: 1.5K
Didn't know there was an update.  That did the trick.  Works great.
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Scott,



If you don't have the properties that Gary mentioned, you'll need the latest version Smile



The newest update provides the IncludeInFormType properties and the MaintenanceFormToolstrip methods always pass True, so that the CheckSecurity event is raised.
Gary C Wynne
Gary C Wynne
StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)StrataFrame Beginner (46 reputation)
Group: Forum Members
Posts: 26, Visits: 236
Hi Scott

>For the CheckSecurity event to fire you need to pass true to the business objects edit (action) method, correct? 

The CheckSecurity event should fire for you when the BO is Edited. You shouldn't have to do anything. If the BO you want to edit isn't the form's Primary Business Object, then you might want to look at the form's IncludeInFormEditType property; this allows the scope of the edit to be applied to the form's PrimaryBusinessObject (default), AllBusinessObjects or DeterminedByBusinessObject. On the BO, there is a property called IncludeInFormEdit that you would set true if you used DeterminedByBusinessObject on the form.

Using these flexible properties on the form and BOs, you should be able to configure which BOs you want to be affected by the Edit "state". FYI, this capability can be extended to "New", "Undo", "Navigated", "Save" and "Delete" states too!

Hope I am on the right lines here Smile

Best

-=Gary

Scott
Scott
StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)
Group: Forum Members
Posts: 176, Visits: 1.5K
For the CheckSecurity event to fire you need to pass true to the business objects edit (action) method, correct?  I am using the stand Stratframe maintenance form,  Is there a way to make the toolstip add the true parameter to all of its calls or do I have to write the code in the itemclicked method of the tools strip.
Scott
Scott
StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)
Group: Forum Members
Posts: 176, Visits: 1.5K
That works great thanks Ben.
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
You can handle the CheckSecurity event. I know it's not security, but if we put another event there, it might be redundant...

Within the event, just check your secondary business object and if its Count = 0 then set e.Allowed = false;. It will then raise the SecurityDenied (allowing you to show an error message) event rather than editing the business object.
Scott
Scott
StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)
Group: Forum Members
Posts: 176, Visits: 1.5K
I have a form,  when the user clicks the edit button I want to be able to check to verify that this record can be edited,  not because of user security but if records exist in a secondary table I want to be able to prevent the user from modifying this record.

Any suggestions.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search