BypassPropertyChecks undoing changes?

BypassPropertyChecks undoing changes?

Old forum URL: forums.lhotka.net/forums/t/11610.aspx


joemorin73 posted on Monday, October 01, 2012

This is a bit of a puzzler.  I have the following code:

        protected override void Child_Create()
        {
            using (BypassPropertyChecks)
            {
                LoadProperty(OrderGuidProperty, Guid.NewGuid());
                LoadProperty(OrderDateProperty, DateTime.Now);
 
                // Must create to a valid OfficeID
                if (HCSecurity.ApplicationID == HCSecurity.APPID_HCR)
                {
                    LoadProperty(OfficeIDProperty, AccessROList.GetAccessROListCurrentUser().Where(e => e.Role == HCRRoles.ORDER_UPDATE).FirstOrDefault().OfficeID);
                }
 
                base.Child_Create();
                
                CheckObjectRules();
            }
        }

At the end of execution, all the values that were loaded in the LoadProperties are restored to the defaults.  Is there anything in the BypassProperties that will rollback values?

joemorin73 replied on Monday, October 01, 2012

Soooooooooooo, it seems I found something else that caused an authorizaion rule to trip.  In the above create statement, I forgot to set another property.  I solved the problem when I added the missing property.

I apologize!

Copyright (c) Marimer LLC