• rohitr
  • NEWBIE
  • 70 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 4
    Likes Received
  • 0
    Likes Given
  • 41
    Questions
  • 41
    Replies

Have a visualforce page with a multi select picklist.

<apex:selectList value="{!selectedGroups}" size="10" multiselect="true">

 

I then need to loop over the comma delimited output selectedGroups in apex but i am not sure how to go about this.

Any suggestions?

Thanks

  • January 17, 2013
  • Like
  • 0
I need to build a VF page which has two coulms as shown in the attached image. Something like we have as OOB style sharing. 
I'll need to select Public Groups or Roles or Roles & Subordinates based on which the left column will be populated will all the public groups if public group is selected. and then add /remove button to add and remove to & from the right column.
User-added image

.
Any idea how this can be build with Visualforce? Code samples if any will be appeciated.
  • August 25, 2014
  • Like
  • 0
Can anyone tell me how to show "/home/home.jsp" inside an iframe in visualforce?
I tried
<apex:iframe height="800px" id="theIframe" src="/home/home.jsp" width="100%" frameborder="true"/>
The above iframe gives me a blank iframe.
But if u use
<apex:iframe height="800px" id="theIframe" src="/apex/SomeVisualforcePage" width="100%" frameborder="true"/>
i can see the visualforce paqe inside the current page.

Any browser settings or Salesforce settings need to be changed?

Any help would be appreciated.
Thanks in Advance.
I am building a merge app where i need to query account records based on some critieria.The critieria need to be defined using field filters (just the same way we have while creating a list view). Please help in writing a dynamic VF page where I can query records based on the field filter. I need help in creating the field filter and also should be able to add more filters and delete them. All this should happen dynamically.

Any code samples?

thanks in advance
Is there any custom account merge app code avaiable? I can't use any dupe finder apps from appexchange? Did someone already done this with dearch for accounts based on field filters and merge rules?

If then please share..

Thanks in Advance
Is it anyway possible to login to salesforce org in a browser window from salesforce1 app in mobile platform?
Idea is to have a link on salesforce1 app and then on click of the link, it should open salesforce org in the mobilwe browser without having the user to login again.

Thanks is Advance
Hi,

I've created a custom console component. And those components are available on the console as buttons. What i need is some tooltip to be shown on the console buttons at the bottom.

I saw Button CSS option while creating the console component. But not sure the format to put there?
User-added image

The highlighted region shows the custom console component button css option. What should i put there?

Thanks in advance.
  • March 26, 2014
  • Like
  • 0
I've implemented google charts api in my VF page. The script in VF goes as below.
<script type="text/javascript">
             
            google.setOnLoadCallback(drawChart);
           
            function drawChart() {
              var container = document.getElementById('example1');
           
              var chart = new google.visualization.Timeline(container);
           
              var dataTable = new google.visualization.DataTable();
           
              dataTable.addColumn({ type: 'string', id: 'Status' });
              dataTable.addColumn({ type: 'date', id: 'Start' });
              dataTable.addColumn({ type: 'date', id: 'End' });
           
              dataTable.addRows([
                [ 'Washington', new Date(1789, 3, 29), new Date(1797, 2, 3) ],
                [ 'Adams',      new Date(1797, 2, 3),  new Date(1801, 2, 3) ],
                [ 'Jefferson',  new Date(1801, 2, 3), new Date(1900, 2, 1)]]);
               
           
              chart.draw(dataTable);
            }
        </script>

The above is code from google and it renders a chart. But i need to have date from my controller. I tried using a date variable after declaring as get set. The variable was then used like this {!dateVariable}. Even then i couldn't make it work.

Is there any specific date format for timeline chart data?

Thanks in advance.
  • March 23, 2014
  • Like
  • 0
I've followed the instruction for accessing twitter api as given in the URL: http://wiki.developerforce.com/page/Getting_Started_with_TwitterForce

Followed all steps as they have mentioned. But on the twitter page, once i give credentials and click on login button, I get the below error.

Class.TwitterForce.execute: line 75, column 1
Class.TwitterForce.checkCreds: line 88, column 1
Class.TwitterForce.<init>: line 27, column 1
Class.TwitterController: line 19, column 1

Any light on this?

Thanks in Advance,
RR

  • March 23, 2014
  • Like
  • 0
