• sylar20
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 19
    Replies

Live Agent Post chat Survey is saved along with Live Agent Chat Transcript Start Time. I tried to map the survey to transcript using Start Time but still facing problem to map them.

Is there any other way to map Post Chat survey to Live Agent Chat Transcript ????

New items are not getting added to the list which is the part of Inner class list.

 

Apex Class : 

 

public with sharing class Pricing_New 
{
	public Pricing2__c objPricing;
	public Pricing2__c objPricingNew;
	public list<SPackage> lstPackage 		{get;set;}
	
	public String strPackageNumber 	 		{get;set;}
	public integer intPackageNumber;  
	
	public list<Service_Level__c> lstSL;
	public map<string,Service_Level__c> mpSL;
		
	public Pricing_New(ApexPages.StandardController stdController) 
	{
        this.objPricing = (Pricing2__c)stdController.getRecord();
        lstSL = [Select 
					Name__c, 
					Level_6_Price_Low__c, 
					Level_6_Price_High__c, 
					Level_6_Note__c, 
					Level_6_Checks_Low__c, 
				    Level_6_Checks_High__c, 
				    Level_5_Price_Low__c, 
				    Level_5_Price_High__c, 
				    Level_5_Note__c, 
				    Level_5_Checks_Low__c, 
				    Level_5_Checks_High__c, 
				    Level_4_Price_Low__c, 
				    Level_4_Price_High__c, 
				    Level_4_Note__c, 
				    Level_4_Checks_Low__c, 
				    Level_4_Checks_High__c, 
				    Level_3_Price_Low__c, 
				    Level_3_Price_High__c, 
				    Level_3_Note__c, 
				    Level_3_Checks_Low__c, 
				    Level_3_Checks_High__c, 
				    Level_2_Price_Low__c, 
				    Level_2_Price_High__c, 
				    Level_2_Note__c, 
				    Level_2_Checks_Low__c, 
				    Level_2_Checks_High__c, 
				    Level_1_Price_Low__c, 
				    Level_1_Price_High__c, 
				    Level_1_Note__c, 
				    Level_1_Checks_Low__c, 
				    Level_1_Checks_High__c, 
				    COGS__c 
				From 
					Service_Level__c
				];
			
			mpSL = new map<string,Service_Level__c>([Select 
														Name__c, 
														Level_6_Price_Low__c, 
														Level_6_Price_High__c, 
														Level_6_Note__c, 
														Level_6_Checks_Low__c, 
													    Level_6_Checks_High__c, 
													    Level_5_Price_Low__c, 
													    Level_5_Price_High__c, 
													    Level_5_Note__c, 
													    Level_5_Checks_Low__c, 
													    Level_5_Checks_High__c, 
													    Level_4_Price_Low__c, 
													    Level_4_Price_High__c, 
													    Level_4_Note__c, 
													    Level_4_Checks_Low__c, 
													    Level_4_Checks_High__c, 
													    Level_3_Price_Low__c, 
													    Level_3_Price_High__c, 
													    Level_3_Note__c, 
													    Level_3_Checks_Low__c, 
													    Level_3_Checks_High__c, 
													    Level_2_Price_Low__c, 
													    Level_2_Price_High__c, 
													    Level_2_Note__c, 
													    Level_2_Checks_Low__c, 
													    Level_2_Checks_High__c, 
													    Level_1_Price_Low__c, 
													    Level_1_Price_High__c, 
													    Level_1_Note__c, 
													    Level_1_Checks_Low__c, 
													    Level_1_Checks_High__c, 
													    COGS__c 
													From 
														Service_Level__c
													]);
				
        intPackageNumber = 1;
        strPackageNumber = 'Package ' + intPackageNumber; 
		objPricingNew = new Pricing2__c();
		lstPackage = new list<SPackage>();
		
		Service_Package__c objSP1 = new Service_Package__c();
		list<Service> lstSer = new list<Service>();
		lstSer.add(new Service('',0,0,0,0,0,0));
		lstPackage.add(new SPackage(objSP1,0,0,lstSer,strPackageNumber));
    }
    
    public PageReference addMorePackages()
    {
    	intPackageNumber = intPackageNumber + 1;
        strPackageNumber = 'Package ' + intPackageNumber;
        
    	Service_Package__c objSP1 = new Service_Package__c();
		
		list<Service> lstSer = new list<Service>();
		lstSer.add(new Service('',0,0,0,0,0,0));
		
		lstPackage.add(new SPackage(objSP1,0,0,lstSer,strPackageNumber));
    	return null;
    }
    
    public PageReference addMoreServices()
    {
    	String strPackageNumber = ApexPages.currentPage().getParameters().get('PkgNumber'); 
    	integer intI = Integer.valueOf(strPackageNumber);
    	
    	if(intI>0)
    	{
    		Service objSer = new Service();
			objSer.strServiceName = '';
			objSer.dbPrice = 0;
			objSer.intVolume = 0;
			objSer.dbCOGS = 0;
			objSer.dbMargin = 0;
			objSer.dbLow = 0;
			objSer.dbHigh = 0;
    		lstPackage[intI-1].lstService.add(objSer);
    		system.debug('llllllll'+lstPackage[intI-1].lstService.size());
    	}
       	return null;
    }
    
    public PageReference SavePricing()
    {
    	return null;
    }
    
    public PageReference showServiceBLP()
    {
		return null;
	}
    
    public List<SelectOption> getServiceNames() 
    {
		List<SelectOption> options = new List<SelectOption>();
		set<string> stService = new set<string>();
        options.add(new SelectOption('', '-None-'));
        stService.add('-None-');
        for(Service_Level__c sl : lstSL)
   		{
   			if(!stService.contains(sl.Id))
   			{
      			options.add(new SelectOption(sl.Id, sl.Name__c));
      			stService.add(sl.Id);
   			}
   		}       
	  	return options;
    }
    
    public List<SelectOption> getProfileAvailability() 
    {
		List<SelectOption> options = new List<SelectOption>();
        
   		Schema.DescribeFieldResult fieldResult = Service_Package__c.Profile_Availability__c.getDescribe();
   		List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
      
        options.add(new SelectOption('', '-None-'));
        for( Schema.PicklistEntry f : ple)
   		{
      		options.add(new SelectOption(f.getLabel(), f.getValue()));
   		}       
   		system.debug('........ '+options);
	  	return options;
    }
       
    public class SPackage
    {
		public Service_Package__c objSP 	{get;set;}
		public double dbSumLowPrice			{get;set;}
		public double dbSumHighPrice		{get;set;}
		public string strLabel				{get;set;}
		public List<Service> lstService		{get;set;}
		
		public Spackage()
		{
			
		}
		
		public SPackage(Service_Package__c sp, double low, double high, List<Service> lstS, string strLbl)
		{
			objSP = sp;
			dbSumLowPrice = low;
			dbSumHighPrice = high;
			lstService = lstS;
			strLabel = strLbl;
		}
    }
    
    public class Service
    {
		public String strServiceName	 {get;set;}
		public double dbPrice			 {get;set;}
		public integer intVolume	  	 {get;set;}
		public double dbCOGS		  	 {get;set;}
		public double dbMargin			 {get;set;}
		public double dbLow				 {get;set;}
		public double dbHigh			 {get;set;}
		
		public Service()
		{
			
		}
    	public Service(String SN, double price, integer vol, double cogs, double margin, double low, double high)
    	{
    		strServiceName = SN;
			dbPrice = price;
			intVolume = vol; 
			dbCOGS = cogs;
			dbMargin = margin;
			dbLow = low;
			dbHigh = high;
    	}
    }
}

