push_pin
lock
Sentry plugin not working when referencing another table
Hi, We have a customer who is looking to move from SuperOffice Windows to SuperOffice Web, and I am trying to develop an equivelent sentry plugin to stop end users from being able to edit approved appointments. We have a custom NetServer table, that stores the appointment id of the approved appointment and the id of the associate approving the appointment, along with the approval date. However, whilst I think it is coded correctly it is not making the appointment read only when the appointment is approved. I have done some similar tests with the UDAppntSmall table, as per Dennis' example in the post here , to rule out the problem being with a custom table, but this does not work either. My modify select is as follows. public void ModifySelect(Select sql, TableInfo tableInfo) { AppointmentTableInfo ati = (AppointmentTableInfo)tableInfo; AcedaappfieldsTableInfo aaf = CustomTablesInfo.GetAcedaappfieldsTableInfo(); UDAppntSmallTableInfo udti = TablesInfo.GetUDAppntSmallTableInfo(); sql.JoinRestriction.LeftOuterJoin(ati.AppointmentId.Equal(aaf.AppointmentId)); sql.JoinRestriction.LeftOuterJoin(ati.UserdefId.Equal(udti.UdappntsmallId)); sql.ReturnFields.Add(aaf.AuthorisedbyId); sql.ReturnFields.Add(udti.Long14); } Now when I open the appointment the sentry code is fired several times (around about 14 times I think, from the point of double clicking the appointment to the appointment dialog being shown on screen with all the data loaded), and in most cases my custom table, and the UDAppntSmall table are found, and the code to limit the table rights to select only, fires (the results in the Watch window show the data from these tables being loaded correctly). But once, about half way through this process, everytime the appointment is opened (after about the 6th instance of the code firing), both tables are not found, and it is here when you first see the appointment dialog showing in SuperOffice (the following 7 times or so, of the code running on the appointment open event, both tables are found in the code, and the correct AuthorisedbyId is visible, but the appointment is still not opened as read only). Now if I move up the row where I set the table rights to row 42, as in the commented section above, outside the check on the custom table, the appointment does correctly load as read only. But of course this will not work for the customer as I need to check that the appointment is approved before making the appointment read only. Whilst this code was running, all SQL traces that I ran whilst opening the appointment, did reference AuthorisedbyId field and return the correct value, so I don't know why this one instance on every appointment load the code does not correctly load the joined tables, and why the appointment is not made read only. And when I move an appointment via drag and drop, this is not blocked by the sentry plugin either, and the "var Test" line of code is hit far more often (though the table rights row is also still hit at times during this process), so I am completely stuck on what to try next. Finallly and, this is far less important, "SoLogger.LogError(ex)", no longer works. How should this now be written now, to prevent a compile error? Many thanks, Trevor