• Pradeep Raju
  • NEWBIE
  • 70 Points
  • Member since 2013
  • Deloitte

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 1
    Likes Given
  • 12
    Questions
  • 25
    Replies
How to enable Internet Explorer's compatibility mode turned on using java script from VF Page ??
Hi All,

I have a requirement to populate questions with radio buttons Yes or No & capture anwers to those values in the controller by iterating over list.Can anyone please provide info on how to do it ??

Regards,
Pradep.
Can anyone help me on fetching the current opened primary tab id n service cloud console.I'm using like this & this will called on click of a button in window.open(.....)

<apex:includeScript value="/support/console/25.0/integration.js" />
    <script type="text/javascript">
        function buttonClick() {
            alert('Testing');
            alert(sforce.console.getFocusedPrimaryTabId(showTabId));
        }
        var showTabId = function showTabId(result) {
            alert('Tab IDs: ' + result.ids);
        };
    </script>
What is the maximum size of attachment that we can have in Apex Callouts ??
Can anybody list the impact of having Domains in Service Cloud Console ???
Can anybody list the impact of having Domains in Service Cloud Console ???
How to get Custom Interaction Log record Id in the URL of Service Cloud Console App so that it can be used in standardController of Case Object??
We customized standard interaction log with a custom VF page & standard case with custom page.These 2 objects Case & Interaction are related via a Junction Custom Object.The Problem is we can associate a interaction with multiple cases based on ID in the URL but we cant able to do other way around. Can anybody suggest some solutions ??
Can we override standard Save & New , Save & Close buttons in Case Edit Page ???
Hi All,

If i select a date in datefield while inserting/updating record.I want a field to populated with +2 yrs of selected date.

Can we achieve this with formula field ??
How to get Custom Interaction Log record Id in the URL of Service Cloud Console App so that it can be used in standardController of Case Object??
How to enable Internet Explorer's compatibility mode turned on using java script from VF Page ??
Hi All,

I have a requirement to populate questions with radio buttons Yes or No & capture anwers to those values in the controller by iterating over list.Can anyone please provide info on how to do it ??

Regards,
Pradep.
What is the maximum size of attachment that we can have in Apex Callouts ??
I recently upgraded to Windows 8.1, and am now having issues with the Force.com IDE. When I select Force.com->Add/remove metadata components, I'm not able to see any custom field child component in the Objects-Custom component. Does anyone have any ideas on what is causing the issue?
User-added image
Can anybody list the impact of having Domains in Service Cloud Console ???
Can we override standard Save & New , Save & Close buttons in Case Edit Page ???
Hi ,

I was assigned to write a  Test class , where i was unable to cover the code coverage for the entire class i can able to pass the test class, but unable to cover the code coverage

Here is my Test class

@isTest(SeeAllData=true)
public class Test_CreateContactController
{

private static testMethod void TestCreateContactController()
  {
        
          Set<Id> sObjectIds = new Set<Id>(); 
          Set<id> sObjectrecIds = new Set<id>();
         set<id> campusrecid = new set<id>();
          List<id> acids = new List<id>();         
           List<RecordType> RecordTypeids = new List<RecordType>();        
         contact con=new contact();
         con.Lastname='Vishalg';
         con.Email='gaur@deloitte.com';
         con.FirstName='Gaur';
         con.Title='SiteDemo';
         con.Phone='7875434250';
        //con.recordtypeid=RecordTypeids[0].id;       
       // con.Recruiting_Event__c=objRecEvent.ID;    
        
         insert con;
        
           List<Event_Registration__c> ObjEvent = [Select id,Name,Contact__c,Recruiting_Event__c,Attended__c,Attending__c  from Event_Registration__c where id =:sObjectIds order by id limit 10]; 
            if (ObjEvent.size() > 0)
            {
           
             ObjEvent[0].Attended__C = true;
            ObjEvent[0].Attending__C = true;
             update ObjEvent;
            } 
           
            
              Recruiting_Event__c objRecEvent =  new Recruiting_Event__c();// [SELECT id,name,Location__c,Season__c,Account__c,Room__c,Status__c,Start_Date__c,End_Date__c FROM Recruiting_Event__c  limit 1];
               objRecEvent.name='Madhava Palla Event';
             objRecEvent.Season__c='Winter 2014';
              objRecEvent.Account__c='001R000000oYU5K';
              objRecEvent.Start_Date__c=system.today()-1;        
              objRecEvent.End_Date__c=system.today()+1;
               insert objRecEvent; 
             
               //List<Account> school = new List<Account>(); 
               //school=[Select id,Name from Account where id in :acids order by Name];  
              //insert school;
             
            List<Account> school = new List<Account>();
            //school.Name='001R000000oYU5K';
            //insert school;
                 


      ApexPages.StandardController sc = new ApexPages.StandardController(con);   
       CreateContactController createCon = new CreateContactController();  
           
       PageReference pageRef = Page.newregistration;
       Test.setCurrentPage(pageRef);
     
            
     createCon.displaySearchResults = true;
     createCon.selectedValue = '';
     createCon.schoolName ='';
     createCon.emailc ='';
     createCon.closePopup();
     createCon.getDisplaypblock();
    createCon.getschoollist();
    createCon.showPopup();
    createCon.cancel();
    createCon.getschoollist();     
    createCon.incrementCounter();
    createCon.displayPopUp = true;
      createCon.displaySearchResults = false;
     
     }

}

