System.runAs for CspLitePortal Profile Users recently started returning no rowsHow to set the externalSharingModel for managed package objects using automation?Sharing with all the users of a profileGive High Volume Customer Portal User access to their own Contact RecordsStandard Profile for communityDoes “with sharing” only apply to 1st entry point of code?Sharing File attached to an Account in CommunityWhy are users other than admin profile not able to access object data?Security Question for Customer Portal Profile UsersManage permissions on chatter files from apexList has no rows while executed by system.runas()

What is an idiom, phrase or expression for situation such as "throw a pigeon among cats"

How to play a devious character when you are not personally devious?

Fiducial placement

How are astronauts in the ISS protected from electric shock?

Why do the Romance languages use definite articles, when Latin doesn't?

Employer says they want Quality & Quantity, but only pays bonuses based on the latter

Do players roll their own die?

Can someone interview their sibling?

How to delete music as it's being played

At what point can you walk out of a restaurant if they make you wait to pay the bill?

How do journals gain and lose reputation?

How do I get softer pictures in sunlight, like in this commercial?

Determining number of unique hydrogens in lactupicrinal 1H NMR

Program to print the multiple occurrence of numbers in a list

Why does hairspray work as an adhesive for ABS?

Make a haystack (with a needle)

How are hillsides farmed?

instead of pressurizing an entire spacesuit with oxygen could oxygen just pressurize the head and the rest of the body be pressurized with water?

Conveying "What does it mean?" ("signifie" et "veut dire")

Logical all/any in bash

Length-terminated sequences

How do I search for a package?

Is it safe to plug one travel adapter into another?

What is the difference between democracy and ochlocracy?



System.runAs for CspLitePortal Profile Users recently started returning no rows


How to set the externalSharingModel for managed package objects using automation?Sharing with all the users of a profileGive High Volume Customer Portal User access to their own Contact RecordsStandard Profile for communityDoes “with sharing” only apply to 1st entry point of code?Sharing File attached to an Account in CommunityWhy are users other than admin profile not able to access object data?Security Question for Customer Portal Profile UsersManage permissions on chatter files from apexList has no rows while executed by system.runas()






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









2

















We have some tests that use System.runAs for a User created like this:



 Contact c = ...;

Profile p = [
select Id
from Profile
where UserType = 'CspLitePortal'
limit 1
];
insert u = new User(
ProfileId = p.id,
ContactId = c.id,
...
);


and they have started failing in the last 2 weeks. Seems like a sharing problem, where the test - running as a SA User - inserts rows, but the System.runAs User can't see them for custom objects and objects like Attachment.



Anyone else having this problem? Summer '19? Or a side effect of Multi-Instance Core and Communities Service Disruption starting May 17, 2019? Workarounds?



PS



Changing with sharing to without sharing eliminates the problem but is not a change that makes sense for production use.










share|improve this question




























  • Well, maybe this is somewhat related to Summer'19 changes regarding OWD External Org-Wide Defaults in Orgs with Communities & Custom Object Access Settings Default to Private.

    – Jeferson Chaves
    May 29 at 12:57











  • Hi @JefersonChaves, Looks likely: in a newly created scratch org all the custom objects have "Default External Access" as "private". Changing that now.

    – Keith C
    May 29 at 12:57












  • Yep @JefersonChaves that's it. Please post that as the answer and I will accept!

    – Keith C
    May 29 at 13:12

















2

















We have some tests that use System.runAs for a User created like this:



 Contact c = ...;

Profile p = [
select Id
from Profile
where UserType = 'CspLitePortal'
limit 1
];
insert u = new User(
ProfileId = p.id,
ContactId = c.id,
...
);


and they have started failing in the last 2 weeks. Seems like a sharing problem, where the test - running as a SA User - inserts rows, but the System.runAs User can't see them for custom objects and objects like Attachment.



Anyone else having this problem? Summer '19? Or a side effect of Multi-Instance Core and Communities Service Disruption starting May 17, 2019? Workarounds?



PS



Changing with sharing to without sharing eliminates the problem but is not a change that makes sense for production use.










share|improve this question




























  • Well, maybe this is somewhat related to Summer'19 changes regarding OWD External Org-Wide Defaults in Orgs with Communities & Custom Object Access Settings Default to Private.

    – Jeferson Chaves
    May 29 at 12:57











  • Hi @JefersonChaves, Looks likely: in a newly created scratch org all the custom objects have "Default External Access" as "private". Changing that now.

    – Keith C
    May 29 at 12:57












  • Yep @JefersonChaves that's it. Please post that as the answer and I will accept!

    – Keith C
    May 29 at 13:12













2












2








2








We have some tests that use System.runAs for a User created like this:



 Contact c = ...;

Profile p = [
select Id
from Profile
where UserType = 'CspLitePortal'
limit 1
];
insert u = new User(
ProfileId = p.id,
ContactId = c.id,
...
);


and they have started failing in the last 2 weeks. Seems like a sharing problem, where the test - running as a SA User - inserts rows, but the System.runAs User can't see them for custom objects and objects like Attachment.



Anyone else having this problem? Summer '19? Or a side effect of Multi-Instance Core and Communities Service Disruption starting May 17, 2019? Workarounds?



PS



Changing with sharing to without sharing eliminates the problem but is not a change that makes sense for production use.










