• SKiran
  • NEWBIE
  • 30 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 13
    Replies

here i am integrating google charts apart from this i am using AggregateResult funtion here i have sum of the annual annual revenue and grouping the rating but here the problem is i have displayed sum of annual revenue but i am not able to display the labels of Ratig field(Hot,Warm,Cold,Others) how can i get this can anybody help me and this is my code.

 

result = sforce.connection.query("Select Rating, sum(Annualrevenue) sales " + "from Account group by Rating " );
        // Iterate over the result
        var it = new sforce.QueryResultIterator(result);
        while(it.hasNext()) {
            var record = it.next();
        alert(record.rating);   
            // Add the data to the table
            data.addRow([record.rating, {v:parseFloat(record.sales), f: formatCurrencyLabel(record.sales)}]);
        }

 

when ever i test this using record.rating it shows undefiened, value if i display record.sales it show the value of sales.... how can i get rating values anybody help me please.............?

Hi, I am able to override the custom page for edit and new actions of object. Thats great. But I want that admin to be able to create those records with standard page and with the custom page that I have overriden for new and edit. Is there any way to restrict this overriding to non admin users.

  • November 27, 2013
  • Like
  • 0

Is there any limit on number of report folders?

  • November 25, 2013
  • Like
  • 0

I am using checkpoints and using System.debug() to get the value of variable at some point. When I am adding apex code to that checkpoint but I am getting following error in Apex Execution Result.

Variable does not exist: <variable name>

 

Is there anything extra has to be done to inject code via checkpoints.

 

  • September 02, 2013
  • Like
  • 0

I have a page where depending upon certain criteria I will be searching contacts and showing them on table. Now I want to provided functionality where user would be able to select some contacts for deletion and there would be a button for deleting selected contacts. I am not sure how will I enable multiple selection of rows from table. Any pointers would be heplful. Thanks in advance.

  • August 16, 2013
  • Like
  • 0

I have tried to access sobject through force workbench rest explorer via "/services/data/v28.0/sobjects"

and I was getting data.

Now I am trying to get data from apex also using following code.

Httprequest request = new Httprequest();
request.setEndpoint('https://ap1.salesforce.com/services/data/v28.0/sobjects');
request.setMethod('GET');
request.setHeader('ACCEPT', 'application/json');

request.setHeader('Authorization','AOuth'+UserInfo.getSessionId());
System.debug('DEBUG-->sessionID'+UserInfo.getSessionId());
try {
    System.debug('before calling invoke api for ');  
    Http http = new Http();
    String getResponseString = ''+http.send(request).getBody();
    System.debug('getResponseString------'+getResponseString);
} catch(Exception e){
    System.debug('Exception++++=='+e);
}

 