Here is the Class that i was to write the Test Class

public class CreateContactController
{
   public PageReference closePopup() {
        displayPopup = false;
        return null;
    }
    public boolean displayPopUp { get; set; }
    public PageReference showPopup() {
        displayPopup = true;
        return null;
    }
    public String getDisplaypblock() {
        return null;
    }
    public string schoolname{get;set;}
    public string emailc{get;set;}
    public Contact con{get; set;}
    public List<Contact> objContact {get;set;}
    public Event_Registration__c ObjEvent{get;set;}
    public List<Recruiting_Event__c> objRecEvent{get;set;}
    public Recruiting_Event__c ObjAccountRec{get;set;}
    public Boolean displaySearchResults{get;set;}
    public Recruiting_Event__c newrecevent{get;set;}
    public String selectedValue {get
    {
        if(selectedValue <> null && selectedValue <> '')
        {
            return selectedValue ;
        }
        else{
            selectedValue = '';
            return selectedValue ;
        }
    } set;}
    public List<id> acids = new List<id>();
    public List<Recruiting_Event__c> recevents= new List<Recruiting_Event__c>();
    public List<Account> school = new List<Account>();
    public List<Contact> user=new List<Contact>();
    public CreateContactController(ApexPages.StandardController controller) {
    newrecevent = new Recruiting_Event__c();
    this.newrecevent =(Recruiting_Event__c)controller.getRecord();
    con = new contact();
    }
    public PageReference Cancel() {
        return null;
    }
public String getschoollist() {
        return schoolname;
    }
    public CreateContactController()
    {
        con=new Contact ();
        ObjAccountRec = new Recruiting_Event__c();      

}
   public List<SelectOption> schoollist
    {
        get
        {   recevents= [Select Account__c,Name From Recruiting_Event__c];
            schoollist = new List<SelectOption>();
         for(Recruiting_Event__c temp : recevents)
            {  

                acids.add(temp.Account__c);
            }
         school=[Select id,Name from Account where id in :acids order by Name];  
         schoollist.add(new selectOption('--None--','--None--'));
         for(Account temp1: school)
         {
        schoollist.add(new SelectOption(temp1.Id,temp1.Name));
         }  
         system.debug('shcooltypename1'+schoolname);
        return schoollist;
                }
        set;
    }
public PageReference incrementCounter() {
        schoolname=getschoollist();
        displaySearchResults=true;
        date Next = system.today()+2;
        date cnow = system.today();
        date Last = system.today()-2;
        system.debug('systemNext'+Next);
        system.debug('systemLast'+Last);
        objContact=[SELECT id,name,email from contact where email=:con.Email limit 2];
        objRecEvent=[SELECT id,name,Location__c,Season__c,Account__c,Room__c,Status__c,Start_Date__c,End_Date__c FROM Recruiting_Event__c  WHERE Account__c =:selectedValue and Start_Date__c >=:Last and Start_Date__c <=:Next and Status__c<>'Completed'];     
        set<id> recids = new set<id>();
        set<id> campusrecid = new set<id>();
        List<RecordType> RecordTypeids = new List<RecordType>();
        RecordTypeids =[select id,name from RecordType where sobjecttype = 'Contact' and name='campus' limit 1];
        con.recordtypeid=RecordTypeids[0].id;
        con.Accountid=objRecEvent[0].Account__c;
        if(ObjContact.size()<=0){
        insert con;
        PageReference cr=new PageReference('https://eevent-deloittenet.cs2.force.com/event/newregistration_rec?cid='+con.id+'&acid='+objRecEvent[0].Account__c);
        cr.setRedirect(true);
        return cr;
        }      
        else
        {
        PageReference dr=new PageReference('https://eevent-deloittenet.cs2.force.com/event/newregistration_rec?cid='+objContact[0].id+'&acid='+objRecEvent[0].Account__c);
        dr.setRedirect(true);
        return dr;       
        }
       
       
    }
   
}
Hi Team,
When ever I try to refresh the eclipse,the lastmodifiedby getting changed to my name.
This is becoming a serious issue beacuse as a team many other people are working alongside with me.
If any issue occurs in their code,the fingers are pointed at me because lastmodifiedby is under my name.

