4

There is a permission now that will allow you to access custom Apex REST services while not being able to access the standard REST API:


3

This guard: if(!Test.isRunningTest()){ HttpResponse res = http.send(req); } and the use of Test.setMock(HttpCalloutMock.class, new FindAnApprenticeshipCalloutsMock()); are mutually incompatible. Your Mock class will never be called if you gate the HTTP call in your production code; remove the gate if you plan to use a Mock. ...


3

You cannot directly create a ContentDocument. Instead, you must upload a ContentVersion. The parent ContentDocument will be created for you automatically. To link the file to an sObject, either set the FirstPublishLocationId field on the ContentVersion to the target record's Id, or query for the ContentDocumentId after insertion (it will be populated by the ...


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).


3

For the Update criteria using Salesforce Data Event, the record must meet the criteria after the update. For example, if the value already contains ‘Web’ then it needs to change to another value not containing ‘Web’ such as null then back to ‘Web’. When a record is updated, the rule runs only if the record meets rule criteria after the update. The rule ...


3

That isn't a valid URL. Curly braces need to be percent-encoded when they appear in a URL, as other invalid and/or "unwise" characters as defined by the RFC. See When, if ever, should characters like { and } (curly braces) be percent-encoded in URLs? . Replace the bracketed segment in your URL with %7B7c2b1ab5-40805b81c898%7D.


2

Unfortunately, SOQL does not have functionality like this. You can find the overall SUM() of a field but not in a running total. Here is a link to the available SOQL Aggregate Functions: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_agg_functions.htm I believe to achieve this in Salesforce, you'd ...


2

Adding here as I spent a few hours trying to figure this same issue out last night. As this answer states, you do need to set up the send definition using REST API. You cannot use the UI to set up the send definition for transaction API driven emails. It's called out here: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/...


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 [=...


2

You seem to be confusing classes with methods. QueueableFindAnApprenticeship is a class, and you defined it like this: Public class QueueableFindAnApprenticeship... you cannot do HttpResponse response = FindAnApprenticeship.QueueableFindAnApprenticeship(); Instead, you can do FindAnApprenticeship.QueueableFindAnApprenticeship myClass = new ...


2

Looks like you may use Salesforce Event Monitoring feature, for your use case the REST API Event Type would be the one you'll be interested in.


1

Composite REST resource would have been our suggestion but it has a limit of 25 sub-requests, same as Batch. A better out of the box solution is describeSObjects() in SOAP API: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com"> <soapenv:Header> ... </soapenv:Header>...


1

The problem is, you're providing the wrong URIs, which is why Salesforce "Can't access the resource". You were probably looking at this page, and saw "/vXX.X/composite/sobjects". and thought your Batch request URIs were supposed to have "/composite/" in them - they're not. If you change your URIs to "/v47.0/sobjects/OpportunityLineItem" (as shown on this ...


1

Try removing the assetType object from your payload. It is unnecessary and cannot be written to in update assetType is there to define what type of item it is. (E.g. is it an image? An email? Etc) which is not necessary when updating as all this is already done via the existing asset. This info is collected via the asset Id in the url. Now it is tossing ...


1

The external system should listen for platform events using CometD (or you can use the EMP Connector: an open-source, community-supported tool that implements all the details of connecting to CometD and listening on a channel). Salesforce has a guide on how to do this. Salesforce sends platform events to CometD clients sequentially in the order they’re ...


1

You should put ' ', but you don't need to escape them try that one https://{myWorkplaceDomainUsed}--sandbox.cs67.my.salesforce.com/services/data/v42.0/query/?q=select+Id+from+Contact+where+Email='apple+super@gmail.com'. If you want IN you can use it like this https://{myWorkplaceDomainUsed}--sandbox.cs67.my.salesforce.com/services/data/v42.0/query/?q=select+...


1

Cleaner to use the various serialize methods of the JSON Class. Also, feeding the JSON into https://json2apex.herokuapp.com/ that generates code for your is often a good choice. Your example JSON doesn't include any arrays; arrays are delimited by [...] - see e.g. https://www.json.org/json-en.html.


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.-


1

Thank you all for your valuable time & suggestion. I was able to resolve with help of a few online blogs. Here is the solution : Correct Syntax to use Auth. Parameter from Named credentials : request.setHeader('Authorization','Bearer {!$Credential.OAuthToken}'); So whole code is this : Http http = new Http(); HttpRequest request = new HttpRequest(); ...


Only top voted, non community-wiki answers of a minimum length are eligible