• Paras Polra
  • NEWBIE
  • 5 Points
  • Member since 2018
  • Salesforce Developer
  • salesforce.com


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies


Step 1: I have used SAP Business one login API and get the sessionId and these session id is used for authentication in another API.
Step 2: I have tested order API using sessionId and it is working fine in postman.
Step 3:
Now I am testing same api with Salesforce anonymous window:

I executed below code using Salesforce anonymous window but it is not working and throwing Read timeout error.


String url = 'http://3.64.141.168:50001/b1s/v1/Orders?$filter=DocEntry lt 8 and((DocEntry lt 8 or DocEntry gt 116)and startswith(CardCode,\'C20000\'))';
String B1SESSION = 'B1SESSION=0e9f02f8-d8d2-11eb-8000-0a0e85552c48';
Http http = new Http();
HttpRequest req = new HttpRequest();
req.setMethod('GET');
req.setHeader('Cookie', B1SESSION);
req.setHeader('Content-Type', 'application/json');
req.setHeader('Accept', '*/*'); 
req.setEndpoint(url);
//Request Send
HTTPResponse res = http.send(req);
Integer responseCode = res.getStatusCode();
System.debug('response Code::'+responseCode);
System.debug('response Body::'+res.getBody());


When I removed query parameter from URL then after it is working fine so I am not getting why it is not working with $filter query parameter?


So it is salesforce bug or salesforce is not supporting complex query parameter like below?

Odata Query Parameter:

$filter=DocEntry lt 8 and((DocEntry lt 8 or DocEntry gt 116)and startswith(CardCode,'C20000'))';

On Trailhead:

https://trailhead.salesforce.com/modules/service_basics/units/service_basics_intro

Check Challenge button does not complete and returns message:

'Looks like we're having issues, please try again. If this issue persists, please contact us using the submit feedback section on the sidebar.'

Please advise
Challenge Not yet complete... here's what's wrong: 
The 'Accounts' class 'onApplyDefaults' method does not appear to be setting the Description field to 'Domain classes rock!' correctly for a default value.
public override void onApplyDefaults() 
	{
        List<Account> updatedAccounts = new List<Account>();
        
        for (Account acct : (List<Account>)Records) {
                acct.Description = 'Domain classes rock!';
                updatedAccounts.add(acct);
        }
        
        fflib_SObjectUnitOfWork uow = new fflib_SObjectUnitOfWork(new Schema.SObjectType[] { Account.SObjectType });
        uow.registerDirty(updatedAccounts);
        uow.commitWork();
    }

Any recommendations or suggestions would be greatly appreciated.