share|improve this question

















We have some tests that use System.runAs for a User created like this:



 Contact c = ...;

Profile p = [
select Id
from Profile
where UserType = 'CspLitePortal'
limit 1
];
insert u = new User(
ProfileId = p.id,
ContactId = c.id,
...
);


and they have started failing in the last 2 weeks. Seems like a sharing problem, where the test - running as a SA User - inserts rows, but the System.runAs User can't see them for custom objects and objects like Attachment.



Anyone else having this problem? Summer '19? Or a side effect of Multi-Instance Core and Communities Service Disruption starting May 17, 2019? Workarounds?



PS



Changing with sharing to without sharing eliminates the problem but is not a change that makes sense for production use.







unit-test community sharing






share|improve this question
















share|improve this question













share|improve this question




share|improve this question








edited May 29 at 12:33







Keith C

















asked May 29 at 11:39









Keith CKeith C

102k14 gold badges106 silver badges246 bronze badges




102k14 gold badges106 silver badges246 bronze badges















  • Well, maybe this is somewhat related to Summer'19 changes regarding OWD External Org-Wide Defaults in Orgs with Communities & Custom Object Access Settings Default to Private.

    – Jeferson Chaves
    May 29 at 12:57











  • Hi @JefersonChaves, Looks likely: in a newly created scratch org all the custom objects have "Default External Access" as "private". Changing that now.

    – Keith C
    May 29 at 12:57












  • Yep @JefersonChaves that's it. Please post that as the answer and I will accept!

    – Keith C
    May 29 at 13:12

















  • Well, maybe this is somewhat related to Summer'19 changes regarding OWD External Org-Wide Defaults in Orgs with Communities & Custom Object Access Settings Default to Private.

    – Jeferson Chaves
    May 29 at 12:57











  • Hi @JefersonChaves, Looks likely: in a newly created scratch org all the custom objects have "Default External Access" as "private". Changing that now.

    – Keith C
    May 29 at 12:57












  • Yep @JefersonChaves that's it. Please post that as the answer and I will accept!

    – Keith C
    May 29 at 13:12
















Well, maybe this is somewhat related to Summer'19 changes regarding OWD External Org-Wide Defaults in Orgs with Communities & Custom Object Access Settings Default to Private.

– Jeferson Chaves
May 29 at 12:57





Well, maybe this is somewhat related to Summer'19 changes regarding OWD External Org-Wide Defaults in Orgs with Communities & Custom Object Access Settings Default to Private.

– Jeferson Chaves
May 29 at 12:57













Hi @JefersonChaves, Looks likely: in a newly created scratch org all the custom objects have "Default External Access" as "private". Changing that now.

– Keith C
May 29 at 12:57






Hi @JefersonChaves, Looks likely: in a newly created scratch org all the custom objects have "Default External Access" as "private". Changing that now.

– Keith C
May 29 at 12:57














Yep @JefersonChaves that's it. Please post that as the answer and I will accept!

– Keith C
May 29 at 13:12





Yep @JefersonChaves that's it. Please post that as the answer and I will accept!

– Keith C
May 29 at 13:12










1 Answer
1






active

oldest

votes


















4


















This is related to Summer'19 changes:



  • OWD External Org-Wide Defaults in Orgs with Communities

  • Custom Object Access Settings Default to Private





share|improve this answer



























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "459"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );














    draft saved

    draft discarded
















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f264064%2fsystem-runas-for-cspliteportal-profile-users-recently-started-returning-no-rows%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown


























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    4


















    This is related to Summer'19 changes:



    • OWD External Org-Wide Defaults in Orgs with Communities

    • Custom Object Access Settings Default to Private





    share|improve this answer






























      4


















      This is related to Summer'19 changes:



      • OWD External Org-Wide Defaults in Orgs with Communities

      • Custom Object Access Settings Default to Private





      share|improve this answer




























        4














        4










        4









        This is related to Summer'19 changes:



        • OWD External Org-Wide Defaults in Orgs with Communities

        • Custom Object Access Settings Default to Private





        share|improve this answer














        This is related to Summer'19 changes:



        • OWD External Org-Wide Defaults in Orgs with Communities

        • Custom Object Access Settings Default to Private






        share|improve this answer













        share|improve this answer




        share|improve this answer










        answered May 29 at 13:21









        Jeferson ChavesJeferson Chaves

        3301 silver badge11 bronze badges




        3301 silver badge11 bronze badges































            draft saved

            draft discarded















































            Thanks for contributing an answer to Salesforce Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f264064%2fsystem-runas-for-cspliteportal-profile-users-recently-started-returning-no-rows%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown









            Popular posts from this blog

            Tamil (spriik) Luke uk diar | Nawigatjuun

            Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

            Training a classifier when some of the features are unknownWhy does Gradient Boosting regression predict negative values when there are no negative y-values in my training set?How to improve an existing (trained) classifier?What is effect when I set up some self defined predisctor variables?Why Matlab neural network classification returns decimal values on prediction dataset?Fitting and transforming text data in training, testing, and validation setsHow to quantify the performance of the classifier (multi-class SVM) using the test data?How do I control for some patients providing multiple samples in my training data?Training and Test setTraining a convolutional neural network for image denoising in MatlabShouldn't an autoencoder with #(neurons in hidden layer) = #(neurons in input layer) be “perfect”?