New answers tagged

1

The following syntax is not a dynamic query: List<customObject__c> lstCstObj = [SELECT ... FROM ...]; What you need is a dynamic query. A dynamic query normally looks like: String myQuery = 'SELECT ... FROM ...'; List<customObject__c> lstCstObj = Database.query(myQuery); What you're after is probably something like: // get the parameters ...


0

Winter 19 on words we can make API calls to own SF org from @Aura Enabled Apex Methods with out using Remote site Settings/connected App


0

Not sure why you are implementing continuation as you are not even using Labels and importantly you are returning something from database and not from external system. However, you will need labels in response method sendEmail and also addHttpRequest in request method to complete continuation flow. Below is the sample continuation code which works fine: @...


0

A string in Apex code must have a start apostrophe and an end apostrophe: ' [ { \n'+ Note that you also have problems with your JSON (missing commas), and the setHeader method requires two parameters, the key and value. You would not ordinarily put JSON inside an HTTP Header, so I suspect that you're doing something wrong. Even more to ...


1

You can use authorization as 'Authorization: Bearer <your_session_id>'. You can get session id using UserInfo class httpReq.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId()); added based on comments As you said SOQL through REST: HttpRequest req = new HttpRequest(); req.setEndpoint('https://ap2.salesforce.com/services/data/v35.0/query/...


3

If the data are being passed as URL parameters rather than in the body of the HTTP request, you need to encode the request URL to ensure there are no spaces. Without seeing your code for how the request is being built, it's not possible to give exact guidance, but either EncodingUtil.urlEncode() or String.replace(' ','+') if you only have spaces, should work....


5

You need to URL-Encode the parameters. A space in the actual URL will cause an error (as well as many other non-alphanumeric characters). Use PageReference to build a proper URL: PageReference ref = new PageReference('https://adobeconnect.com/api/xml'); ref.getParameters().put('action','event-register'); // ... // ref.getParameters().put('Company','Test ...


1

You could use the Schedulable interface to make the schedulable and schedule this class to run at 12:01 AM everyday.


3

Callouts happen from IP and not from URL/Domain. Imagine doing a callout from your personal laptop or mobile device using postman or any other tool, it doesn't have a domain. It will have IP. Similarly, the IP of Salesforce callout server keeps on changing. I have seen it change quite frequently during the day, and hence its recommended to whitelist the ...


0

The access token is interchangeable with session id. For example, you can use the AccessToken you get from authenticating with the JWT Flow, when making Bulkv1 API calls. Instead of adding it as a Bearer token to your header as you would with the Bulkv2 API, you would add it as the "X-SFDC-Session" header value


0

To answer my own question, based on the comments by fellow developers/consultants here, I have come to a conclusion to delete the Webservice class altogether from Salesforce. Refer to @sfdcfox's comment for the example to delete classes from org


0

My theory from running into the same problem is that this has to do with asking for the TaskWhoIds field. The theory is that asking for TaskWhoIds does a join to the TaskRelation table, and the limit ends up getting applied on the join result (the TaskRelations) rather than on the Tasks themselves. If there are many TaskWhoIds on a Task that you're asking ...


Top 50 recent answers are included