3

I have a customized button that once you click it, a new window it's open displaying some data from an external app, getting the data through a SOAP web service.

If I'm logged as System Administrator it works fine. enter image description here

But if I'm logged as any other user profile it doesn't work. At first, it complained about permissions, so I gave other profiles the permissions needed for the VFPage involved, Apex Classes involved and Objects involved.

Now, it doesn't complain about permissions. After click the button, the expected window opens fine, but, it doesn't display the data. enter image description here

¿Any idea what am I missing?

UPDATE

I've followed the given tips, and using the Debug Log for two different profiles, the result is exactly the same: enter image description here

As you can see, the same result is returned from the web service callout.

  • Try capturing the debug log of the user in question. Look for CALLOUT_REQUEST log messages that occur for the SOAP request. If they aren't appearing something else is preventing the call from occurring. – Daniel Ballinger May 14 '15 at 21:54
  • @DanielBallinger I'm trying with the Developer Console, but I have a problem. I'm using System.runAs(u) in order to capture the debug log for different users, but I have the exception: "System.runAs can only be used within a test method". So, I include it in a test method and now the exception is that in a test method: "Methods defined as TestMethod don't allow calls to a web service; the test will be ignored". Which are my options??!!! – daniegarcia254 May 15 '15 at 11:37
  • 1
    You don't need to use System.runAs(u) to capture a log for another user. Either use Setup > Monitoring > Debug Log and select the user or select show logs for all users in the developer console. – Daniel Ballinger May 16 '15 at 9:17
  • @DanielBallinger question updated by following your tip. Debug Log for both users is exactly the same... – daniegarcia254 May 18 '15 at 9:45
  • From the logs it would appear the web service callout is functioning as expected for both users regardless of the profile. You might need to following the logging further to see why the Visualforce page isn't rendering as expected for one users profile. – Daniel Ballinger May 18 '15 at 21:21
0

Have you enabled the class(es) for all required profiles? It's one thing to enable the page, but you'll also have to enable the supporting code.

  • Yes, I've enabled all the Apex Classes involved in process. Basicly, the controller for the VFPage, and the classes that make the callout to the SOAP web service. – daniegarcia254 May 14 '15 at 15:17
  • Sorry, looks like my edit didn't take! did you log in as one of the users and confirm they are able to access the data? From your description, it sounds like the code fires and runs without error, but there may legitimately be no results for the users. As an Admin, you have the permission SeeAllData=TRUE, so this may be why you are able to return data when testing – James May 14 '15 at 21:25
  • Updated question, you can see I've confirmed with two differents profiles and only Admin is working. – daniegarcia254 May 15 '15 at 10:36
  • 1
    Have yo gone to Setup> Debug Logs> and enabled Debug logs for your user? In your class which is runnin the query, make sure you put somthing like system.debug('my result set size' + myList.size()); to verify you actually have results. From here, you can then loging as the user, attempt to access the page, logout and then view the logs. I suspect since you have no errors, then something else is amiss, likely with the query. Lastly, are you checking to see the response from the webservice callout? – James May 15 '15 at 14:00
  • Question updated. Debug Log for both users is exactly the same... – daniegarcia254 May 18 '15 at 9:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.