<apex:page standardcontroller="Pricing2__c" extensions="Pricing_New">
	<apex:form >
		<apex:pageBlock title="Pricing" id="mainPB">
			<apex:pageblockSection columns="2">
				<apex:pageblocksectionitem >
					<apex:outputLabel value="Account" />
					<apex:inputfield value="{!Pricing2__c.AccountId__c}"  />
				</apex:pageblocksectionitem>
				<apex:pageblocksectionitem >
					<apex:outputLabel value="Number of Checks" />
					<apex:inputfield value="{!Pricing2__c.Checks__c}" onchange="showLowHighBLP()" required="true"/>
				</apex:pageblocksectionitem>
			</apex:pageblockSection>
			<br/>
			<apex:repeat value="{!lstPackage}" var="P"> 
				<apex:pageBlock title="{!P.strLabel}" >
					<apex:pageBlockSection columns="2">
						
						<apex:pageBlockSectionItem >
							<apex:outputLabel value="Profile Name" />
							<apex:inputText value="{!P.objSP.Profile_Name__c}" />
						</apex:pageBlockSectionItem>
						
						<apex:pageBlockSectionItem >
							<apex:outputLabel value="Profile Availability" />
							<apex:selectList value="{!P.objSP.Profile_Availability__c}" size="1">
								<apex:selectOptions value="{!ProfileAvailability}" />  
							</apex:selectList> 
						</apex:pageBlockSectionItem>
						
						<apex:pageBlockSectionItem >
							<apex:outputLabel value="Enable Package Pricing" />
							<apex:inputCheckbox value="{!P.objSP.Enable_Package_Pricing__c}" /> 
						</apex:pageBlockSectionItem>
						
						<apex:pageBlockSectionItem >
							<apex:outputLabel value="Add Maiden / Alias search" />
							<apex:inputCheckbox value="{!P.objSP.Add_Maiden_Alias_search__c}" /> 
						</apex:pageBlockSectionItem>
						
						<apex:pageBlockSectionItem >
							<apex:outputLabel value="Profile Price	" />
							<apex:inputText value="{!P.objSP.Profile_Price__c}" />
						</apex:pageBlockSectionItem>
						
						<apex:pageBlockSectionItem >
							<apex:outputLabel value="Maiden / Alias Price" />
							<apex:inputText value="{!P.objSP.Maiden_Alias_Price__c}" />
						</apex:pageBlockSectionItem>
						
						<apex:pageBlockSectionItem rendered="true">
							<apex:outputLabel value="BLP Low Level" />
							<apex:outputLabel value="{!P.dbSumLowPrice}" />
						</apex:pageBlockSectionItem>

						<apex:pageBlockSectionItem >
						</apex:pageBlockSectionItem>

						<apex:pageBlockSectionItem rendered="true">
							<apex:outputLabel value="BLP High Level" />
							<apex:outputLabel value="{!P.dbSumHighPrice}" />
						</apex:pageBlockSectionItem>
						
					</apex:pageBlockSection>
					<br/>
					
						<table width="100%" style="border-collapse:collapse;" cellpadding="4">
							<tr>
								<th width="25%" style="border-collapse:collapse;background-color:#8fc800;">
									<center>Service</center>
								</th>
								<th width="15%" style="border-collapse:collapse;background-color:#8fc800;">
									<center>Volume</center>
								</th>
								<th width="15%" style="border-collapse:collapse;background-color:#8fc800;">
									<center>Price</center>
								</th>
								<th width="15%" style="border-collapse:collapse;background-color:#8fc800;">
									<center>BLP Low Level</center>
								</th>
								<th width="15%" style="border-collapse:collapse;background-color:#8fc800;">
									<center>BLP High Level</center>
								</th>
								<th width="15%" style="border-collapse:collapse;background-color:#8fc800;">
									<center>Margin</center>
								</th>
							</tr>
							<apex:repeat value="{!P.lstService}" var="S">
								<tr>
									<td width="25%" style="border-collapse:collapse;background-color:#DCDCDC;">
										<center>
											<apex:selectList value="{!S.strServiceName}" size="1" onchange="showLowHighBLP()">
												<apex:selectOptions value="{!ServiceNames}" />
											</apex:selectList> 	
										</center>
									</td>
									<td width="15%" style="border-collapse:collapse;background-color:#DCDCDC;">
										<center>
											<apex:inputText value="{!S.intVolume}" onchange="showLowHighBLP()" />
										</center>
									</td>
									<td width="15%" style="border-collapse:collapse;background-color:#DCDCDC;">
										<center>
											<apex:inputText value="{!S.dbPrice}" onchange="showLowHighBLP()" />
										</center>
									</td>
									<td width="15%" style="border-collapse:collapse;background-color:#DCDCDC;">
										<center>
											<apex:outputLabel value="{!S.dbLow}" />
										</center>
									</td>
									<td width="15%" style="border-collapse:collapse;background-color:#DCDCDC;">
										<center>
											<apex:outputLabel value="{!S.dbHigh}" />
										</center>
									</td>
									<td width="15%" style="border-collapse:collapse;background-color:#DCDCDC;">
										<center>
											<apex:outputLabel value="{!S.dbMargin}" />
										</center>
									</td>
								</tr>
							</apex:repeat>
						</table>
						<br/>
						<center><Button onclick="addServices('{!P.strLabel}')" >Add More Services</Button></center>	
				</apex:pageBlock>
			</apex:repeat>
			<apex:commandButton value="Add More Package" action="{!addMorePackages}" />
			<apex:pageblockButtons >
				<apex:commandButton value="Save Pricing" action="{!SavePricing}" />
			</apex:pageblockButtons>
		</apex:pageBlock>
		<apex:actionFunction name="showServiceBLP" action="{!showServiceBLP}" rerender="mainPB" />
		<apex:actionFunction name="addMoreServices" action="{!addMoreServices}" rerender="mainPB" >
			<apex:param name="PkgNumber" value="" />
		</apex:actionFunction>
	</apex:form>
	
	<script>
		function showLowHighBLP()
		{
			showServiceBLP();
		}
		
		function addServices(myPackage)
		{
			var pac = myPackage;
			var para = pac.substring(8);
			addMoreServices(para);
		}
	</script>
	
