• ezhil_k
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 43
    Questions
  • 42
    Replies
Am using the follwing in the vf page:
<apex:outputText value="{!con.Alert__c}" escape="false"/>

But the image is not appearing properly:

It is appearing like this:
User-added image

Please help me to resolve this.
I want to send email to contacts according to their preffered language through batch apex:.

Following is my code in batch class:
//
 EmailTemplate emailTemplate =[select Id from EmailTemplate where DeveloperName='testinh_vf_template'];
     
 Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                String[] toAddresses = new String[] {newcon.Email};
                mail.setToAddresses(toAddresses);
               // mail.setSubject('CASE MESSAGE' );
                //mail.sethtmlBody(templateText);
                mail.settemplateid(emailTemplate.id);
                system.debug('template:' +emailTemplate.id);
                mail.setTargetObjectId(newcon.id);
                mails.add(mail);


 testinh_vf_template Vf email:

<messaging:emailTemplate subject="Tesing" recipientType="Contact" relatedToType="Contact" 
language="{!RelatedTo.language_code__c}">
<messaging:htmlEmailBody >
<html> 
<tr>
{!$Label.Email_Label}
</tr>

</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>

Issue am facing:
When i run the batch class, i am getting email in english only .

When i try to to test by sending email through workflow email alert, email is recieved in contact's language.

Am i missing something in batch apex..please help me to resolve this.
<messaging:emailTemplate subject="Testing" recipientType="Contact" relatedToType="Contact"  language="{!recipient.Langua__c}" >               
   
  <messaging:htmlEmailBody >       
    <html>
        <body>
        <p>{!$Label.Email_Label} </p>
      
        </body>
    </html>
    </messaging:htmlEmailBody>

</messaging:emailTemplate>

When i try to test it, Mail is not getting delivered.'

I doubt as that it is not taking values from the recipientType="Contact"

Please help me on this.
I have an user 'A' who wants to import data into salesforce for a custom object 'B'. 

scenarios is,

The user should is not a Admin.
He should be able to import data only to custom object 'B'.

Is it possible? if so what permisions should the user must have?

Please help me on this.





Always the value of acceptTerms is showing as false even the check box is checked in the page.

Please help me out to solve this.

vf Page:

<apex:inputCheckbox value="{!acceptTerms}"/>

controller:

public  class controller {

Public boolean accepTerms;

Public controller(){
accepTerms=false;

}

if(!acceptTerms)
apex.addmessage('   ' );

}


Hi ,

Am getting the following error when deploing from sandox to production through changeset.
Please help me in resolving this.

Error:

Case controller :Invalid type: Component.Support.CaseFeed

caseview page :Unknown property 'CaseStandardController.casePage'

<apex:page standardController="Case" extensions="casecontroller" showHeader="true" sidebar="false"
    action="{!redirect}">  
    <apex:dynamicComponent componentValue="{!casePage}" rendered="{!isCaseFeedEnabled}"/>
 <apex:outputpanel rendered=" " >
</apex:page>

public with sharing class casecontroller {

//
//

   
public Component.Apex.OutputPanel getCasePage(){
        Component.Apex.OutputPanel panel = new Component.Apex.OutputPanel();
        Component.Support.CaseFeed caseFeed = new Component.Support.CaseFeed();
        caseFeed.caseId = c.Id;
        panel.childComponents.add(caseFeed);
        return panel;

}


}

I want to create a list for eact pick list value,

Some thing lik this below