My Controller Code:
global with sharing class CustomHighlightsPanelController {

    public Account accountInstance;
    global static String accountName {get; set;}
    global static String primeTabValue {get; set;}

    public CustomHighlightsPanelController(ApexPages.StandardController controller) {
        accountInstance = (Account)controller.getRecord();
        accountName = accountInstance.Id;
        System.debug('_______##############______'+accountName);
    }
    public PageReference FetchTabId() {
        return null;
    }
   
    @RemoteAction
    global static Premium_Payment__c[] loadPremiumPaidRecs() {
        List<Premium_Payment__c> premiumPaymentList = new List<Premium_Payment__c>();
        premiumPaymentList = [SELECT Id, Customer_Name__c, Paid_Premium__c, Policy__c, Premium_Paid_Date__c,Premium_Paid_Month_Year__c
                                FROM Premium_Payment__c WHERE Customer_Name__c =: accountName];
        return premiumPaymentList;
       
    }

}


accountName inside the SOQL query is getting null. but the variable accountName in the system.debug line gives a value.
How can i pass the contructor variable to the global static method which is defined as @RemoteAction.
  • March 18, 2014
  • Like
  • 1
How to pass id using the console functon "sforce.console.getFocusedPrimaryTabObjectId()" to a controller.
I'm getting the same on the javascript. But cannot pass. Tried using hiddenfield and actionfunction.
javascript:
function testGetFocusedPrimaryTabObjectId() {
            sforce.console.getFocusedPrimaryTabObjectId(showObjectId);
        }
        var showObjectId = function showObjectId(result) {
            //Display the object ID
            invokeController(result.id);
            alert('Object ID: ' + result.id);
        };

page:
<apex:actionFunction name="invokeController" action="{!save}" reRender="outtext">
            <apex:param value="{!primeTabValue}"/>
        </apex:actionFunction>
this is my code and in controller am using get; set; for the primeTabValue variable.

Am able to get the id on alert box. but not on the variable.

Any help would be much appreciated.


  • March 06, 2014
  • Like
  • 1
Hi,
I have few custom components at the bottom of the console screen. I've created custom console components from Customize>Console>Custom Console Components. 

What I need is,  on the console screen hovering over the images for the custom console components a tooltip should be displayed. I know we can have a text along the image. But how to show a tooltip. While creating a component there is a field "Button CSS". Do i need to put something here? If then what?

Thanks in advance,
RR
  • February 27, 2014
  • Like
  • 1
My inline Visualforce page doesn't load.
In page layout the vf page is available in edit and detail layout. But in either case the VF page doesn't appear.
Am using a custom object as a standard controller in the VF page.

Can someone let me know what the issue is?
  • February 12, 2014
  • Like
  • 0
I Installed the CTI demo adapter version 4.03 from salesforce.com and also setup the callcenter in the org by importing the xml file.
On Clicking the "Connect CTI Adapter" button, nothing happens.


Can someone let me know whats is happening here.

Thanks In Advance
  • December 31, 2014
  • Like
  • 0

Hi All,

 

I need to create a report with users who has not logged in between last 30 days and Last 60 days.

Please help me with the filter condition. I tried Last Login less than "LAST 30 DAYS" AND Last Login greater than "LAST 60 DAYS" But not working. Please provide anyother alternative work around.

 

 

Thanks in Advance.

  • November 20, 2013
  • Like
  • 0

Just came to know that Trigger over contact field is not permitted.

Is there any alternative to ContactFeed trigger. I want the latest contactfeed to appear on the corresponding contact record.

I've a trigger on Event which is fired on insert and update. The trigger updates couple of fields on contact based on event record.

For eg. 

There is a field Number of events, latest event.

 

I was trying to update the historical records too for which i updated a field on event. (this field is just to inititate the update and hence the trigger).

 

But I found that when i update all the event records, it just doesn't update fields on contact, but i see the field is updated on event records.

 

What is happening. Any clues?

Number Event records :1018

Data loader batch size: 200

Bulk API: unchecked.

 

Thanks in Advance

Hi,

 

I've the elow method which is called on a command button from a VF page. It is for the admin to run the batch manually whenever required.

 

Please help me how to create a test class for the same.

i tried creating the test class by created an AsyncApexJob record, but it gives error saying that the fields are not writeable.

 