</apex:page>

 Pricing Image

i need to create an email approval process for case object where the approver is the case contact. also need to process the contact's email reply to approve(closure as field update) or reject the case. Is it possible as i've read that only sf user can be an approver?? 

i need to create an email approval process for case object where the approver is the case contact. also need to process the contact's email reply to approve(closure as field update) or reject the case. Is it possible as i've read that only sf user can be an approver?? 

In the Solutions tab, we would like to be able to quantify which of our solutions are the most popular (most viewed) by our users. At the moment there is no way to do this.. 

Hi,

I have created a custom controller and an VF page to import records for my Custom Object Username.

But the issue is I'm not able to import all records from the template.

Only the first record is getting imported.

 

VF page:

 

 

public class UsernameFileUploader 
{
    
public string nameFile{get;set;}
    public Blob contentFile{get;set;}
    String[] filelines = new String[]{};
    List<Username__c> urnmtoupload;
    
    public Pagereference ReadFile()
    {
        nameFile=contentFile.toString();
        filelines = nameFile.split('\n');
        urnmtoupload = new List<Username__c>();
        for (Integer i=1;i<filelines.size();i++)
        {
            String[] inputvalues = new String[]{};
                inputvalues = filelines[i].split(',');  
                Username__c a = new Username__c();
                a.Username__c = inputvalues[0];
                a.Contact_Name__c = inputvalues[1];       
                a.Phone__c = i=integer.valueof(inputvalues[2]);
                a.Email_Address__c = inputvalues[3];
                a.Billing_Account__c = inputvalues[4];
                a.View__c = inputvalues[5];
                a.Bill_Code__c = inputvalues[6];
                if (inputvalues[7] == 'True')
                {a.Lookup__c = True;}
                else
                {a.Lookup__c = False;}
                
                if (inputvalues[8] == 'True')
                {a.Summary__c = True;}
                else
                {a.Summary__c = False;}
                
                if (inputvalues[9] == 'True')
                {a.View_Score__c = True;}
                else
                {a.View_Score__c = False;}
                
                if (inputvalues[10] == 'True')
                {a.Report__c = True;}
                else
                {a.Report__c = False;}
                
                if (inputvalues[11] == 'True')
                {a.Draft__c = True;}
                else
                {a.Draft__c = False;}
                
                if (inputvalues[12] == 'True')
                {a.Order__c = True;}
                else
                {a.Order__c = False;}

                if (inputvalues[13] == 'True')
                {a.Pass_Fail__c = True;}
                else
                {a.Pass_Fail__c = False;}
                
                
                a.Additional_Notes__c = inputvalues[14];


            urnmtoupload.add(a);
        }
        try{
        insert urnmtoupload;
        }
        catch (Exception e)
        {
            ApexPages.Message errormsg = new ApexPages.Message(ApexPages.severity.ERROR,'An error has occured. Please check the template or try again later');
            ApexPages.addMessage(errormsg);
        }    
        return null;
    }
    
    public List< Username__c> getuploadedUsernames()
    {
        if (urnmtoupload!= NULL)
            if (urnmtoupload.size() > 0)
                return urnmtoupload;
            else
                return null;                    
        else
            return null;
    }            
}

 

 

 

Controller:

 

 

 

<apex:page Controller="UsernameFileUploader" >      
<apex:form >

<apex:pageBlock title="Upload data from CSV file">
             <center>
              <apex:inputFile value="{!contentFile}" filename="{!nameFile}" /> <apex:commandButton action="{!ReadFile}" value="Upload File" id="theButton" style="width:70px;"/>
              <br/> <br/> <font color="red"> <b>Note: Please use the standard template to upload Usernames. <a href="{!URLFOR($Resource.UserNameUploadTemplate)}" target="_blank"> Click here </a> to download the template. </b> </font>
             </center>  
      <apex:pageblocktable value="{!uploadedUsernames}" var="acc" rendered="{!NOT(ISNULL(uploadedUsernames))}">
          <apex:column headerValue=" Username ">
              <apex:outputField value="{!acc.Username__c}"/>
          </apex:column>
          <apex:column headerValue=" Contact Name ">
              <apex:outputField value="{!acc.Contact_Name__c }"/>
          </apex:column>
          <apex:column headerValue="Phone">
              <apex:outputField value="{!acc.Phone__c  }"/>
          </apex:column>
          <apex:column headerValue=" Email Address">
              <apex:outputField value="{!acc.Email_Address__c}"/>
          </apex:column>
          <apex:column headerValue=" Billing Account ">
              <apex:outputField value="{!acc.Billing_Account__c}"/>
          </apex:column>
          <apex:column headerValue="View">
              <apex:outputField value="{!acc.View__c }"/>
          </apex:column>
<apex:column headerValue=" Bill Code">
              <apex:outputField value="{!acc.Bill_Code__c }"/>
          </apex:column>
<apex:column headerValue="Lookup">
              <apex:outputField value="{!acc.Lookup__c }"/>
          </apex:column>
<apex:column headerValue="Summary">
              <apex:outputField value="{!acc.Summary__c  }"/>
          </apex:column>
<apex:column headerValue="View Score">
              <apex:outputField value="{!acc.View_Score__c }"/>
          </apex:column>
<apex:column headerValue=" Report">
              <apex:outputField value="{!acc.Report__c }"/>
          </apex:column>
<apex:column headerValue=" Draft">
              <apex:outputField value="{!acc.Draft__c }"/>
          </apex:column>
<apex:column headerValue=" Order">
              <apex:outputField value="{!acc.Order__c }"/>
          </apex:column>
<apex:column headerValue=" Pass / Fail">
              <apex:outputField value="{!acc.Pass_Fail__c }"/>
          </apex:column>

      </apex:pageblocktable> 
      </apex:pageBlock>       
   </apex:form>
</apex:page>

 

 

 

Hi,

 

I have configured a field dependency in my Case Object, but when i put in my VF page it doesn't work the way it does in the standard page layout. Both the fields show all picklist values. No dependency is working.

 

Following is my VF code to include those two fields in the VF page.

 

Controlling Field: Department

Dependent Field : Case Reason

 

<apex:inputField required="true" value="{!Case.Department__c}"/>
         <apex:inputField required="true" value="{!Case.Case_Reason2__c}">

 

 

I am trying to render a page block section dynamically based on two conditions , on Case Object. These two conditions are picklists. I am using the standard case controller. I haven't created any custom class controller for this.

 

I am not able to do so.. Kindly Help..

 

Following is my Custom Case VF page

