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
Karthik ManoKarthik Mano 

Account Team Visualforce

Hi ,

 

I am trynig to create a vf for Account Team "Add" button. my code is like following ,

 

<tr>
<td><apex:inputField value="{!AccountTeamMember.UserId}" required="false" /></td>
<td><apex:inputField value="{!AccountTeamMember.TeamMemberRole}"/></td>
<td><apex:inputField value="{!AccountTeamMember.AccountAccessLevel}"/></td>
</tr>
<tr>
<td><apex:inputField value="{!AccountTeamMember.UserId}" required="false" /></td>
<td><apex:inputField value="{!AccountTeamMember.TeamMemberRole}"/></td>
<td><apex:inputField value="{!AccountTeamMember.AccountAccessLevel}"/></td>
</tr>

 

Where i am creating two members at a time. Can any one please let me know how to get these two UserIds in controller. **AccountTeamMember.UserId is the standard User LookUp field i have used.

 

Thanks Much.

Shiv ShankarShiv Shankar

Hi Karthik,

 

As far as i know If you want to store two AccountTeam with different information we should use two different record to store data. we need to specify two variable in controller.

Like this :

 

public class yourControllerClass{
	AccountTeamMember__c accTeamMember1 {get; set;}
	AccountTeamMember__c accTeamMember2 {get; set;}
	List<AccountTeamMember___c> accTeamMemberList ;
	public yourControllerClass(){
		accTeamMember1 = new AccountTeamMember__c();
		accTeamMember2 = new AccountTeamMember__c();
	}
	
	public void saveRecord(){
		accTeamMemberList = new List<AccountTeamMember__c>();
		accTeamMemberList.add(accTeamMember1);
		accTeamMemberList.add(accTeamMember2);
		insert accTeamMemberList;
	}
}

 and our VF page will be like this

 

<tr>
<td><apex:inputField value="{!accTeamMember1.UserId}" required="false" /></td>
<td><apex:inputField value="{!accTeamMember1.TeamMemberRole}"/></td>
<td><apex:inputField value="{!accTeamMember1.AccountAccessLevel}"/></td>
</tr>
<tr>
<td><apex:inputField value="{!accTeamMember2.UserId}" required="false" /></td>
<td><apex:inputField value="{!accTeamMember2.TeamMemberRole}"/></td>
<td><apex:inputField value="{!accTeamMember2.AccountAccessLevel}"/></td>
</tr>

<apex:commandButton action="{! saveRecord}" value="Save"/>

 

 

 

 

ankita varma 3ankita varma 3
Hello,
I am struggling with the visualforce page, where I am trying to bind AccountAccessLevel field to inputfield on vf page. But its not visible on the page. Same for ContactAccessLevel, OpportunityAccessLevel and CaseAccessLevel. Kindly, help me to resolve this one.
Thanks,
Ankita