Can some let me know if there is any solution for this issue?
Many thanks in advance :)
Hi All,

If i select a date in datefield while inserting/updating record.I want a field to populated with +2 yrs of selected date.

Can we achieve this with formula field ??
How can we cover the code for the below controller's code?


if(Apexpages.currentPage().getParameters().get('Export') != null){
                isExport = true;
            }
            else{
                isExport = false;
            }

Thank you.
I am doing development in the Service Cloud Service Console. I discovered that our needed functionality isn't there in the service console configurability, so I moved on to creating my own custom console. I used the sample code from this post (http://wiki.developerforce.com/page/Custom_Interaction_Logs) on wiki.developerforce which I was pointed to via this blog post (http://blogs.salesforce.com/product/2012/02/custominteractionlog.html)in blogs.salesforce.com. That code uses the Task, Case, and Contact objects. Rather than Case, I need to use a custom object (Risk__c). 

And here I should note that I'm totally new to Visualforce and Apex coding, so please forgive any simple questions/confusions on my part. 

Problem:
The Save and Save New buttons on the log are not saving

 
Pertinent Information:
  • They should save the information in the Log screen to the Activity History of my custom object, Risk.
  • I am 99% sure that the code linking the Log to my Contact is working properly.
  • No errors are generated when I click either the Save or Save New buttons.
  • When I click Save, the only thing that happens is the "Last Save" date time shows at the bottom of the screen.
  • When I click Save New, any information I entered in the fields manually is cleared (presumably to allow me to enter a new record. Duh, I know). 

***************************** Visual Force Code - my edited version *****************************

<apex:page standardController="Risk__c" extensions="CustomInteractionLog" tabStyle="Task">
<apex:includeScript value="/support/console/24.0/integration.js"/>

<apex:form >
<apex:pageBlock title="Log A Call" id="thePageBlock" mode="edit">
<apex:pageMessages />
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}" reRender="updateable, relatedList"/>
<apex:commandButton value="Save And New" action="{!saveAndNew}" reRender="updateable, relatedList"/>
</apex:pageBlockButtons>
<apex:actionFunction action="{!updateWhoWhatId}" name="updateWhoWhatIdJS" reRender="updateable">
<apex:param name="newRiskID" assignTo="{!riskID}" value=""/>
</apex:actionFunction>
<apex:outputPanel id="updateable">
<apex:pageBlockSection columns="1">
<apex:inputField value="{!task.whoId}"/>
<apex:inputField style="width:230px;" value="{!task.subject}"/>
<apex:inputField style="width:230px;" value="{!task.Category__c}"/>
<!-- <apex:inputField value="{!task.ANI__c}"/> -->
</apex:pageBlockSection>
<apex:pageBlockSection columns="1">
<apex:inputField style="height:100px;width:350px;" value="{!task.description}"/>
<br/><apex:outputText value="{!statusMessage}" />
</apex:pageBlockSection>
</apex:outputPanel>
</apex:pageBlock>
</apex:form>
<apex:outputPanel id="relatedList">
<apex:relatedList list="ActivityHistories"/>
</apex:outputPanel>
</apex:page>