<apex:page standardController="Case">
    <apex:sectionHeader title="{!$ObjectType.Case.label} Edit" subtitle="{!Case.Casenumber}"/>
    <apex:form >
    <apex:pageBlock title="{!$ObjectType.Case.label} Edit" mode="edit">
    
        <apex:pageBlockButtons >
            <apex:commandButton action="{!save}" value="Save"/>
            <apex:commandButton action="{!cancel}" value="Cancel"/>   
        </apex:pageBlockButtons>
        <apex:actionRegion >
        <apex:pageBlockSection showHeader="true" title="Case Information" columns="2">
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="Case Owner"/>
                <apex:outputText value="{!Case.Owner.Name}"/>
            </apex:pageBlockSectionItem>
            <apex:inputField required="true" value="{!Case.Status}"/>
            <apex:inputField value="{!Case.Priority}"/>
            <apex:inputField required="true" value="{!Case.ContactId}"/>
            <apex:inputField required="true" value="{!Case.AccountId}"/>
            <apex:inputField required="true" value="{!Case.Origin}"/>
            <apex:inputField value="{!Case.Department__c}"/>
                            
                        <apex:pageBlockSectionItem >
                        <apex:outputLabel value="Case Reason"/>
                        <apex:outputPanel >
                            <apex:inputField value="{!Case.Case_Reason2__c}">
                                <apex:actionSupport event="onchange" rerender="thePageBlock" status="Status"/>
                            </apex:inputField>
                            <apex:actionStatus startText="Loading Client Information Block..." id="Status"/>
                        </apex:outputPanel>
 </apex:pageBlockSectionItem>

            
            <apex:inputField value="{!Case.Account_Set_Up__c}"/>
            <apex:inputField required="true" value="{!Case.FCR__c}"/>
            <apex:inputField value="{!Case.User_Set_up__c}"/>
            <apex:inputField required="true" value="{!Case.Complaint__c}"/>
            <apex:inputField value="{!Case.EChain_Contact__c}"/>
            <apex:inputField required="true" value="{!Case.Route_to_Helpdesk__c}"/>
            <apex:inputField value="{!Case.Escalated_to_Ops_QA__c}"/>
            <apex:inputField value="{!Case.Source__c}"/>
            <apex:inputField value="{!Case.CSE_Case_Number_For_Ops_QA_only__c}"/>
            <apex:inputField value="{!Case.Escalation_Assist_Log__c}"/>
            <apex:inputField value="{!Case.CSR__c}"/>
        </apex:pageBlockSection>
        </apex:actionRegion>
        <apex:pageBlockSection showHeader="true" title="Description Information" columns="1">
            <apex:inputField value="{!Case.Subject}"/>
            <apex:inputField value="{!Case.Description}"/>
            <apex:inputField value="{!Case.Action_Taken__c}"/>
        </apex:pageBlockSection>
        
        <apex:pageBlockSection showHeader="true" title="Dispute Information" columns="2">
            <apex:inputField value="{!Case.Dispute_Investigator__c}"/>
            <apex:inputField value="{!Case.Dispute_Jurisdiction__c}"/>
            <apex:inputField value="{!Case.Dispute_Resolution__c}"/>
            <apex:inputField value="{!Case.Dispute_re__c}"/>
            <apex:inputField value="{!Case.Business_Line__c}"/>
            <apex:inputField value="{!Case.Reason_Detail__c}"/>
        </apex:pageBlockSection>
   <apex:actionRegion >
   <apex:outputPanel id="thePageBlock" rendered="{IF(!Case.Department__c == 'Criminal' && !Case.Case_Reason2__c == 'Applicant Dispute', true, false)}">
   
   
 <apex:pageBlockSection showHeader="true"  title="Client Facing Criminal Dispute Information" columns="2" >
            <apex:inputField value="{!Case.Dispute_initiated_by__c}"/>
            <apex:inputField value="{!Case.Applicant_Name__c}"/>
            <apex:inputField value="{!Case.Client_Name__c}"/>
            <apex:inputField value="{!Case.Jurisdiction_1__c}"/>
            <apex:inputField value="{!Case.Order__c}"/>
            <apex:inputField value="{!Case.Jurisdiction_2_Optional__c}"/>
            <apex:inputField value="{!Case.Client_Email_Address__c}"/>
            <apex:inputField value="{!Case.Jurisdiction_3_Optional__c}"/>
            <apex:inputField value="{!Case.Client_Email_Address_Optional__c}"/>
            <apex:inputField value="{!Case.Applicant_Dispute_Notification__c}"/>
            <apex:inputField value="{!Case.Client_Email_Address_Optional2__c}"/>
            <apex:inputField value="{!Case.Applicant_Dispute_Resolve_Favour__c}"/>
            <apex:inputField value="{!Case.Client_Email_Address_Optional3__c}"/>
            <apex:inputField value="{!Case.Applicant_Dispute_Resolve_Not_Favour__c}"/>
        </apex:pageBlockSection>
       </apex:outputPanel>
       </apex:actionRegion>
    </apex:pageBlock>
    </apex:form>
</apex:page>

 

 

The challenge is that the email is going twice.

 

following is the code for sending email (part of class)

 

    Messaging.SingleEmailMessage mail = new Messag​ing.SingleEmailMessage();
    String[] toAddresses = new String[] {c.Client_​Email_Address__c};
    if(c.Client_Email_Address_Optional__c != null)​{
    String[] toAddresses2 = new String[] {c.Client​_Email_Address_Optional__c};
    mail.setCcAddresses(toAddresses2);}
    mail.setToAddresses(toAddresses);
     EmailTemplate et = [SELECT id FROM EmailTempl​ate WHERE developerName = 'Dispute_Notification'];
    mail.setTemplateId(et.id);
    mail.setTargetObjectId(c.ContactId);
    mail.setwhatId(c.Id);
    mail.saveAsActivity = true;
    mail.setOrgWideEmailAddressId('0D2S0056674CiI'​);
    Messaging.sendEmail(new Messaging.SingleEmailM​essage[] { mail });

I could crack logging a trigger email as an activty but it sends the email twice and it also sends the email to contact email id too??

I just wanna send an email to CLient_Email_Address__c

 

Any idea?

 

 

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
    String[] toAddresses = new String[] {c.CLient_Email_Address__c};
    mail.setToAddresses(toAddresses);
    mail.setTargetObjectId(c.ContactId);
    mail.setwhatId(c.Id);
    EmailTemplate et = [SELECT id FROM EmailTemplate WHERE developerName = 'Completion_Notification'];
    mail.setTemplateId(et.id);
    mail.saveAsActivity = true;
    Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });

I am trying to select the userrole name of the user who created the case by following code but not able to get it.

It gives me an error in line 3.

 

for (Case c:accs){
User thisUser = [ select Id FROM User where Id =:c.CreatedById];
UserRole userrolle = [ select Id FROM UserRole where Id =:thisUser.UserRoleId];
string rolename = userrolle.Name;

-----------------------------------

-------------------------------

-----


}

