• Gurpreet Singh Panesar
  • NEWBIE
  • 0 Points
  • Member since 2017


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 6
    Replies
Hi, I'm working on creating a visual force page for a custom object I created. When I go to save it, it says that the standard controller is unknown. I used the full API name.

Apex Class

public with sharing class salescoachingRedirect {

VF Page
<apex:page standardController="Sales_Coaching_Note__c" extensions="salescoachingRedirect" action="{!redirect}" >

This is the error I'm getting: Error: Unknown method 'Coaching_Note__cStandardController.redirect()'

I only put the first line for the apex class and VF page because they are both really long, but if you need it I don't mind pasting it. Any help would be greatly appreciated.

Thanks!
Update account phone number by contact phone number  by account phone number on before update, it is possible or not,
 i am trying using berfore update with map, i am not geting 

// update AccountPHONE by CONTACT
   public Class BeoreupdateAccountPhone{
       public static void beforeupdate(map<id,contact>newmap,map<id,contact>oldmap){
       
        set<id> ids= new set<id>();
       for(id key:oldmap.keyset()){
         contact n1= newmap.get(key);
         contact o1= oldmap.get(key);
             ids.add(key);
             
             list<account> ac= new list<account>();
             list<account> acc=[select phone,(select phone from contacts) from account where id=:ids];
                 for(account a:acc){
                    for(contact c:a.contacts){
                       if(a.phone!= c.phone){
                       a.phone= c.phone;
                          // acc.add((c.phone).a.contacts);
                          acc.add(a);
                           }
                           }
                       }
                       update acc;
                       }
                         }}
I have little dought in trigger  can we update account phone number by contact phone number >ON Beffore update,,please focus on this, i am using map i am not getting need know for learning purpose 
 i know after it is possible please brifly explain me,

// update AccountPHONE by CONTACT
   public Class BeoreupdateAccountPhone{
       public static void beforeupdate(map<id,contact>newmap,map<id,contact>oldmap){
       
        set<id> ids= new set<id>();
       for(id key:oldmap.keyset()){
         contact n1= newmap.get(key);
         contact o1= oldmap.get(key);
             ids.add(key);
             
             list<account> ac= new list<account>();
             list<account> acc=[select phone,(select phone from contacts) from account where id=:ids];
                 for(account a:acc){
                    for(contact c:a.contacts){
                       if(a.phone!= c.phone){
                       a.phone= c.phone;
                           //acc.add((c.phone).contacts);
                           }
                           }
                       }
                       update acc;
                       }
                         }}

Hi All,
I am trying to download csv file when i click on button. But when i click button i am getting like this in csv file.

{"index":93 name:"HideProfileElvVideo" value:false}. Below is my code

VF Page:

<apex:page controller="MyCustomListViewController" contentType="application/vnd.ms-excel#filename.csv">{!header}
<!-- <apex:pageBlock >
<apex:pageBlockTable value="{!Contacts}" var="contact" id="pbt"> 
<apex:column >
<apex:outputField value="{!contact.con.Name}"/>
</apex:column>

<apex:column >
<apex:outputField value="{!contact.con.Account.name}"/> 
</apex:column>
<apex:column >
<apex:outputField value="{!contact.con.Phone}"/>
</apex:column> 
<apex:column >
<apex:outputField value="{!contact.con.Email}"/>
</apex:column> 
</apex:pageBlockTable> 
</apex:pageBlock> -->
<!-- <apex:repeat value="{!Contacts}" var="contact" >
{!contact.con.Name},{!contact.con.Account.name},{!contact.con.Phone},{!contact.con.Email}
</apex:repeat> -->

<apex:pageBlock >
<apex:pageBlockTable value="{!Contacts}" var="contact" id="pbt"> 
{!contact.con.Name},{!contact.con.Account.name},{!contact.con.Phone},{!contact.con.Email}

</apex:pageBlockTable> 
</apex:pageBlock> 
</apex:page>