New answers tagged

1

The thing is, sharing mode in Apex only really affects SOQL, DML, and other Apex methods that do query/DB-like work. So perhaps you could centralize these operations in a core class that can be explicitly called in with/out sharing mode. Then all of your dual-mode classes can default to with sharing, but when a sharing-sensitive operation is called you route ...


1

You should able to display the landing page from your Force.com site's URL without logging in with Guest User License. I was trying to create debug logs using Force.com sites because it needed a webhook integration without authentication. Maybe these posts will help; How can I get a debug log for the sites guest user/public profile? [updated for Spring 18]...


3

Your code is overly complicated because you presumed you needed an inner class in your RestResource class. You don't. The main problem is that you've reinvented the wheel with Sharing.Executable. There's already an interface that does what you want: Callable. First, let's rewrite your Sharing class to use Callable: public class Sharing { public ...


1

I get the answer in this official article . I conclude 3 point : Reason : Images in the rich text area fields are meant to be "Salesforce internally available only" by default. A user from site is unauthenticated to the image in RTA. Solution: Step 1 : Make your articles publicly available, which makes them accessible via force.com sites. Step 2 : You ...


2

What's your unlocked package use-case? Are you using them to organise code within a large org? As a way of distributing code to many orgs? Something else? As it stands, I would say that Sites are best left to the target org, not to be part of the unlocked package. Otherwise, things that you might legitimately want to change in production (e.g. the Site ...


2

Querying A Record To update a record, you must first have a copy of a record in memory. This means you need a CampaignMember object to update: CampaignMember queriedCampaign = [SELECT ID FROM CampaignMember WHERE CampaignID = :campId AND Email = :email LIMIT 1]; Assignment In general, you declare and assign values in the form of: DataType variableName [=...


1

You might want to check this video explaining how to "Download Attachments & Files from Salesforce using NodeJs application" The script uses jsforce to connect to salesforce and runs a query to download files. Its about downloading attachments but you can adapt the query for ContentDocument with isArchived = true and other filters for your use case.


3

For anyone looking at this in the future, this post has solved my issue: StackExchange Post. You need to set your site name as your as the user name and it will show up in debug logs (without setting a cookie).


1

No debug logs available for guest user since Winter 17 as the latest answer to this question explains. So, your best shot is a try/catch + custom log.-


Top 50 recent answers are included