This should not be confused with my previous message related to the pre-chat form.

 

In the post chat form of Live Agent, the developer documentation provides an example of how to spit out some values about the chat (like that would be even remotely interesting to the customer) and at the end there's the fantastically unhelpful comment: <!-- Implement your post-chat message, form, or survey here -->

 

Nowhere does it say how I can get hold of the transcript object to store the values. I just want to implement a simple customer satisfaction form in the post-chat.

 

Does anyone have any pointers or examples of how this can be accomplished? 

 

Thanks, Finn Arild.

New items are not getting added to the list which is the part of Inner class list.

 

Apex Class : 

 

public with sharing class Pricing_New 
{
	public Pricing2__c objPricing;
	public Pricing2__c objPricingNew;
	public list<SPackage> lstPackage 		{get;set;}
	
	public String strPackageNumber 	 		{get;set;}
	public integer intPackageNumber;  
	
	public list<Service_Level__c> lstSL;
	public map<string,Service_Level__c> mpSL;
		
	public Pricing_New(ApexPages.StandardController stdController) 
	{
        this.objPricing = (Pricing2__c)stdController.getRecord();
        lstSL = [Select 
					Name__c, 
					Level_6_Price_Low__c, 
					Level_6_Price_High__c, 
					Level_6_Note__c, 
					Level_6_Checks_Low__c, 
				    Level_6_Checks_High__c, 
				    Level_5_Price_Low__c, 
				    Level_5_Price_High__c, 
				    Level_5_Note__c, 
				    Level_5_Checks_Low__c, 
				    Level_5_Checks_High__c, 
				    Level_4_Price_Low__c, 
				    Level_4_Price_High__c, 
				    Level_4_Note__c, 
				    Level_4_Checks_Low__c, 
				    Level_4_Checks_High__c, 
				    Level_3_Price_Low__c, 
				    Level_3_Price_High__c, 
				    Level_3_Note__c, 
				    Level_3_Checks_Low__c, 
				    Level_3_Checks_High__c, 
				    Level_2_Price_Low__c, 
				    Level_2_Price_High__c, 
				    Level_2_Note__c, 
				    Level_2_Checks_Low__c, 
				    Level_2_Checks_High__c, 
				    Level_1_Price_Low__c, 
				    Level_1_Price_High__c, 
				    Level_1_Note__c, 
				    Level_1_Checks_Low__c, 
				    Level_1_Checks_High__c, 
				    COGS__c 
				From 
					Service_Level__c
				];
			
			mpSL = new map<string,Service_Level__c>([Select 
														Name__c, 
														Level_6_Price_Low__c, 
														Level_6_Price_High__c, 
														Level_6_Note__c, 
														Level_6_Checks_Low__c, 
													    Level_6_Checks_High__c, 
													    Level_5_Price_Low__c, 
													    Level_5_Price_High__c, 
													    Level_5_Note__c, 
													    Level_5_Checks_Low__c, 
													    Level_5_Checks_High__c, 
													    Level_4_Price_Low__c, 
													    Level_4_Price_High__c, 
													    Level_4_Note__c, 
													    Level_4_Checks_Low__c, 
													    Level_4_Checks_High__c, 
													    Level_3_Price_Low__c, 
													    Level_3_Price_High__c, 
													    Level_3_Note__c, 
													    Level_3_Checks_Low__c, 
													    Level_3_Checks_High__c, 
													    Level_2_Price_Low__c, 
													    Level_2_Price_High__c, 
													    Level_2_Note__c, 
													    Level_2_Checks_Low__c, 
													    Level_2_Checks_High__c, 
													    Level_1_Price_Low__c, 
													    Level_1_Price_High__c, 
													    Level_1_Note__c, 
													    Level_1_Checks_Low__c, 
													    Level_1_Checks_High__c, 
													    COGS__c 
													From 
														Service_Level__c
													]);
				
        intPackageNumber = 1;
        strPackageNumber = 'Package ' + intPackageNumber; 
		objPricingNew = new Pricing2__c();
		lstPackage = new list<SPackage>();
		
		Service_Package__c objSP1 = new Service_Package__c();
		list<Service> lstSer = new list<Service>();
		lstSer.add(new Service('',0,0,0,0,0,0));
		lstPackage.add(new SPackage(objSP1,0,0,lstSer,strPackageNumber));
    }
    
    public PageReference addMorePackages()
    {
    	intPackageNumber = intPackageNumber + 1;
        strPackageNumber = 'Package ' + intPackageNumber;
        
    	Service_Package__c objSP1 = new Service_Package__c();
		
		list<Service> lstSer = new list<Service>();
		lstSer.add(new Service('',0,0,0,0,0,0));
		
		lstPackage.add(new SPackage(objSP1,0,0,lstSer,strPackageNumber));
    	return null;
    }
    
    public PageReference addMoreServices()
    {
    	String strPackageNumber = ApexPages.currentPage().getParameters().get('PkgNumber'); 
    	integer intI = Integer.valueOf(strPackageNumber);
    	
    	if(intI>0)
    	{
    		Service objSer = new Service();
			objSer.strServiceName = '';
			objSer.dbPrice = 0;
			objSer.intVolume = 0;
			objSer.dbCOGS = 0;
			objSer.dbMargin = 0;
			objSer.dbLow = 0;
			objSer.dbHigh = 0;
    		lstPackage[intI-1].lstService.add(objSer);
    		system.debug('llllllll'+lstPackage[intI-1].lstService.size());
    	}
       	return null;
    }
    
    public PageReference SavePricing()
    {
    	return null;
    }
    
    public PageReference showServiceBLP()
    {
		return null;
	}
    
    public List<SelectOption> getServiceNames() 
    {
		List<SelectOption> options = new List<SelectOption>();
		set<string> stService = new set<string>();
        options.add(new SelectOption('', '-None-'));
        stService.add('-None-');
        for(Service_Level__c sl : lstSL)
   		{
   			if(!stService.contains(sl.Id))
   			{
      			options.add(new SelectOption(sl.Id, sl.Name__c));
      			stService.add(sl.Id);
   			}
   		}       
	  	return options;
    }
    
    public List<SelectOption> getProfileAvailability() 
    {
		List<SelectOption> options = new List<SelectOption>();
        
   		Schema.DescribeFieldResult fieldResult = Service_Package__c.Profile_Availability__c.getDescribe();
   		List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
      
        options.add(new SelectOption('', '-None-'));
        for( Schema.PicklistEntry f : ple)
   		{
      		options.add(new SelectOption(f.getLabel(), f.getValue()));
   		}       
   		system.debug('........ '+options);
	  	return options;
    }
       
    public class SPackage
    {
		public Service_Package__c objSP 	{get;set;}
		public double dbSumLowPrice			{get;set;}
		public double dbSumHighPrice		{get;set;}
		public string strLabel				{get;set;}
		public List<Service> lstService		{get;set;}
		
		public Spackage()
		{
			
		}
		
		public SPackage(Service_Package__c sp, double low, double high, List<Service> lstS, string strLbl)
		{
			objSP = sp;
			dbSumLowPrice = low;
			dbSumHighPrice = high;
			lstService = lstS;
			strLabel = strLbl;
		}
    }
    
    public class Service
    {
		public String strServiceName	 {get;set;}
		public double dbPrice			 {get;set;}
		public integer intVolume	  	 {get;set;}
		public double dbCOGS		  	 {get;set;}
		public double dbMargin			 {get;set;}
		public double dbLow				 {get;set;}
		public double dbHigh			 {get;set;}
		
		public Service()
		{
			
		}
    	public Service(String SN, double price, integer vol, double cogs, double margin, double low, double high)
    	{
    		strServiceName = SN;
			dbPrice = price;
			intVolume = vol; 
			dbCOGS = cogs;
			dbMargin = margin;
			dbLow = low;
			dbHigh = high;
    	}
    }
}