***************************** Visual Force Code - the version I copied from wiki.developer (http://wiki.developerforce.com/page/Custom_Interaction_Logs) *****************************

<apex:page standardController="Case" extensions="CustomInteractionLog" tabStyle="Task">   
    <apex:includeScript value="/support/console/24.0/integration.js"/>
    <script type="text/javascript">
         
        var callObjectId = null;
         
        var onFocusedSubtabCallback = function (result) {
            var entityId = result.objectId;
            if (entityId.substr(0,3) === '500') {
                updateWhoWhatIdJS(result.objectId);
            }
        }; 
        sforce.console.onFocusedSubtab(onFocusedSubtabCallback);

        var getCallAttachedDataCallback = function (result) {           
            setCallAttachedDataJS(callObjectId, JSON.parse(result.data).ANI);
        };
     
        /* Retrieving call id of first call that came in and
        * calling getCallAttachedData() to retrieve call data.
        * Note that we are using the cti submodule here
        */                 
        var getCallObjectIdsCallback = function (result) {       
            if (result.ids !== 'null') {      
                var ids = result.ids.split(',');       
                if (ids.length > 0) {  
                    callObjectId = ids[0];    
                    sforce.console.cti.getCallAttachedData(callObjectId, getCallAttachedDataCallback);       
                }       
            }       
        };
        sforce.console.cti.getCallObjectIds(getCallObjectIdsCallback);
                        
        var onCallBeginCallback = function (result) {
            callObjectId = result.id;
            sforce.console.cti.getCallAttachedData(result.id, getCallAttachedDataCallback);
        };
        sforce.console.cti.onCallBegin(onCallBeginCallback);

        var onCallEndCallback = function (result) {
            setCallEndDataJS(result.duration, result.disposition);
        };
        sforce.console.cti.onCallEnd(onCallEndCallback);
         
    </script>
    <apex:form >
        <apex:pageBlock title="Log A Call" id="thePageBlock" mode="edit">
            <apex:pageMessages />
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}" reRender="updateable, relatedList"/>
                <apex:commandButton value="Save And New" action="{!saveAndNew}"reRender="updateable, relatedList"/>
            </apex:pageBlockButtons>
            <apex:actionFunction action="{!updateWhoWhatId}" name="updateWhoWhatIdJS"reRender="updateable">
                <apex:param name="newCaseId" assignTo="{!caseId}" value=""/>
            </apex:actionFunction>              
            <apex:actionFunction action="{!setCallAttachedData}" name="setCallAttachedDataJS"reRender="updateable">
                <apex:param name="CallObject" assignTo="{!CallObject}" value=""/>
                <apex:param name="ANI" assignTo="{!ANI}" value=""/>
            </apex:actionFunction>
            <apex:actionFunction action="{!setCallEndData}" name="setCallEndDataJS"reRender="updateable, relatedList">
                <apex:param name="CallDuration" assignTo="{!CallDurationInSeconds}" value=""/>
                <apex:param name="CallDisposition" assignTo="{!CallDisposition}" value=""/>
            </apex:actionFunction>           
            <apex:outputPanel id="updateable">
                 <apex:pageBlockSection columns="1">
                    <apex:inputField value="{!task.whoId}"/>                       
                    <apex:inputField value="{!task.whatId}"/>
                    <apex:inputField style="width:230px;" value="{!task.subject}"/>                   
                    <!-- <apex:inputField value="{!task.ANI__c}"/> -->                   
                </apex:pageBlockSection>
                <apex:pageBlockSection columns="1">
                    <apex:inputField style="height:100px;width:350px;" value="{!task.description}"/>                                       
                    <br/><apex:outputText value="{!statusMessage}"/>                                      
                </apex:pageBlockSection>
            </apex:outputPanel>           
        </apex:pageBlock>
    </apex:form>
    <apex:outputPanel id="relatedList">
        <apex:relatedList list="OpenActivities"/>
    </apex:outputPanel>
</apex:page>   


***************************** Screen shot of my in-development custom interaction log. 
 User-added image

There is a Record Creater User A  with timezone is Timezone A and Record Viewer is another User B with TimezoneB.  

 

I have a custom object with Datetime field. When i fetch this record using SOQL for User B, SF gives the Datetime value in GMT with respect to the creator user's timezone and i wanted to get the absolute value that i have entered. I didnot find any way to identify in which timezone i have created that record. 

 

Can anybody tell me that how can i fetch that a record is created in which timezone?

I recently upgraded to Windows 8.1, and am now having issues with the Force.com IDE. When I select Force.com->Add/remove metadata components, I'm not able to see any custom field child component in the Objects-Custom component. Does anyone have any ideas on what is causing the issue?
User-added image