public List<AsyncApexJob> getBatchJob() {
        String kstCreatedDateMod;
        String kstCompletedDateMod;
        List<AsyncApexJob> batchJob = [SELECT CreatedDate, JobItemsProcessed, Status, ExtendedStatus, NumberOfErrors, CompletedDate, JobType, TotalJobItems, ApexClassId FROM AsyncApexJob where id = : batchProcessId ];
       
        for(AsyncApexJob aaj : batchJob){
            if(aaj.CreatedDate == null){
                kstCreatedDate = null;
            }
            else {
                kstCreatedDateMod = String.valueOf(aaj.CreatedDate);
                kstCreatedDate = kstCreatedDateMod +' KST';     
            }
            if(aaj.CompletedDate == null){
                kstCompletedDate = null;
            }
            else {
                kstCompletedDateMod = String.valueOf(aaj.CompletedDate);
                kstCompletedDate = kstCompletedDateMod +' KST';
            }
            if(aaj.status == 'Queued') {
                ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO, 'Job Queued... Please wait..'));
            }
            else if(aaj.Status == 'Processing') {
                ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO, 'Batch Job Running... Please wait..'));
            }
            else if((aaj.Status == 'Completed') && (aaj.NumberOfErrors == 0)){
                ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.CONFIRM, 'Batch Job Completed!'));
            }
            else if((aaj.NumberOfErrors > 0) || (aaj.Status == 'Failed') || (aaj.Status == 'Aborted')){
                ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Error Processing Job. Please Contact Administrator'));
            }
        }
        return batchJob;
    }

 Ay help would be highly appreciated.

 

Thanks in Advance

Hi Guys,

 

Can anyone check and tell me what this error is? It happend when running a test class for a trigger.

"Failure Message: "System.SecurityException: Empty key", Failure Stack Trace: "(System Code)""

 

Thanks in Advance

I was learning about cases and casemilestone, but could not find how I can create a casemilestone record. I checked with Entitlement Implementation guide. Still I could find a way to create a record.

 

Can any one suggest step by step approach for to create a casemilestone record?

 

Thanks in Advance3

Hi All,

 

Please let me know how to pass a variable defined in a method inside a controller to the VF page.

 

@RemoteAction
global static AggregateResult[] loadOpportunity() {
	closingToday = 0;
	Date mydate = System.today();
        	Date mydate1 = System.today().addDays(-45);
        	Date mydate2 = System.today().addDays(45);
    	List<AggregateResult> OppList = new List<AggregateResult>();
        	OppList = [SELECT StageName, CloseDate, Sum(Amount) amountSum FROM Opportunity WHERE   OwnerId =: OwnerId AND StageName =: StageList 
                             AND CloseDate >: myDate1 AND CloseDate <: myDate2  GROUP BY StageName, CloseDate];
            for(AggregateResult opp :OppList) {
           		if(opp.get('CloseDate') = myDate) {
                        	closingToday = closingToday +1;
            	}
	}
}

 I want to use this closingToday variable to use on the VF page.

 

<p> Numner of Opportunity Closing Today is: {!ClosingToday}</p>

 

 

 

How can i declare this variable in the controller?

 

I'm using google charting for which @RemoteAction annotation is used.

 

 

Any help would be appreciated.

Thanks in Advance

I am building a merge app where i need to query account records based on some critieria.The critieria need to be defined using field filters (just the same way we have while creating a list view). Please help in writing a dynamic VF page where I can query records based on the field filter. I need help in creating the field filter and also should be able to add more filters and delete them. All this should happen dynamically.

Any code samples?

thanks in advance
My Controller Code:
global with sharing class CustomHighlightsPanelController {

    public Account accountInstance;
    global static String accountName {get; set;}
    global static String primeTabValue {get; set;}

    public CustomHighlightsPanelController(ApexPages.StandardController controller) {
        accountInstance = (Account)controller.getRecord();
        accountName = accountInstance.Id;
        System.debug('_______##############______'+accountName);
    }
    public PageReference FetchTabId() {
        return null;
    }
   
    @RemoteAction
    global static Premium_Payment__c[] loadPremiumPaidRecs() {
        List<Premium_Payment__c> premiumPaymentList = new List<Premium_Payment__c>();
        premiumPaymentList = [SELECT Id, Customer_Name__c, Paid_Premium__c, Policy__c, Premium_Paid_Date__c,Premium_Paid_Month_Year__c
                                FROM Premium_Payment__c WHERE Customer_Name__c =: accountName];
        return premiumPaymentList;
       
    }

}


accountName inside the SOQL query is getting null. but the variable accountName in the system.debug line gives a value.
How can i pass the contructor variable to the global static method which is defined as @RemoteAction.
  • March 18, 2014
  • Like
  • 1