<apex:page standardcontroller="Pricing2__c" extensions="Pricing_New">
	<apex:form >
		<apex:pageBlock title="Pricing" id="mainPB">
			<apex:pageblockSection columns="2">
				<apex:pageblocksectionitem >
					<apex:outputLabel value="Account" />
					<apex:inputfield value="{!Pricing2__c.AccountId__c}"  />
				</apex:pageblocksectionitem>
				<apex:pageblocksectionitem >
					<apex:outputLabel value="Number of Checks" />
					<apex:inputfield value="{!Pricing2__c.Checks__c}" onchange="showLowHighBLP()" required="true"/>
				</apex:pageblocksectionitem>
			</apex:pageblockSection>
			<br/>
			<apex:repeat value="{!lstPackage}" var="P"> 
				<apex:pageBlock title="{!P.strLabel}" >
					<apex:pageBlockSection columns="2">
						
						<apex:pageBlockSectionItem >
							<apex:outputLabel value="Profile Name" />
							<apex:inputText value="{!P.objSP.Profile_Name__c}" />
						</apex:pageBlockSectionItem>
						
						<apex:pageBlockSectionItem >
							<apex:outputLabel value="Profile Availability" />
							<apex:selectList value="{!P.objSP.Profile_Availability__c}" size="1">
								<apex:selectOptions value="{!ProfileAvailability}" />  
							</apex:selectList> 
						</apex:pageBlockSectionItem>
						
						<apex:pageBlockSectionItem >
							<apex:outputLabel value="Enable Package Pricing" />
							<apex:inputCheckbox value="{!P.objSP.Enable_Package_Pricing__c}" /> 
						</apex:pageBlockSectionItem>
						
						<apex:pageBlockSectionItem >
							<apex:outputLabel value="Add Maiden / Alias search" />
							<apex:inputCheckbox value="{!P.objSP.Add_Maiden_Alias_search__c}" /> 
						</apex:pageBlockSectionItem>
						
						<apex:pageBlockSectionItem >
							<apex:outputLabel value="Profile Price	" />
							<apex:inputText value="{!P.objSP.Profile_Price__c}" />
						</apex:pageBlockSectionItem>
						
						<apex:pageBlockSectionItem >
							<apex:outputLabel value="Maiden / Alias Price" />
							<apex:inputText value="{!P.objSP.Maiden_Alias_Price__c}" />
						</apex:pageBlockSectionItem>
						
						<apex:pageBlockSectionItem rendered="true">
							<apex:outputLabel value="BLP Low Level" />
							<apex:outputLabel value="{!P.dbSumLowPrice}" />
						</apex:pageBlockSectionItem>

						<apex:pageBlockSectionItem >
						</apex:pageBlockSectionItem>

						<apex:pageBlockSectionItem rendered="true">
							<apex:outputLabel value="BLP High Level" />
							<apex:outputLabel value="{!P.dbSumHighPrice}" />
						</apex:pageBlockSectionItem>
						
					</apex:pageBlockSection>
					<br/>
					
						<table width="100%" style="border-collapse:collapse;" cellpadding="4">
							<tr>
								<th width="25%" style="border-collapse:collapse;background-color:#8fc800;">
									<center>Service</center>
								</th>
								<th width="15%" style="border-collapse:collapse;background-color:#8fc800;">
									<center>Volume</center>
								</th>
								<th width="15%" style="border-collapse:collapse;background-color:#8fc800;">
									<center>Price</center>
								</th>
								<th width="15%" style="border-collapse:collapse;background-color:#8fc800;">
									<center>BLP Low Level</center>
								</th>
								<th width="15%" style="border-collapse:collapse;background-color:#8fc800;">
									<center>BLP High Level</center>
								</th>
								<th width="15%" style="border-collapse:collapse;background-color:#8fc800;">
									<center>Margin</center>
								</th>
							</tr>
							<apex:repeat value="{!P.lstService}" var="S">
								<tr>
									<td width="25%" style="border-collapse:collapse;background-color:#DCDCDC;">
										<center>
											<apex:selectList value="{!S.strServiceName}" size="1" onchange="showLowHighBLP()">
												<apex:selectOptions value="{!ServiceNames}" />
											</apex:selectList> 	
										</center>
									</td>
									<td width="15%" style="border-collapse:collapse;background-color:#DCDCDC;">
										<center>
											<apex:inputText value="{!S.intVolume}" onchange="showLowHighBLP()" />
										</center>
									</td>
									<td width="15%" style="border-collapse:collapse;background-color:#DCDCDC;">
										<center>
											<apex:inputText value="{!S.dbPrice}" onchange="showLowHighBLP()" />
										</center>
									</td>
									<td width="15%" style="border-collapse:collapse;background-color:#DCDCDC;">
										<center>
											<apex:outputLabel value="{!S.dbLow}" />
										</center>
									</td>
									<td width="15%" style="border-collapse:collapse;background-color:#DCDCDC;">
										<center>
											<apex:outputLabel value="{!S.dbHigh}" />
										</center>
									</td>
									<td width="15%" style="border-collapse:collapse;background-color:#DCDCDC;">
										<center>
											<apex:outputLabel value="{!S.dbMargin}" />
										</center>
									</td>
								</tr>
							</apex:repeat>
						</table>
						<br/>
						<center><Button onclick="addServices('{!P.strLabel}')" >Add More Services</Button></center>	
				</apex:pageBlock>
			</apex:repeat>
			<apex:commandButton value="Add More Package" action="{!addMorePackages}" />
			<apex:pageblockButtons >
				<apex:commandButton value="Save Pricing" action="{!SavePricing}" />
			</apex:pageblockButtons>
		</apex:pageBlock>
		<apex:actionFunction name="showServiceBLP" action="{!showServiceBLP}" rerender="mainPB" />
		<apex:actionFunction name="addMoreServices" action="{!addMoreServices}" rerender="mainPB" >
			<apex:param name="PkgNumber" value="" />
		</apex:actionFunction>
	</apex:form>
	
	<script>
		function showLowHighBLP()
		{
			showServiceBLP();
		}
		
		function addServices(myPackage)
		{
			var pac = myPackage;
			var para = pac.substring(8);
			addMoreServices(para);
		}
	</script>
	
