function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
regger118regger118 

@RemoteAction in controller not working in sites

if i use a page that calls a remote action it does not work on a sites page?

Shashikant SharmaShashikant Sharma

Could you please provide your code, It would be helpfull to figure out the issue.

Shashikant SharmaShashikant Sharma

No Issues in javascript remoting from Sites just used it , working fine. Please provide your code.

RagingForceRagingForce

did u do it with showHeader=false

stevedotstevedot

I have the following code in sandbox. Created a Site with the following visualforce page as the "Active Site Home Page" and given read access to the Case object.

 

But when i visit the SiteURL, i only get a result '0'.

When i access to the visualforce page directly, it gives me the right Case count in the sandbox.

 

Tested with showHeader=false or true is also the same. What did i missed?

 

 

 

APEX:

global class testtPageController {

public static Case[] testCaseList { get; set; }
public testPageController() { } // empty constructor

@RemoteAction
global static Case[] getTestCaseList() {

    String querycase = 'select Id from Case';

    testCaseList = database.query(querycase);
    return testCaseList;

}

}

 

Visualforce Page:

<apex:page controller="testtPageController" showHeader="false" sidebar="false" standardStylesheets="true">

<script type="text/javascript">

 

Visualforce.remoting.Manager.invokeAction(
        '{!$RemoteAction.testPageController.getTestCaseList}',function(result, event){
        if (event.status && event.result) {
            alert(result.length);
        }
        else{
            alert(event.message);
        }
    },{escape:false});

</script>

QualcommQualcomm

Hi 

 

I am also facing the same probelm. If any body provides the solution would be great helpful

 

Thanks,

Swarnaja