How to pass id using the console functon "sforce.console.getFocusedPrimaryTabObjectId()" to a controller.
I'm getting the same on the javascript. But cannot pass. Tried using hiddenfield and actionfunction.
javascript:
function testGetFocusedPrimaryTabObjectId() {
            sforce.console.getFocusedPrimaryTabObjectId(showObjectId);
        }
        var showObjectId = function showObjectId(result) {
            //Display the object ID
            invokeController(result.id);
            alert('Object ID: ' + result.id);
        };

page:
<apex:actionFunction name="invokeController" action="{!save}" reRender="outtext">
            <apex:param value="{!primeTabValue}"/>
        </apex:actionFunction>
this is my code and in controller am using get; set; for the primeTabValue variable.

Am able to get the id on alert box. but not on the variable.

Any help would be much appreciated.


  • March 06, 2014
  • Like
  • 1
Hi,
I have few custom components at the bottom of the console screen. I've created custom console components from Customize>Console>Custom Console Components. 

What I need is,  on the console screen hovering over the images for the custom console components a tooltip should be displayed. I know we can have a text along the image. But how to show a tooltip. While creating a component there is a field "Button CSS". Do i need to put something here? If then what?

Thanks in advance,
RR
  • February 27, 2014
  • Like
  • 1
Can anyone tell me how to show "/home/home.jsp" inside an iframe in visualforce?
I tried
<apex:iframe height="800px" id="theIframe" src="/home/home.jsp" width="100%" frameborder="true"/>
The above iframe gives me a blank iframe.
But if u use
<apex:iframe height="800px" id="theIframe" src="/apex/SomeVisualforcePage" width="100%" frameborder="true"/>
i can see the visualforce paqe inside the current page.

Any browser settings or Salesforce settings need to be changed?

Any help would be appreciated.
Thanks in Advance.
Is there any custom account merge app code avaiable? I can't use any dupe finder apps from appexchange? Did someone already done this with dearch for accounts based on field filters and merge rules?

If then please share..

Thanks in Advance
My Controller Code:
global with sharing class CustomHighlightsPanelController {

    public Account accountInstance;
    global static String accountName {get; set;}
    global static String primeTabValue {get; set;}

    public CustomHighlightsPanelController(ApexPages.StandardController controller) {
        accountInstance = (Account)controller.getRecord();
        accountName = accountInstance.Id;
        System.debug('_______##############______'+accountName);
    }
    public PageReference FetchTabId() {
        return null;
    }
   
    @RemoteAction
    global static Premium_Payment__c[] loadPremiumPaidRecs() {
        List<Premium_Payment__c> premiumPaymentList = new List<Premium_Payment__c>();
        premiumPaymentList = [SELECT Id, Customer_Name__c, Paid_Premium__c, Policy__c, Premium_Paid_Date__c,Premium_Paid_Month_Year__c
                                FROM Premium_Payment__c WHERE Customer_Name__c =: accountName];
        return premiumPaymentList;
       
    }

}


accountName inside the SOQL query is getting null. but the variable accountName in the system.debug line gives a value.
How can i pass the contructor variable to the global static method which is defined as @RemoteAction.
  • March 18, 2014
  • Like
  • 1
Hi,
I have few custom components at the bottom of the console screen. I've created custom console components from Customize>Console>Custom Console Components. 

What I need is,  on the console screen hovering over the images for the custom console components a tooltip should be displayed. I know we can have a text along the image. But how to show a tooltip. While creating a component there is a field "Button CSS". Do i need to put something here? If then what?

Thanks in advance,
RR
  • February 27, 2014
  • Like
  • 1
My inline Visualforce page doesn't load.
In page layout the vf page is available in edit and detail layout. But in either case the VF page doesn't appear.
Am using a custom object as a standard controller in the VF page.

Can someone let me know what the issue is?
  • February 12, 2014
  • Like
  • 0
I Installed the CTI demo adapter version 4.03 from salesforce.com and also setup the callcenter in the org by importing the xml file.
On Clicking the "Connect CTI Adapter" button, nothing happens.


Can someone let me know whats is happening here.

Thanks In Advance
  • December 31, 2014
  • Like
  • 0

I've a trigger on Event which is fired on insert and update. The trigger updates couple of fields on contact based on event record.

For eg. 

There is a field Number of events, latest event.

 

I was trying to update the historical records too for which i updated a field on event. (this field is just to inititate the update and hence the trigger).

 

But I found that when i update all the event records, it just doesn't update fields on contact, but i see the field is updated on event records.

 

