• beastaw56
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
I have created a rest resource so that when a post is sent to the /services/apexrest/CallCenter I want it to update my visualforce page CallCenter. I wrote something simple for just proof of concept however I cant get any of the post parameters to show up on my visual force page. I am using hurl.it so i know it is hitting the method correctly because it is returning a 200 ok with the Name variable in the response body. Can someone please advise what I am doing wrong or point me in the right direction of getting my HTTP post content onto my VF page. 

More Information: I am using a custom site to skip authentication. I have enabled the class and the VF page for my site so i do not think that is the issue. I am passing the Name parameter to the variable String which i initialize as "hi" and then i send the post and my thoughts were after I hit the reload button to rerender the output panel my parameter would be there. I am sending my post via JSON {"Name":"hey"}


@RestResource(urlMapping='/CallCenter')
global without sharing class CallCenterController{
   
    Public string session {get;set;}
    Public String dial {get; set;}
    Public String callString {get; set;}
    public static String test {get; set;}
    public static String post;
  
   
    global CallCenterController()
    {
        test = 'hi';
    }
   
    @HttpPost
    global static String createHistory(String Name) {
        test = Name;
        return Name;
       
       
    }

<apex:page showHeader="false" sidebar="false" controller="CallCenterController">
<apex:form >
    <apex:PageBlock >
        <center><apex:selectList value="{!callString}" id="equip" size="1">
                <apex:selectOptions value="{!calls}" />
            </apex:selectList></center>

        <apex:outputPanel id="yes">
            <center><apex:outputText value="{!test}" /></center>
        </apex:outputPanel>

        <apex:commandButton value="reload" rerender="yes" />
    </apex:PageBlock>
    <apex:PageBlock >
        <center><apex:commandButton action="{!call}" value="Call" /></center>
        <center><apex:inputText maxlength="11"  value="{!dial}" /></center>
    </apex:PageBlock>
   
</apex:form>
</apex:page>

I have a page that rerenders two Related lists after 5 seconds using actionPoller. The related list ID's users and equip rerender properly after the records get updated from Webservices callouts. The problem is that after the related list the link for the record just refreshes the current page instead of taking me to that records page. I am new to VisualForce pages so any help is appreciated. When I hover my mouse over the link it displays the correct URL. And if I click the link before it rerenders it works

 

<apex:page standardController="Subscriber__c" extensions="PullUserData" action="{!updateUser}">
<apex:detail relatedList="false">
<apex:form >
<apex:commandButton value="Refresh Lists" reRender="users, equip" />
</apex:form>
<apex:relatedList id="users" list="Users__r" />
<apex:relatedList list="DID__r" />
<apex:relatedList id="equip" list="Inventory__r"/>
<apex:relatedList list="TUT__r" />
<apex:relatedList list="Orders__r" />
<apex:relatedList list="Cases__r" />
<apex:relatedList list="OpenActivities" />
<apex:relatedList list="ActivityHistories" />
<apex:relatedList list="CombinedAttachments" />
</apex:detail>
<apex:form >
<apex:actionPoller action="{!increaseCount}" reRender="users, equip" rendered="TRUE" interval="5" enabled="{!IF(count == 0, TRUE, FALSE)}" />
</apex:form>
</apex:page>

I have created a rest resource so that when a post is sent to the /services/apexrest/CallCenter I want it to update my visualforce page CallCenter. I wrote something simple for just proof of concept however I cant get any of the post parameters to show up on my visual force page. I am using hurl.it so i know it is hitting the method correctly because it is returning a 200 ok with the Name variable in the response body. Can someone please advise what I am doing wrong or point me in the right direction of getting my HTTP post content onto my VF page. 

More Information: I am using a custom site to skip authentication. I have enabled the class and the VF page for my site so i do not think that is the issue. I am passing the Name parameter to the variable String which i initialize as "hi" and then i send the post and my thoughts were after I hit the reload button to rerender the output panel my parameter would be there. I am sending my post via JSON {"Name":"hey"}


@RestResource(urlMapping='/CallCenter')
global without sharing class CallCenterController{
   
    Public string session {get;set;}
    Public String dial {get; set;}
    Public String callString {get; set;}
    public static String test {get; set;}
    public static String post;
  
   
    global CallCenterController()
    {
        test = 'hi';
    }
   
    @HttpPost
    global static String createHistory(String Name) {
        test = Name;
        return Name;
       
       
    }

<apex:page showHeader="false" sidebar="false" controller="CallCenterController">
<apex:form >
    <apex:PageBlock >
        <center><apex:selectList value="{!callString}" id="equip" size="1">
                <apex:selectOptions value="{!calls}" />
            </apex:selectList></center>

        <apex:outputPanel id="yes">
            <center><apex:outputText value="{!test}" /></center>
        </apex:outputPanel>

        <apex:commandButton value="reload" rerender="yes" />
    </apex:PageBlock>
    <apex:PageBlock >
        <center><apex:commandButton action="{!call}" value="Call" /></center>
        <center><apex:inputText maxlength="11"  value="{!dial}" /></center>
    </apex:PageBlock>
   
</apex:form>
</apex:page>

I have a page that rerenders two Related lists after 5 seconds using actionPoller. The related list ID's users and equip rerender properly after the records get updated from Webservices callouts. The problem is that after the related list the link for the record just refreshes the current page instead of taking me to that records page. I am new to VisualForce pages so any help is appreciated. When I hover my mouse over the link it displays the correct URL. And if I click the link before it rerenders it works

 

<apex:page standardController="Subscriber__c" extensions="PullUserData" action="{!updateUser}">
<apex:detail relatedList="false">
<apex:form >
<apex:commandButton value="Refresh Lists" reRender="users, equip" />
</apex:form>
<apex:relatedList id="users" list="Users__r" />
<apex:relatedList list="DID__r" />
<apex:relatedList id="equip" list="Inventory__r"/>
<apex:relatedList list="TUT__r" />
<apex:relatedList list="Orders__r" />
<apex:relatedList list="Cases__r" />
<apex:relatedList list="OpenActivities" />
<apex:relatedList list="ActivityHistories" />
<apex:relatedList list="CombinedAttachments" />
</apex:detail>
<apex:form >
<apex:actionPoller action="{!increaseCount}" reRender="users, equip" rendered="TRUE" interval="5" enabled="{!IF(count == 0, TRUE, FALSE)}" />
</apex:form>
</apex:page>