Skip to main content
9 events
when toggle format what by license comment
Jul 6, 2020 at 13:05 vote accept Gabriel Serrano Salas
Jul 6, 2020 at 12:15 history bounty ended Gabriel Serrano Salas
Jul 6, 2020 at 12:15 comment added Gabriel Serrano Salas I tried today again, and it does work as expected for me as well, I am really astonished, but at least the problem is gone. Thank you @AlbaRivas
Jul 6, 2020 at 7:56 comment added Alba Rivas Gabriel, I did the same text removing the inherited sharing keyword, and it works as expected for me too (with sharing). If you want to jump in a call I can show you the code and maybe check if there's something we are doing differently.
Jul 4, 2020 at 16:16 comment added Gabriel Serrano Salas @ElkCor, as you said, only if the class is the entry point of the apex transaction, it runs as without sharing, but in this case it is not the entry point, so you answer does not apply, neither the other one. If you read carefully the documentation, your text between quotes applies for with sharing and without sharing declarations, not for inherited sharing, either ommited or explicitly declared. Also, if that were true, it would not works as expected in a visualforce controller context, which it does. It only behaves unexpectedly in trigger context
Jul 4, 2020 at 2:49 comment added ElkCor If sharing is omitted the class works as without sharing "The sharing setting of the class where the method is defined is applied, not of the class where the method is called. " and "If the class is used as the entry point to an Apex transaction, an omitted sharing declaration runs as without sharing. "
Jul 3, 2020 at 11:14 comment added Gabriel Serrano Salas However, 1 problem is still remaining, which is, if inherithed class is ommited instead of explicit, it is also working as without sharing, altough it should in fact run as with sharing if that is the declaration that has the class from where it is called.
Jul 3, 2020 at 11:09 comment added Gabriel Serrano Salas Hi Alba, 1st of all, thank you for takin the time to review and help us with your answer. Before writing this command I executed again the same scenario I had at the time of writing this post, and now it works, you probably will not believe me, its been a week since I tried last time, but I am completly sure that then, explicit declared inherithed sharing was not working as expected, otherwise I would have bothered and take the time to write this post... anyway, it is good that now is works as expected.
Jul 3, 2020 at 8:47 history answered Alba Rivas CC BY-SA 4.0