What is happening. Any clues?

Number Event records :1018

Data loader batch size: 200

Bulk API: unchecked.

 

Thanks in Advance

I have the requirement  create a trigger on Attachment object, when i add new attachment ,check the attchment alredy aded or not?

 

i write like this ,please suggest me, is it correct or not?

 

 

trigger dntAddDuplicateAttchmnt on Attachment (before insert) {
if(trigger.isBefore){
for(Attachment atch:Trigger.new){
String parentID=atch.ParentId;
String atchName=atch.Name;
List<Attachment> listatch=[SELECT Name,ParentId FROM Attachment];
if(parentID==trigger.oldmap.get(parentID).ParentId && atchName==trigger.oldmap.get(parentID).Name){
atch.addError(' This file already having with same name in your attachmntes');
}
else if{
for(Attachment at:listatch){
if(at.Name==atchName && at.ParentId==parentID){
atch.addError('This file already having with same name in your attachmntes');
}
}
}

}
}

}

Please help me...

 

I have 20 E-mail fields named Email1__c, Email2__c, Email3__c,.....Email20__c.

What I want to do is loop thorugh these fields and input value.

 

Hereis my code.

Alerts__c alerts =new Alerts__c();
for(integer j=1;j==MailList.size();j++){
  String iStr = String.Valueof(j);
  String fieldname='Email'+iStr+'__c';
  alerts.get(fieldname)='test@test.com';
}

 But the following error occured.

 Expression cannot be assigned 

 

Please tell me how to solve this problem...

 

Thanks in advance for your help.

 

Anna

 

  • June 14, 2013
  • Like
  • 0

Hi All,

 

 

I want to pre populate values of master record information in to my while clicking new btn in Related list?How to do this explain with one example?pls help me...Urgent

 

 

 

Thanks,

 

 

Vicky

Hi,

 

Are the user id's same in sandbox and prod??

 

Thanks

Hi All,

 

Please let me know how to pass a variable defined in a method inside a controller to the VF page.

 

@RemoteAction
global static AggregateResult[] loadOpportunity() {
	closingToday = 0;
	Date mydate = System.today();
        	Date mydate1 = System.today().addDays(-45);
        	Date mydate2 = System.today().addDays(45);
    	List<AggregateResult> OppList = new List<AggregateResult>();
        	OppList = [SELECT StageName, CloseDate, Sum(Amount) amountSum FROM Opportunity WHERE   OwnerId =: OwnerId AND StageName =: StageList 
                             AND CloseDate >: myDate1 AND CloseDate <: myDate2  GROUP BY StageName, CloseDate];
            for(AggregateResult opp :OppList) {
           		if(opp.get('CloseDate') = myDate) {
                        	closingToday = closingToday +1;
            	}
	}
}

 I want to use this closingToday variable to use on the VF page.

 

<p> Numner of Opportunity Closing Today is: {!ClosingToday}</p>

 

 

 

How can i declare this variable in the controller?

 

I'm using google charting for which @RemoteAction annotation is used.

 

 

Any help would be appreciated.

Thanks in Advance

Hi there,

 

I have added a custom console component to our Service Cloud console but what I'm trying to do is that when I click on the button to launch the component, I want to run a method in my controller that my visualforce page is calling. This component is made up of page that provides a quick view into our support team's cases queue, and a controller with methods that rerun the query to get a realtime view of the cases in the queue.

 

My question is, how do I get at the onclick event for this button? I have searched around for answers but so far I have been unable to find any. My goal is to use this console component as a quick view into our support teams cases queue so that wherever they are in the console (in a case, contact, organisation record, etc..) when they click on this component it will automatically refresh the view of the support cases that I'm displaying in this component.

 

So far I have only been able to get as far as adding some output text to my page and firing this refresh using the onlclick and onmouseover event. This isn't ideal for our team's requirements so ideally when they click on this component I would like to be able to fire the refresh then?

 

Any ideas on this please?

 

All help is greatly appreciated as always!

 

Thanks so much in advance to anyone taking the time to read this and offer assistance.

 

Kindest Regards,

 

Brian.

Hi,

 

I've created a VF page where i'm suing google charts API.

 

Source of my information :http://developer.force.com/cookbook/recipe/easy-visualforce-charts-with-javascript-remoting--google-charts-api

 

Is it possible to have 2 charts on the same page?

 

Thanks in Advance,

Rohit

  • February 28, 2013
  • Like
  • 0

how can we check the debug logs of guest users