</apex:page>

 Pricing Image

i need to create an email approval process for case object where the approver is the case contact. also need to process the contact's email reply to approve(closure as field update) or reject the case. Is it possible as i've read that only sf user can be an approver?? 

Is it possible to add picklist values (the metadata) using apex and a VF page?

 

I have a VF page that displays the lead source picklist values from the contact object on a VF page:

 

public List<SelectOption> getLeadSourceNames()
	{
  		List<SelectOption> options = new List<SelectOption>();
        
   		Schema.DescribeFieldResult fieldResult = Contact.LeadSource.getDescribe();
   		
   		List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
        
   		for( Schema.PicklistEntry f : ple)
   		{
      		options.add(new SelectOption(f.getLabel(), f.getValue()));
   		}       
   		return options;
	}

 

On my VF page, I display the selectList and if the user select 'Other' it will open a text field where they can enter a new value and save.  It saves the value to the record, but doesn't add the new value to the actual picklist value metadata.  Is there a ay to do this?

 

Here is my VF page:

 

<apex:page standardController="Contact" extensions="DynamicPicklist" sidebar="false" >
	<apex:form >
		<apex:sectionHeader title="Dynamic Picklist" subtitle="Reusable code"/>
		<apex:pageblock >
			<apex:pageBlockSection title="Dynamic picklist" columns="1">      
				<apex:pageblocksectionItem >          
					<apex:outputlabel value="Lead Source" for="values" />          
					<apex:selectList value="{!leadSource}" size="1" id="values">              
						<apex:actionSupport event="onchange" reRender="newvalue" />              
						<apex:selectOptions value="{!leadSourceNames}"/>          
					</apex:selectList>      
				</apex:pageblocksectionItem>                                                  
				<apex:outputpanel id="newvalue">             
					<apex:outputpanel rendered="{!leadSource == 'Other'}">             
						<div style="position:relative;left:75px;">                               
							<apex:outputlabel value="New value" for="newval" />                  
							<apex:inputText value="{!newpicklistvalue}" id="newval"/>                  
							<apex:commandbutton action="{!saverec}" value="Add!"/>             
						</div>             
					</apex:outputpanel>          
				</apex:outputpanel>               
			</apex:pageblocksection>
		</apex:pageblock>
	</apex:form>
</apex:page>

 

Here is the saverec method:

 

public void saverec(){   
	con.LeadSource = newpicklistvalue;
	update con; 	
}

 

I would like to have the ability to add new picklist values from the VF page.  Is it possible using the metadata API?  If so, how?  I can't find any sample code that explains how to accomplish this.

 

Thanks for any help.

1. The scoring_pick_list__c field is not displayed when I pick the 'Picklist' value in the question type.

2. I tried replacing it with a pageBlockSectionItem with outputLabel and inputLabel and re-rendering the child components, it still does not work.