but I am getting error like {"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}

 

Note: I have added https://ap1.salesforce.com in remote site settings.

 

I might be doing something wrong in code or I might need to activate something in org to get this working. Any pointers would be so helpful. Thanks in advance.

Hi,

    Is there any way to write code at the end of transaction. I am planning of logging debug logs in custom object as records. So that after every transaction i will save all debug records to salesforce. I have written a remote function to access all debugs from this custom log. So in browser only i can check all debugs no need to go to salesforce debug everytime for debugging. I can debug my code right in the browser's console. Only problem that I am facing is that if I try to insert record for every debug message then I might run out of dml statements. So I was considering of inserting all debug logs at the end of transaction. So Is there any way (or place) to write code which will execute at end of transaction. This custom debug logger write in browser's console would be of greate help.

Hi,

   I am creating an unmanged package where I need few classes from org. I have done code coverage for those classes. But still while uploading package it is failing becuase of less code coverage i.e. 64%. 64% is my orgs total coverage. But I do not refer all class in my package. I need only few of them for which I have written test class. I am expecting a coverage of 90% for package. Do I require to increase overall org's code coverage to create unmanaged package. Any pointers would be helpful.

Hi,

    I am creating a package which is referring eight classses, I have written all the test classes for them. There is trigger in the org which I havnt included in the package. Though I have written test class for it. All tests are passing but still I am getting error as 

---------

Average test coverage across all Apex Classes and Triggers is 5%, at least 75% test coverage is required.
---------
  I was hoping code coverage to be 80 to 90 % but getting as 5%. I might be missing something.  Any pointers would be helpful. Thanks in advance.
 

 

Hi, I am able to override the custom page for edit and new actions of object. Thats great. But I want that admin to be able to create those records with standard page and with the custom page that I have overriden for new and edit. Is there any way to restrict this overriding to non admin users.

  • November 27, 2013
  • Like
  • 0

here i can easily display Annual revenue and i can't display rating value from AggregateResult..my code

 

if i use this code i can easily display Annualrecenue sum

list<AggregateResult> lst=[Select Rating, sum(Annualrevenue) sales from Account group by Rating ];
System.debug('*****************'+lst);
for(Aggregateresult ar:lst){
System.debug('*****************'+ar.sales);
}

 But if i use this code i can't display rating value how can i display rating value...?

 

list<AggregateResult> lst=[Select Rating, sum(Annualrevenue) sales from Account group by Rating ];
System.debug('*****************'+lst);
for(Aggregateresult ar:lst){
System.debug('*****************'+ar.rating);
}

 

how can i display rating using this can anybody help me.........................................................................?

 

here i am integrating google charts apart from this i am using AggregateResult funtion here i have sum of the annual annual revenue and grouping the rating but here the problem is i have displayed sum of annual revenue but i am not able to display the labels of Ratig field(Hot,Warm,Cold,Others) how can i get this can anybody help me and this is my code.

 

result = sforce.connection.query("Select Rating, sum(Annualrevenue) sales " + "from Account group by Rating " );
        // Iterate over the result
        var it = new sforce.QueryResultIterator(result);
        while(it.hasNext()) {
            var record = it.next();
        alert(record.rating);   
            // Add the data to the table
            data.addRow([record.rating, {v:parseFloat(record.sales), f: formatCurrencyLabel(record.sales)}]);
        }

 

when ever i test this using record.rating it shows undefiened, value if i display record.sales it show the value of sales.... how can i get rating values anybody help me please.............?

Hi

I have 3 objects that are Loan,Candidate,Position,the Loan object have Candidate and Postion lookup relationship now how to display these three objects data by using pageblocktable .

 

Thanks

Ram

  • November 15, 2013
  • Like
  • 0

I have an object which has a lookup field to contacts. Is it possible that when I relate a contact to this object I can either create a task or notify the contact by email that he has been assigned this task? Since we are using the Salesforce for outlook tool, we are trying to make the tool as dynamic as possible with notifications sent my email. Thanks

I want to update a count on Contact object after a new record is inserted or deleted on Lents object. My code is working fine to update the count by 1 but is not decreasing its value by 1 please help me:

 

trigger UpdateCount on Lent__c (after insert,after delete) {
List<Contact> counts_toUpdate = new List<Contact>();
Map<String, Integer> contact_newCount_Map=new Map<String, Integer>(); //for each contact the CountNumber

if(trigger.isinsert){
List<Lent__c> counts =[select Contact__c, Contact__r.Count__c
from Lent__c where id IN :Trigger.new FOR UPDATE];
for(Lent__c lent:counts){
contact_newCount_Map.put(lent.Contact__c, Integer.valueOf(lent.Contact__r.Count__c==null ? 0 : lent.Contact__r.Count__c) + 1);
}
}
else{
Set<Id> contactIds = new Set<Id>();
for (Lent__c l : Trigger.old)
contactIds.add(l.Contact__c);
List<Lent__c> counts = [select Contact__c, Contact__r.Count__c
from Lent__c where id IN :contactIds];
Map<Id,Contact> oldContacts = new Map<Id,Contact>([SELECT Count__c From Contact where Id IN :contactIds]);
for(Lent__c lent : counts)
contact_newCount_map.put(lent.Contact__c, Integer.valueOf(oldContacts.get(lent.Contact__c).Count__c == null ? 0 : oldContacts.get(lent.Contact__c).Count__c ) -1);
}

for(Contact con : [select id, Count__c from Contact WHERE ID IN : contact_newCount_Map.KeySet()]){
con.Count__c=contact_newCount_Map.get(con.id);
counts_toUpdate.add(con);
}

update counts_toUpdate;
}

  • September 01, 2013
  • Like
  • 0

I have a page where depending upon certain criteria I will be searching contacts and showing them on table. Now I want to provided functionality where user would be able to select some contacts for deletion and there would be a button for deleting selected contacts. I am not sure how will I enable multiple selection of rows from table. Any pointers would be heplful. Thanks in advance.

  • August 16, 2013
  • Like
  • 0

Hi,

    I am creating a package which is referring eight classses, I have written all the test classes for them. There is trigger in the org which I havnt included in the package. Though I have written test class for it. All tests are passing but still I am getting error as 

---------

Average test coverage across all Apex Classes and Triggers is 5%, at least 75% test coverage is required.
---------
  I was hoping code coverage to be 80 to 90 % but getting as 5%. I might be missing something.  Any pointers would be helpful. Thanks in advance.
 

 

Hi ,

  I developed a visualforce page with date field. when i opened this page the date picker popup opened default from date field. i need to just hide this popup if i click that textbox need only open this popup..Have you any solution for this.

 

Thanks

Rajii