• Ritika Shouche
  • NEWBIE
  • 20 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
Unable to Call a method from VF Page -

Method I am Calling is From a different class and not in Controller -
 
Public PageReference save() {
  
  UtilityClass.newLog(); 
  
  
  }

Trying to Call this Method from below VF ;-
 
<apex:form >
        <apex:pageBlock title="My Content" id="P1">
            <apex:pageBlockSection title="My Content Section" columns="1">
                <apex:inputCheckBox label="User Details" disabled="true" />
                <apex:inputCheckBox label="User Contacts" disabled="true"/>
                <apex:inputCheckBox label="User Access" disabled="true"/>
            </apex:pageBlockSection>
         <a class="btn" onclick="myFunction()" >Cancel</a>
            <apex:commandButton oncomplete="myFunction()" value="Edit" rerender="P1"/>
            <apex:commandButton action="{!save}" value="Save"/>
        </apex:pageBlock>
    </apex:form>

 
Hi,

I have three Objects to Deal with - User (Portal user), Contact and CustomObject.
CustomObject is Child of Contact.

Considering Three Checkbox fields on Custom Child Object I want to display Checkbox True or False in front of user record on VIualforce Page table.
 
//This gives me Logged in users ID and ContactID on his user record
userList  = new List<User>();
    User usr = [Select Id, contactId from User WHERE ID ='XXXyyyyyyyZZZZ' ];
     
//This gives me name of Account of Contact of Logged in User
con = [Select id,Name,AccountId,Account.Name,Phone__c ,Email__c FROM  Contact WHERE ID =: usr.ContactId];
   
//This gives me List of all Contacts for that Account also FIelds on Custom CHild Object of Contact which we need to use for Checkbox Display
contactInfo = [Select id,Name, (SELECT ID ,Active__c,Support__c FROM CustomObject__r)from Contact WHERE AccountId =: con.accountId];
    
//This gives List of Users for those Contacts       
userinfolist = [Select Id,Name,ContactId,Contact.Name,Email,CompanyName,Phone from User Where IsActive = true AND Profile.Name =: Label.SupportUser AND ContactId IN: contactInfo];
    
}

With above information, I can display Name of User, Email and Phone using List "userinfolist ". Now I want to add A column with a checkbox, where if User's Contact record has CustomCHild Object record created and IF Active__c and Support__c field on that child record are True then Display true on userinfolist.

 
Hi I am trying to Show COntacts Account Name on VIsualforce Page while Using Custom COntroller - 
 
Contact con = [Select id,Name,AccountId,Account.Name FROM  Contact WHERE ID =: usr.ContactId];

I am trying to Get Account.name on the head of a Page.

I am trying to use Apex:Repeat but nothing is getting displayed.
 
<apex:repeat value="{!con}" var="myCon" > <apex:outputField value="{!myCon.Account.Name}" /> </apex:repeat>

 
Hi,

I have three Objects to Deal with - User (Portal user), Contact and CustomObject.
CustomObject is Child of Contact.

Considering Three Checkbox fields on Custom Child Object I want to display Checkbox True or False in front of user record on VIualforce Page table.
 
//This gives me Logged in users ID and ContactID on his user record
userList  = new List<User>();
    User usr = [Select Id, contactId from User WHERE ID ='XXXyyyyyyyZZZZ' ];
     
//This gives me name of Account of Contact of Logged in User
con = [Select id,Name,AccountId,Account.Name,Phone__c ,Email__c FROM  Contact WHERE ID =: usr.ContactId];
   
//This gives me List of all Contacts for that Account also FIelds on Custom CHild Object of Contact which we need to use for Checkbox Display
contactInfo = [Select id,Name, (SELECT ID ,Active__c,Support__c FROM CustomObject__r)from Contact WHERE AccountId =: con.accountId];
    
//This gives List of Users for those Contacts       
userinfolist = [Select Id,Name,ContactId,Contact.Name,Email,CompanyName,Phone from User Where IsActive = true AND Profile.Name =: Label.SupportUser AND ContactId IN: contactInfo];
    
}

With above information, I can display Name of User, Email and Phone using List "userinfolist ". Now I want to add A column with a checkbox, where if User's Contact record has CustomCHild Object record created and IF Active__c and Support__c field on that child record are True then Display true on userinfolist.