3. If I wrap inputField or the pageBlockSectionItem (from #2) in an outputPanel, it works, but them the styling is all messed up, since it is not a direct child of pageBlockSection.

 

 

<apex:page standardController="Survey_Question__c" >
<apex:form >
<apex:pageBlock mode="edit">
<apex:pageBlockSection title="Question" id="question" >
<apex:pageBlockSectionItem >
<apex:outputLabel value="{!$ObjectType.Survey_Question__c.fields.Question_Type__c.label}" for="qtype"/>
<apex:inputField value="{!Survey_Question__c.Question_Type__c}" required="true" id="qtype">
<apex:actionSupport event="onchange" rerender="spicklist"/>
</apex:inputField>
</apex:pageBlockSectionItem>
<apex:inputField value="{!Survey_Question__c.Scoring_Pick_List__c}" rendered="{!Survey_Question__c.Question_Type__c = 'Picklist'}" id="spicklist"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

I would like to create a trigger that creates a record. I have created a wizard where an outside user creates a record. I would like a trigger to run when the user saves the record they created through the wizard. I would like the trigger to search a different objects records for similar email adresses. After doing that if no similar addresses are found I want the trigger to create a new record. Here is what I have so far.  Here is the error that I get:

 

Apex trigger ReferralTrigger caused an unexpected exception, contact your administrator: ReferralTrigger: execution of AfterUpdate caused by: System.FinalException: Record is read-only: Trigger.ReferralTrigger: line 22, column 17

 

 

trigger ReferralTrigger on Referral__c (after insert, after update) {
    
    List<Referee__c> Ree = [SELECT Referee_Email__c, Name, Id FROM Referee__c];
    Referee__c newRee = new Referee__c();
    Boolean add = false;
    
        for(Referral__c Rf : trigger.new){
            for(Referee__c Re : Ree){
                if(Rf.Your_Email__c != Re.Referee_Email__c || Re == null) add = true;
            }
        }
        if(add == true){
            for(Referral__c Ref : trigger.new){
                newRee.Name = Ref.Your_Name__c;
                newRee.Referee_Email__c = Ref.Your_Email__c;
                newRee.Referee_Phone__c = Ref.Your_Cell_Phone__c;
                newRee.Referee_City__c = Ref.Your_City__c;
                newRee.Referee_State__c = Ref.Your_State__c;
        
                insert newRee;
            
                Ref.Referee__c = newRee.Id; 
            }
        }
}

 

 

Hi,

I have created a custom controller and an VF page to import records for my Custom Object Username.

But the issue is I'm not able to import all records from the template.

Only the first record is getting imported.

 

VF page:

 

 

public class UsernameFileUploader 
{
    
public string nameFile{get;set;}
    public Blob contentFile{get;set;}
    String[] filelines = new String[]{};
    List<Username__c> urnmtoupload;
    
    public Pagereference ReadFile()
    {
        nameFile=contentFile.toString();
        filelines = nameFile.split('\n');
        urnmtoupload = new List<Username__c>();
        for (Integer i=1;i<filelines.size();i++)
        {
            String[] inputvalues = new String[]{};
                inputvalues = filelines[i].split(',');  
                Username__c a = new Username__c();
                a.Username__c = inputvalues[0];
                a.Contact_Name__c = inputvalues[1];       
                a.Phone__c = i=integer.valueof(inputvalues[2]);
                a.Email_Address__c = inputvalues[3];
                a.Billing_Account__c = inputvalues[4];
                a.View__c = inputvalues[5];
                a.Bill_Code__c = inputvalues[6];
                if (inputvalues[7] == 'True')
                {a.Lookup__c = True;}
                else
                {a.Lookup__c = False;}
                
                if (inputvalues[8] == 'True')
                {a.Summary__c = True;}
                else
                {a.Summary__c = False;}
                
                if (inputvalues[9] == 'True')
                {a.View_Score__c = True;}
                else
                {a.View_Score__c = False;}
                
                if (inputvalues[10] == 'True')
                {a.Report__c = True;}
                else
                {a.Report__c = False;}
                
                if (inputvalues[11] == 'True')
                {a.Draft__c = True;}
                else
                {a.Draft__c = False;}
                
                if (inputvalues[12] == 'True')
                {a.Order__c = True;}
                else
                {a.Order__c = False;}

                if (inputvalues[13] == 'True')
                {a.Pass_Fail__c = True;}
                else
                {a.Pass_Fail__c = False;}
                
                
                a.Additional_Notes__c = inputvalues[14];


            urnmtoupload.add(a);
        }
        try{
        insert urnmtoupload;
        }
        catch (Exception e)
        {
            ApexPages.Message errormsg = new ApexPages.Message(ApexPages.severity.ERROR,'An error has occured. Please check the template or try again later');
            ApexPages.addMessage(errormsg);
        }    
        return null;
    }
    
    public List< Username__c> getuploadedUsernames()
    {
        if (urnmtoupload!= NULL)
            if (urnmtoupload.size() > 0)
                return urnmtoupload;
            else
                return null;                    
        else
            return null;
    }            
}

 

 

 

Controller:

 

 

 

<apex:page Controller="UsernameFileUploader" >      
<apex:form >

<apex:pageBlock title="Upload data from CSV file">
             <center>
              <apex:inputFile value="{!contentFile}" filename="{!nameFile}" /> <apex:commandButton action="{!ReadFile}" value="Upload File" id="theButton" style="width:70px;"/>
              <br/> <br/> <font color="red"> <b>Note: Please use the standard template to upload Usernames. <a href="{!URLFOR($Resource.UserNameUploadTemplate)}" target="_blank"> Click here </a> to download the template. </b> </font>
             </center>  
      <apex:pageblocktable value="{!uploadedUsernames}" var="acc" rendered="{!NOT(ISNULL(uploadedUsernames))}">
          <apex:column headerValue=" Username ">
              <apex:outputField value="{!acc.Username__c}"/>
          </apex:column>
          <apex:column headerValue=" Contact Name ">
              <apex:outputField value="{!acc.Contact_Name__c }"/>
          </apex:column>
          <apex:column headerValue="Phone">
              <apex:outputField value="{!acc.Phone__c  }"/>
          </apex:column>
          <apex:column headerValue=" Email Address">
              <apex:outputField value="{!acc.Email_Address__c}"/>
          </apex:column>
          <apex:column headerValue=" Billing Account ">
              <apex:outputField value="{!acc.Billing_Account__c}"/>
          </apex:column>
          <apex:column headerValue="View">
              <apex:outputField value="{!acc.View__c }"/>
          </apex:column>
<apex:column headerValue=" Bill Code">
              <apex:outputField value="{!acc.Bill_Code__c }"/>
          </apex:column>
<apex:column headerValue="Lookup">
              <apex:outputField value="{!acc.Lookup__c }"/>
          </apex:column>
<apex:column headerValue="Summary">
              <apex:outputField value="{!acc.Summary__c  }"/>
          </apex:column>
<apex:column headerValue="View Score">
              <apex:outputField value="{!acc.View_Score__c }"/>
          </apex:column>
<apex:column headerValue=" Report">
              <apex:outputField value="{!acc.Report__c }"/>
          </apex:column>
<apex:column headerValue=" Draft">
              <apex:outputField value="{!acc.Draft__c }"/>
          </apex:column>
<apex:column headerValue=" Order">
              <apex:outputField value="{!acc.Order__c }"/>
          </apex:column>
<apex:column headerValue=" Pass / Fail">
              <apex:outputField value="{!acc.Pass_Fail__c }"/>
          </apex:column>

      </apex:pageblocktable> 
      </apex:pageBlock>       
   </apex:form>
</apex:page>

 

 

 

Hi,

 

I have configured a field dependency in my Case Object, but when i put in my VF page it doesn't work the way it does in the standard page layout. Both the fields show all picklist values. No dependency is working.

 

Following is my VF code to include those two fields in the VF page.

 

Controlling Field: Department

Dependent Field : Case Reason

 

<apex:inputField required="true" value="{!Case.Department__c}"/>
         <apex:inputField required="true" value="{!Case.Case_Reason2__c}">

 

 

I have the following QueryString:

 

String QueryString = 'SELECT Id, Name, AccountId, Account.Name, Phone, Email, OwnerId, Owner.Alias, Active__c, Broker_Number__c, Broker_Number__r.Name, Account.Firm__c FROM Contact WHERE' + QueryActive;

 

 

I need to loop through the results and populate a list:

 

for(sObject o : Database.query(QueryString))
{
	SearchContact result = new SearchContact((Id)o.get('Id'),(String)o.get('Name'),(Id)o.get('AccountId'),(String)o.get('Account.Name'),(String)o.get('Phone'),(String)o.get('Email'),(Id)o.get('OwnerId'),(String)o.get('Owner.Alias'),(Boolean)o.get('Active__c'),(Id)o.get('Broker_Number__c'),(String)o.get('Broker_Number__r.Name'),(String)o.get('Account.Firm__c'));
	ContactResults.add(result);
}

 

 

I keep getting an error that 'Account.Name' is not a valid field for Contact. How am I supposed to retrieve the Account Name, Owner Alias, etc.?

 

Thanks.

  • March 01, 2011
  • Like
  • 0

I could crack logging a trigger email as an activty but it sends the email twice and it also sends the email to contact email id too??

I just wanna send an email to CLient_Email_Address__c

 

Any idea?

 

 

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
    String[] toAddresses = new String[] {c.CLient_Email_Address__c};
    mail.setToAddresses(toAddresses);
    mail.setTargetObjectId(c.ContactId);
    mail.setwhatId(c.Id);
    EmailTemplate et = [SELECT id FROM EmailTemplate WHERE developerName = 'Completion_Notification'];
    mail.setTemplateId(et.id);
    mail.saveAsActivity = true;
    Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });

I am trying to select the userrole name of the user who created the case by following code but not able to get it.

It gives me an error in line 3.

 

for (Case c:accs){
User thisUser = [ select Id FROM User where Id =:c.CreatedById];
UserRole userrolle = [ select Id FROM UserRole where Id =:thisUser.UserRoleId];
string rolename = userrolle.Name;

-----------------------------------

-------------------------------

-----


}