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
mnz123mnz123 

How do i post code in this forum?

          Is there any particular syntax I should follow like in stackoverflow? How do i post code in this forum?
Ashish_SFDCAshish_SFDC
Hi Moin, 


This is a Rich Text Field, There is no format, you can paste directly.

You can browse through the other Threads here. 


Regards,
Ashish
MnZ321MnZ321
Sorry, got logged in from another account. I pasted a vf page and  controller, but everything was displayed as garbled text after I posted
MnZ321MnZ321
Have been trying to learn Javascript Remoting since hours. I have manipulated this example to display a table of records with remoting an apex class. Following is the controller and VF.. My controller pulls all records from custom object Feedback. But i'm unable to display in VF. Please guide.
<pre>
global with sharing class AccountRemoter {

public String accountName { get; set; }
public Feedback__c account { get; set; }
public AccountRemoter() { }

@RemoteAction
global static List<Feedback__c> getAccount(String accountName) {
List<Feedback__c> account = [SELECT Name FROM Feedback__c ];
return account;
}
}
and the Visualforce page...

<apex:page controller="AccountRemoter">
<script type="text/javascript">
function getRemoteAccount() {
    var accountName = document.getElementById('acctSearch').value;

    Visualforce.remoting.Manager.invokeAction(
        '{!$RemoteAction.AccountRemoter.getAccount}',
        accountName,
        function(result, event){
            if (event.status) {
                // Get DOM IDs for HTML and Visualforce elements like this
                document.getElementById('remoteAcctId').innerHTML = result.Id
                document.getElementById(
                    "{!$Component.block.blockSection.secondItem.acctNumEmployees}"
                    ).innerHTML = result.NumberOfEmployees;
            } else if (event.type === 'exception') {
                document.getElementById("responseErrors").innerHTML =
                    event.message + "<br/>\n<pre>" + event.where + "</pre>";
            } else {
                document.getElementById("responseErrors").innerHTML = event.message;
            }
         },
         {escape: true}
     );
   }
  </script>

    <input id="acctSearch" type="text"/>
    <button onclick="getRemoteAccount()">Get Feedbacks</button>
    <div id="responseErrors"></div>

    <apex:pageBlock id="block">
    <apex:pageBlockSection id="blockSection" columns="2">
        <apex:pageBlockSectionItem id="firstItem">
            <span id="remoteAcctId"/>
        </apex:pageBlockSectionItem>
        <apex:pageBlockSectionItem id="secondItem">
            <apex:outputText id="acctNumEmployees"/>
        </apex:pageBlockSectionItem>
    </apex:pageBlockSection>
   </apex:pageBlock>
   </apex:page>
</pre>

The closest to a table on click of the "Get Feedback" button, I have achieved so far with undefined results.... enter image description here

Any help will be appreciated. Thanks

UPDATE: Fields in Feedback

Client_Feedback_App__c

Description__c

Importance__c

Resolution__c

Status__c

Summary__c

apex javascrip

MnZ321MnZ321
nobody will answer this question =(
thisisnotaprilthisisnotapril
Hi MnZ321; use the <pre> tag and your code will post nicely.
thisisnotaprilthisisnotapril
And I edited your original post with the code to include the pre tag, so it's displaying nicely now. Hope that helps!!
MnZ321MnZ321
should I add like this ?
<pre>
code
<pre>
thisisnotaprilthisisnotapril
You'll want to close the tag at the end of your code. So like this:
<pre>
code
//</pre>