Schema.DescribeFieldResult  ob = object__C.Type__c.getDescribe();
     List<Schema.PicklistEntry> ob1 = ob.getPicklistValues();
      for(integer i=0;i<ob1.size();i++){
      string listname=TokenState[i];
       List<Token__C>listname+'list'= new List<Token__C>();
      

This code is errored out.

Please guide me how to proceed?.
        
Need to get code coverage .Test class is getting passed. But it is not calling ther method
"
global void execute(Database.BatchableContext bc, List<case> caselist) ". Coverage is only 45%.

Please suggest me , how to get the 75%%coverage..
Class:


global class  BatchUpdateCase implements Schedulable, Database.Batchable<sObject> {
    public void execute(SchedulableContext ctx) {
        run();
    }

    public static void run() {
        Database.executeBatch(new BatchUpdateCase());
    }

     global Database.QueryLocator start(Database.BatchableContext bc)
    {
       
        return Database.getQueryLocator([select id,SuppliedEmail__c from Case Where SuppliedEmail__c = 'km@gmail.com' AND Test_Record__c = false]); 
    }

global void execute(Database.BatchableContext bc, List<case> caselist){
    
      for(case cas:caselist)
      {
          cas.Test_Record__c=TRUE;
      System.debug('### Test Record Updated');
      }
      
       update caselist;
}
    global void finish(Database.BatchableContext BC) {
      
    }
}



Test Class:

@isTest(SeeAllData=true)
public class  batchUpdateCaseTestClass {

    private static testMethod void testBatch() {
   
        Case cas=new Case();
        cas.SuppliedEmail__c = 'km@gmail.com' ;
        cas.Test_Record__c = false;

            insert cas;

         Test.startTest();

        BatchUpdateCase.run();

        Test.stopTest();

     
      
    }

   
}
@Future (callout=true)  
    public static void futuremethod(id conid){ 
    
      Httprequest request = new Httprequest();
      request.setMethod('GET');
      request.setEndpoint(LoopbackSite__c.getOrgDefaults().loopbackEndpoint__c +'/Self?conid='+conid);
      Httpresponse response = new Http().send(request); 
  }     

I want to make a inactive user to active.

 

Is it possible to query on User object which is having n number of inactive users, and get a particular user and make active?

i need to calculate the responsiveness of the ticket (first response)

 

Status change - case created time(Date /time Opened)=Responsiveness.

 

Date/time opened-i want to track the tickets created between (monday to thursday 8 am -4pm)

 

Please give me some ideas to calculate..

  • September 28, 2013
  • Like
  • 0

i need to calculate the responsiveness of the ticket

(first response)Status change - case created time(Date /time Opened)=Responsiveness.

 

Date/time opened-i want to track the tickets created between (monday to thursday 8 am -4pm)

 

Please give me some ideas..

 

 

 

  • September 27, 2013
  • Like
  • 0

Apart from setting tab visibilities in "Profiles", Is there any other way to set the visibilities?

 

  • September 24, 2013
  • Like
  • 0

Relationship betwwen account , contact and user in salesforce..

 

please provide me a sample code, which bind all these..

Test method failed...

Am getting null pointer exception in  test method where i cant get the value  info.getContact().id;

 

Please guide me for a solution..

 

public with sharing class CurrentUser {

  public CurrentUser() {    
       User u = [select Id, ContactId, UserType from User where Id = :Userinfo.getUserId()];

}
}

 

 

 

      public  class CreateAcct {
public CreateAcc(){
   accountID = '';
   account = new account();
 
 }
 Public void JoinAcc(){
list<account> acclist = new list<account>();
acclist = [select id,name,BillingCountry,BillingState,Account_Type__c,Account_ID__c from account where Account_ID__c = :accountID];

}


Public void Submit(){
 contact con=new contact();
 CurrentUser info = new CurrentUser ();
 system.debug('contact id:' + info.getContact().id);


 ComReqtInfo__c comInfo = new ComReqInfo__c();
 comInfo.name = account.name;
 comInfo.Accountid__c=account.id;
 comInfo.Contactid__c=info.getContact().id;
  
 companyInfo.status__c='RequestPending';
 insert comInfo ;

}

 

 

 

 test Method:

 

@isTest
private class CreateAccTest{

 static testMethod void CorrectAccount () {    
  account acc = new account(name='dummy',Account_Type__c='dummy',BillingCountry='dummy',BillingState='dummy');  
 insert acc;    
 account acc1= [select id,Account_ID__c from account where id=:acc.id]; 
CreateAcc  con1 = new CreateAcc() ; 
con1.accountID = acc1.id ; 
 
con1.submit(); }
}
}

 

 

 

String AppNumber = lastApp.Name
Map<String, String> value = new Map<String, String>();
  value.put('{#AppNumber}', AppNumber);

 Agreement template = new Agreementtemplate();
                template.init(lastProg.Thank_You_Page__c, lastProg.Id, 'Prog__c', value);

 

String AppNumber = lastApp.Name
Map<String, String> value = new Map<String, String>();
  value.put('{#AppNumber}', AppNumber);

 Agreement template = new Agreementtemplate();
                template.init(lastProg.Thank_You_Page__c, lastProg.Id, 'Prog__c', value);

 

 

 

hi all.

Might be a silly question.. what does that idlist contains? all the records rec,rec1,rec2?

 

Record__c rec= new Record__c(contid__c=con.id,accid__c=acc1.id);
    insert coinfo;
 Record__c rec1= new Record__c(contid__c=con.id,accid__c=acc1.id);
    insert coinfo;
Record__c rec2= new Record__c(contid__c=con.id,accid__c=acc1.id);
    insert coinfo;   

 

string idlist =rec.id+','+rec1.id+','+rec2.id;

 

ApexPages.currentPage().getParameters().put('recordid', idlist);

idstring= apexpages.currentpage().getparameters().get('recordid');
 requestStatus =apexpages.currentpage().getparameters().get('request');
 } 
 Public pagereference ChangeAccount(){
 try{
List<string> recordIdList= idstring.split(',');
info=[select id,accountid__c,contactid__c,status__c,rejected__c from CompanyRequestInfo__c  where id in: recordIdList];

idstring= apexpages.currentpage().getparameters().get('recordid');
 requestStatus =apexpages.currentpage().getparameters().get('request');
 } 
 Public pagereference ChangeAccount(){
 try{
List<string> recordIdList= idstring.split(',');
info=[select id,accountid__c,contactid__c,status__c,rejected__c from CompanyRequestInfo__c  where id in: recordIdList];

Always the value of acceptTerms is showing as false even the check box is checked in the page.

Please help me out to solve this.

vf Page:

<apex:inputCheckbox value="{!acceptTerms}"/>

controller:

public  class controller {

Public boolean accepTerms;

Public controller(){
accepTerms=false;

}

if(!acceptTerms)
apex.addmessage('   ' );

}


Hi ,

Am getting the following error when deploing from sandox to production through changeset.
Please help me in resolving this.

Error:

Case controller :Invalid type: Component.Support.CaseFeed

caseview page :Unknown property 'CaseStandardController.casePage'

<apex:page standardController="Case" extensions="casecontroller" showHeader="true" sidebar="false"
    action="{!redirect}">  
    <apex:dynamicComponent componentValue="{!casePage}" rendered="{!isCaseFeedEnabled}"/>
 <apex:outputpanel rendered=" " >
</apex:page>

public with sharing class casecontroller {

//
//

   
public Component.Apex.OutputPanel getCasePage(){
        Component.Apex.OutputPanel panel = new Component.Apex.OutputPanel();
        Component.Support.CaseFeed caseFeed = new Component.Support.CaseFeed();
        caseFeed.caseId = c.Id;
        panel.childComponents.add(caseFeed);
        return panel;

}


}

I want to create a list for eact pick list value,

Some thing lik this below

Schema.DescribeFieldResult  ob = object__C.Type__c.getDescribe();
     List<Schema.PicklistEntry> ob1 = ob.getPicklistValues();
      for(integer i=0;i<ob1.size();i++){
      string listname=TokenState[i];
       List<Token__C>listname+'list'= new List<Token__C>();
      

This code is errored out.

Please guide me how to proceed?.
        
Need to get code coverage .Test class is getting passed. But it is not calling ther method
"
global void execute(Database.BatchableContext bc, List<case> caselist) ". Coverage is only 45%.

Please suggest me , how to get the 75%%coverage..
Class:


global class  BatchUpdateCase implements Schedulable, Database.Batchable<sObject> {
    public void execute(SchedulableContext ctx) {
        run();
    }

    public static void run() {
        Database.executeBatch(new BatchUpdateCase());
    }

     global Database.QueryLocator start(Database.BatchableContext bc)
    {
       
        return Database.getQueryLocator([select id,SuppliedEmail__c from Case Where SuppliedEmail__c = 'km@gmail.com' AND Test_Record__c = false]); 
    }

global void execute(Database.BatchableContext bc, List<case> caselist){
    
      for(case cas:caselist)
      {
          cas.Test_Record__c=TRUE;
      System.debug('### Test Record Updated');
      }
      
       update caselist;
}
    global void finish(Database.BatchableContext BC) {
      
    }
}



Test Class:

@isTest(SeeAllData=true)
public class  batchUpdateCaseTestClass {

    private static testMethod void testBatch() {
   
        Case cas=new Case();
        cas.SuppliedEmail__c = 'km@gmail.com' ;
        cas.Test_Record__c = false;

            insert cas;

         Test.startTest();

        BatchUpdateCase.run();

        Test.stopTest();

     
      
    }

   
}

Apart from setting tab visibilities in "Profiles", Is there any other way to set the visibilities?

 

  • September 24, 2013
  • Like
  • 0

Relationship betwwen account , contact and user in salesforce..

 

please provide me a sample code, which bind all these..

String AppNumber = lastApp.Name
Map<String, String> value = new Map<String, String>();
  value.put('{#AppNumber}', AppNumber);

 Agreement template = new Agreementtemplate();
                template.init(lastProg.Thank_You_Page__c, lastProg.Id, 'Prog__c', value);

hi all.

Might be a silly question.. what does that idlist contains? all the records rec,rec1,rec2?

 

Record__c rec= new Record__c(contid__c=con.id,accid__c=acc1.id);
    insert coinfo;
 Record__c rec1= new Record__c(contid__c=con.id,accid__c=acc1.id);
    insert coinfo;
Record__c rec2= new Record__c(contid__c=con.id,accid__c=acc1.id);
    insert coinfo;   

 

string idlist =rec.id+','+rec1.id+','+rec2.id;

 

ApexPages.currentPage().getParameters().put('recordid', idlist);

idstring= apexpages.currentpage().getparameters().get('recordid');
 requestStatus =apexpages.currentpage().getparameters().get('request');
 } 
 Public pagereference ChangeAccount(){
 try{
List<string> recordIdList= idstring.split(',');
info=[select id,accountid__c,contactid__c,status__c,rejected__c from CompanyRequestInfo__c  where id in: recordIdList];

pPublic CreateAcc(){
   accountID = '';
   account = new account();
 }
 
 Public void JoinAcc(){
  If (accountID.trim()!=''){
  list<account> acclist = new list<account>();
  acclist = [select id,name,BillingCountry,BillingState,Account_Type__c,Account_ID__c from account where Account_ID__c = :accountID];
account =acclist[0];
   
 
 }

I have Vf page with two buttons, Accept and Decline, and fields like Name Account ID, mobile number,If Accept  button is clicked, i want the details from vf page to be added as a contact in AccountID mentioned.

I have Vf page with two buttons, Accept and Decline, and fields like Name Account ID, mobile number,If Accept  button is clicked, i want the details from vf page to be added as a contact in AccountID mentioned.

when a user enter values in  fields in the form and save ,it is sending  a link in email to the approver. when the approver clicks that link,it should redirect him to the detail page of the corresponding record to approve.How to create the "Link " ?