Search code examples
salesforcesalesforce-lightning

Why user doesn't finds his data available when user goes to Physical store after placing Online details from App to Salesforce.com


I have a mobile app(not a salesforce app) which is connected to Salesforce.com and salesforce.com talks to an external website(fulfillment portal) using HTTP REST Request and Response method call out ,now problem is whenever user who wishes to buy a new phone enters his/her details like name,phone model name and his phone number from app and visits physical store outlet,the store representative unable to search the customer data in fulfillment portal..So the store has to manually re-enter customer details.

Integration apex class has been exposed as a WebService

public class HttpIntegration{

public String getCalloutResponseContents(String url){

Http h = new Http();

HttpRequest req = new HttpRequest();
req.setEndpoint(url);
req.setMethod('GET');

HttpResponse res = h.send(req);
return res.getBody();


}



 }

While manually testing from Salesforce ,we get a success response from external website(fulfillment portal) and Trigger is also created at Salesforce end to update the Token id at the Order custom object ,but still when the customer goes to store he is unable to find his details,What can be the possible solution to fix this


Solution

  • Carolyn, there are few questions to ask that may help you locate the issue:

    1. Are you sure the users in the store have access to the records being created by the API?
    2. What is the org-wide default for the custom Order object in Sharing Settings?

    Based on your comment, the OWD is set to private. You have a few options, and the solution will depend on your security needs:

    1. If you only want that information exposed to reps in the store, you can create a sharing rule that shares those records with users who have a specific role or users in a specific public group.
    2. If you are not concerned about letting all internal users access that information, you can change the OWD to whatever access is needed by the store reps.
    3. If the users in the store all share a profile or permission set, you can grant them "View All" access on the custom object.