• gaurav.sfdc
  • NEWBIE
  • 40 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 28
    Questions
  • 30
    Replies
I have a statement to calculate Win Rate :"Win Rate is calculated by adding total revenue closed within the period divided by total revenue in open opportunities at the start of the period" Period is some past period say a month period say start date '01-Aug-15' to '31-Aug-15'
Now if Opp is created in July month end say 26th-July-15, How can I get Amount value at start of the period. (Here 1st-Aug-15). In OppHistory we have an entry of 26th-July. I understand the business here, when period started what is the value of amount of Opp vs at end of period. I think the best way could be
Amount from oppHistory where created date between opp.createddate and 1st-Aug-16(inclusive) desc oppHistory created date limit 1.
This will give any value of amount modified near or at 1
Just wanted to have others opinion.
 
I have a client that wish to move from sales cloud to Financial service cloud. Will it be direct migration using data loader or could there be any issues ?
Actually I am trying to match merge field in string : I am trying below but not working...

string str = '{!a.d} and {!b.d} hello';
string regex = '/\\{\\!\\w+.\\w+\\.*\\}/g';
Pattern p = Pattern.compile(regex);
Matcher pm = p.matcher(str);
system.debug('----11111111111---'+ pm.find()); 

Any help would be appreciated
Our client is using Netscaler, they have put client cert as OPTIONAL and handeling certificate authentication at application layer i.e. PHP code.
It works for them in internal testiing using curl etc but when we ping through Salesforce it fails.

In logs it shows Client certificate not sent. I checked this article, this should be condition for sending certificate 
https://help.salesforce.com/apex/HTViewSolution?id=000180836&language=en_US

When I ping same certificates to another normal tomcat server, it works fine.

Can anybody tell what specific setting is required at Netscalar level to make it working

Any help would be appreciated
 
How to implement the dependent behavior of this new feature (i.e. enabling Country and State picklist in Org). On standard contact page it shows depent behavior automatically but when we bind these field with in VF page the dependent behavior is lost

Is there a simple way to implement this behavior in VF page

Any help would be appreciated
 
I have created a csr and trying to get a trial certificate to upload but the external system is asking for certificate as well as Key, Is it possibe to extract Keys for my certificate from salesforce
We need to implement two way SSL with external system (in PHP). The external system has created a UI that accepts only three formats (PEM, DER, PFX)

Now in salesforce I could create a self-signed certificate (.crt) or .csr Now how can I convert my .csr or .crt to above formats (PEM,DER or PFX)

Can using crypto class we can covert to these above formats, I possible can somebody provide me code. Actually the scenario is like this.
--> SFDC clients will be generating crs and getting crt (CA signed) and upload the same them in external system
--> Our's is a salesforce plug-in (managed package) that input certificates name and pass it in webservice callout (req.certname = XYZ)
--> The external system will validate the certificate and provide response

The external system supports 2 way but accepts only (PEM,DER or PFX) files.

How can I achieve this or the external sysstem has to modify their system to accept .crt files as well



 
I have uploaded a certificate. I have created a vf page to enter its name but as a part of validation I need to check if certificate name is correct i.e. whether that certificate exists in my org (uploaded in org)

Though I know it throws an an error during callout but is there a way to check before hand i.e. at the time of giving certificate name in my vf page

Thanks in advance
Normally we get ghost user when we installed a managed package, Is there a way I can get the name/profile of the logged-in user who installed the package? I have checked some articles which says that there are some package properties as 'Installed By' or 'Created By' . But how to access these in Apex. 
What I want is : I want to enable certain parts of my application which is either accessible by Admin-profile or by the user who istalled the package?

 
I am using analytics API. I parse resuting Json through Report Parser Class. This worked when there is no currency field selected. As soon as I fetch currency field in report. This parser class gets crashed with message "Illegal value for primitive" at line

reportData = (ReportWrapper)JSON.deserialize(jsonString, ReportWrapper.class);

Please find below both Parser class and Json string with currency field which when passed gets crashed.
Could you please help me modifying the parser class to accomodate currency field
(There is also some difference for currency fields and other fields which comes like array/object -- see below vs normal field
Currency = {"label":"$10.00","value":{"amount":10,"currency":null}},
Normal field = {"label":"1/11/2015","value":"2015-01-11"} )

public static ReportWrapper parseReport(String reportId){
        Http http = new Http();
        HttpRequest httpReq = new HttpRequest();
        HttpResponse httpRes = new HttpResponse();
       
        httpReq.setMethod('GET');
        httpReq.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId());
        httpReq.setEndpoint( getAnalyticAPIEndpoint(reportId) );
        
        String jsonString = '';

        jsonString = httpRes.getBody();
        jsonString = jsonString.left(jsonString.indexOf('T!T'))+'tXXXXXt'+jsonString.subString(jsonString.indexOf('T!T')+3,jsonString.length());
        System.debug('@@@@@@@@@@@@Body : jsonString :' +jsonString);
        //jsonString = jsonString.replaceAll('T!T','tXXXXXt');
        ReportWrapper reportData;
        try{
           reportData = (ReportWrapper)JSON.deserialize(jsonString, ReportWrapper.class);
        }catch(Exception e){
            System.debug(e.getMessage() + ' : StackTrace ' + e.getStackTraceString());
        }
        System.debug('@@@@@@@Report Data after parsing: '+reportData);
        
        
       
         ReportDataWrapper factMap = (ReportDataWrapper)JSON.deserialize(jsonString, ReportDataWrapper.class);
         System.debug('@@@@@>>     '+factMap);
        //httpRes.getBody();*/
        return reportData;
    }
 public class ReportWrapper{
        public boolean hasDetailRows{set; get;}
        public ReportAttributesWrapper attributes{set; get;}
        public GroupingWrapper groupingsDown{set; get;}
        public GroupingWrapper groupingsAcrosss{set; get;}
        public ReportDataWrapper factMap{set; get;}
        //public Map<String, NewTableWrapper> factMap{set; get;}
        public boolean allData{set; get;}
        public ExtendedMetadataWrapper reportExtendedMetadata{set;get;}
        public MetadataWrapper reportMetadata{set; get;}
    }
    
    public class ReportAttributesWrapper{
        public String instancesUrl {set; get;}
        public String describeUrl {set; get;}
        public String type {set; get;}
        public String reportId {set; get;}
        public String reportName {set; get;}
    }
    public class GroupingWrapper{
        public List<String> groupings{set; get;}
    }
    public class ReportDataWrapper{
        public NewTableWrapper tXXXXXt{set; get;}
    }
    public class NewTableWrapper{
        public List<RowWrapper>rows{set; get;}
        public List<AggregateWrapper> aggregates{set; get;}
    }
    public class TableWrapper{
        public List<RowWrapper> rows{set; get;}
        public CellWrapper aggregates{set; get;}
    }
    public class RowWrapper{
        public List<CellWrapper> dataCells{set; get;}
    }
    public class CellWrapper{
        public String value{set; get;}
        public String Label{set; get;}
    }
    public class AggregateWrapper{
        public long value{set; get;}
        public String label{set; get;}
    }
    public class ExtendedMetadataWrapper{
        public Map<String,ColumnInfo> detailColumnInfo{set; get;}
        public Map<String,Map<String,String>> aggregateColumnInfo{set; get;} 
        public GroupingColumnInfo groupingColumnInfo{set;get;}
    }
    public class ColumnInfo{
        public String dataType{set; get;}
        public String label{set; get;}
    }
    public class MetadataWrapper{
        public String Name{set;get;}
        public String id{set;get;}
        public List<String> aggregates{set; get;}
        public List<GroupingWrapper> groupingsDown{set; get;}
        public List<GroupingWrapper> groupingsAcross{set; get;}
        public boolean reportBooleanFilter{set;get;}
        public List<FilterWrapper> reportFilters{set; get;}
        public List<String> detailColumns{set; get;}
        public String developerName{set; get;}
        public ReportType reportType{set; get;}
        public String currencyValue{set; get;}
        public String reportFormat{set; get;}
    }
    
    public class FilterWrapper{
        public String value{set; get;}
        public String column{set; get;}
        public String operator{set; get;}
    }
    public class ReportType{
        public String type{set; get;}
        public String label{set; get;}
    }
    public class GroupingColumnInfo{
        
    }
 

JSON String:

{"attributes":{"describeUrl":"/services/data/v29.0/analytics/reports/00OC00000065lGJMAY/describe","instancesUrl":"/services/data/v29.0/analytics/reports/00OC00000065lGJMAY/instances","reportId":"00OC00000065lGJMAY","reportName":"my report","type":"Report"},"allData":true,"factMap":{"tXXXXXt":{"aggregates":[{"label":"2","value":2}],"rows":[{"dataCells":[{"label":"006C000000qCLto","value":"006C000000qCLtoIAG"},{"label":"Op2","value":"006C000000qCLtoIAG"},{"label":"-","value":null},{"label":"1/31/2015","value":"2015-01-31"},{"label":"-","value":null},{"label":"Prospecting","value":"Prospecting"},{"label":"10%","value":10},{"label":"Q1-2015","value":"Q1-2015"},{"label":"185","value":185},{"label":"7/13/2014","value":"2014-07-14"},{"label":"Nikhil Jain Dev","value":"005C000000609M2IAI"},{"label":"-","value":null},{"label":"Simplion","value":"001C000001FeLDvIAN"}]},{"dataCells":[{"label":"006C000000w65py","value":"006C000000w65pyIAA"},{"label":"Op1","value":"006C000000w65pyIAA"},{"label":"$10.00","value":{"amount":10,"currency":null}},{"label":"1/11/2015","value":"2015-01-11"},{"label":"-","value":null},{"label":"Qualification","value":"Qualification"},{"label":"10%","value":10},{"label":"Q1-2015","value":"Q1-2015"},{"label":"7","value":7},{"label":"1/7/2015","value":"2015-01-07"},{"label":"Nikhil Jain Dev","value":"005C000000609M2IAI"},{"label":"-","value":null},{"label":"Deimple Acnt","value":"001C000001HP9P5IAL"}]}]}},"groupingsAcross":{"groupings":[]},"groupingsDown":{"groupings":[]},"hasDetailRows":true,"reportExtendedMetadata":{"aggregateColumnInfo":{"RowCount":{"acrossGroupingContext":null,"dataType":"int","downGroupingContext":null,"label":"Record Count"}},"detailColumnInfo":{"OPPORTUNITY_ID":{"dataType":"id","label":"Opportunity ID"},"OPPORTUNITY_NAME":{"dataType":"string","label":"Opportunity Name"},"EXP_AMOUNT":{"dataType":"currency","label":"Expected Revenue"},"CLOSE_DATE":{"dataType":"date","label":"Close Date"},"NEXT_STEP":{"dataType":"string","label":"Next Step"},"STAGE_NAME":{"dataType":"picklist","label":"Stage"},"PROBABILITY":{"dataType":"percent","label":"Probability (%)"},"FISCAL_QUARTER":{"dataType":"string","label":"Fiscal Period"},"AGE":{"dataType":"int","label":"Age"},"CREATED_DATE":{"dataType":"datetime","label":"Created Date"},"FULL_NAME":{"dataType":"string","label":"Opportunity Owner"},"ROLLUP_DESCRIPTION":{"dataType":"string","label":"Owner Role"},"ACCOUNT_NAME":{"dataType":"string","label":"Account Name"}},"groupingColumnInfo":{}},"reportMetadata":{"aggregates":["RowCount"],"currency":null,"detailColumns":["OPPORTUNITY_ID","OPPORTUNITY_NAME","EXP_AMOUNT","CLOSE_DATE","NEXT_STEP","STAGE_NAME","PROBABILITY","FISCAL_QUARTER","AGE","CREATED_DATE","FULL_NAME","ROLLUP_DESCRIPTION","ACCOUNT_NAME"],"developerName":"my_report","groupingsAcross":[],"groupingsDown":[],"id":"00OC00000065lGJMAY","name":"my report","reportBooleanFilter":null,"reportFilters":[],"reportFormat":"TABULAR","reportType":{"label":"Opportunities","type":"Opportunity"}}}
I am using ListViews in apex.using AccSetController.getListViewOptions()

 I want to check if the listview is private or public i.e. ('Visible to me' or all) ? 

Any help would be appreciated

 
I want when I unistall my package it should forcefully abort/delete all scheduled/apex jobs created by Package + some Jobs created manually (where jobname=xyz..) 

Any help will be appreciated
If I run below query in query editor it runs fine and give all fields but in Apex or execute anomynous it gives just CaseNumber, ContactId, ID.

List<sObject> lst = [SELECT CaseNumber, Contact.FirstName, Contact.LastName, Contact.Email, ContactId, Id FROM Case  WHERE ID IN('500o0000001OaQsAAK','500o0000001OaR0AAK','500o0000001OaQeAAK') and Contact.Email <> null order by CaseNumber limit 10000];
System.debug(lst);

Any help would be appreciated
 
How to get a session Id for ghost user? The seesion Id is needed to Pull report via Ananlytics API which needs sessionID. The Job is scheduled via Install handler. I have seen many post where I can see that ghost user does not have session Id, But what can be the alternative? We have a manged package which uses report data in Job. Is there any fake session Id than can be created and used. A post says using oAuth token but dosent sounds good

Any help would be appreciated
I have 83% of test coverage when I run 'run All' test. But when I try to upload a pckage from same org it failes saying 73%. What could be the possible reason of this fall of 10%

Regards
Gaurav
In our managed package, SF has higlighted XCSR issue at various places. Actually we are using update statement in our pageLoad event (called directly from apex page action=pageload)
But we are not using any varable from Apex.currentpage in the update statement. Every where we are using either from app setting or user Info(). Actually we retrieve certain info from a wb service and update user on page load. This is anyhow required but we could not see any threat as we are not using any apex variable from GET but tool picks up update event in pageload and highlight it as a threat.
1. We cannot call a button again and again as a workaround
2. we also applied Javascript post but our applcation started behaving wierdly, automatic refreshing again and again.

What could be the workaround so as not to catch up by the tool 

Hi,

We created a managed package and istalled in sandbox. We have a batch which failed with this error

First error: No such column 'myPrefix__Campaign__c' on entity 'myPrefix__XYZObject__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the de...

However the column very well exists there and If I use developer consol to to run query select myPrefix__Campaign__c from myPrefix__XYZObject__c the query runs perfect.

In my dev org this is working fine.

Any guess on this issue

Regards
Gaurav Khare
I have an excel sheet with zip to user mapping. Now Accounts with those zip needs to be mapped with corresponding userid. For this I followed following approach,
I created a custom object (to upload data via loader) with user look-up--> written a before insert trigger on custom object to fetch user Id based on name. Now while writing After Insert trigger I would need some zip-account mapping (can be multiple accounts per Zip) but I stuck keeping Select out for loop which would break definately as there are almost 50 K records, Could you please help me with After trigger with optimized code or any altogether different approach.
We need some email to case setup along with workflow i.e to a group of ppl as L1 and then upon approval to L2/L3 another group of people (emailIds)
I want to automte the functionality of log a call button under activitites , pressing log acll button will lead to vf page where only one or two fields are required to be entered then i fire a trigger to update other fields on saving a record or a similar log a cal button whic wil just create a log a call (i.e task)
I have a client that wish to move from sales cloud to Financial service cloud. Will it be direct migration using data loader or could there be any issues ?
I want when I unistall my package it should forcefully abort/delete all scheduled/apex jobs created by Package + some Jobs created manually (where jobname=xyz..) 

Any help will be appreciated
I need to connect an external Rest API through basic authentication. (I cannot use OAuth) . The main API is not ready from client side. We need to show a demo to show connectivity to Rest API via basic authentication. I have the code to connect but dont have any API to test. so I need any free API (with user name & passowrd) to test basic authentication
Actually I am trying to match merge field in string : I am trying below but not working...

string str = '{!a.d} and {!b.d} hello';
string regex = '/\\{\\!\\w+.\\w+\\.*\\}/g';
Pattern p = Pattern.compile(regex);
Matcher pm = p.matcher(str);
system.debug('----11111111111---'+ pm.find()); 

Any help would be appreciated
Our client is using Netscaler, they have put client cert as OPTIONAL and handeling certificate authentication at application layer i.e. PHP code.
It works for them in internal testiing using curl etc but when we ping through Salesforce it fails.

In logs it shows Client certificate not sent. I checked this article, this should be condition for sending certificate 
https://help.salesforce.com/apex/HTViewSolution?id=000180836&language=en_US

When I ping same certificates to another normal tomcat server, it works fine.

Can anybody tell what specific setting is required at Netscalar level to make it working

Any help would be appreciated
 
How to implement the dependent behavior of this new feature (i.e. enabling Country and State picklist in Org). On standard contact page it shows depent behavior automatically but when we bind these field with in VF page the dependent behavior is lost

Is there a simple way to implement this behavior in VF page

Any help would be appreciated
 
I have created a csr and trying to get a trial certificate to upload but the external system is asking for certificate as well as Key, Is it possibe to extract Keys for my certificate from salesforce
I have uploaded a certificate. I have created a vf page to enter its name but as a part of validation I need to check if certificate name is correct i.e. whether that certificate exists in my org (uploaded in org)

Though I know it throws an an error during callout but is there a way to check before hand i.e. at the time of giving certificate name in my vf page

Thanks in advance
Normally we get ghost user when we installed a managed package, Is there a way I can get the name/profile of the logged-in user who installed the package? I have checked some articles which says that there are some package properties as 'Installed By' or 'Created By' . But how to access these in Apex. 
What I want is : I want to enable certain parts of my application which is either accessible by Admin-profile or by the user who istalled the package?

 
I am using analytics API. I parse resuting Json through Report Parser Class. This worked when there is no currency field selected. As soon as I fetch currency field in report. This parser class gets crashed with message "Illegal value for primitive" at line

reportData = (ReportWrapper)JSON.deserialize(jsonString, ReportWrapper.class);

Please find below both Parser class and Json string with currency field which when passed gets crashed.
Could you please help me modifying the parser class to accomodate currency field
(There is also some difference for currency fields and other fields which comes like array/object -- see below vs normal field
Currency = {"label":"$10.00","value":{"amount":10,"currency":null}},
Normal field = {"label":"1/11/2015","value":"2015-01-11"} )

public static ReportWrapper parseReport(String reportId){
        Http http = new Http();
        HttpRequest httpReq = new HttpRequest();
        HttpResponse httpRes = new HttpResponse();
       
        httpReq.setMethod('GET');
        httpReq.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId());
        httpReq.setEndpoint( getAnalyticAPIEndpoint(reportId) );
        
        String jsonString = '';

        jsonString = httpRes.getBody();
        jsonString = jsonString.left(jsonString.indexOf('T!T'))+'tXXXXXt'+jsonString.subString(jsonString.indexOf('T!T')+3,jsonString.length());
        System.debug('@@@@@@@@@@@@Body : jsonString :' +jsonString);
        //jsonString = jsonString.replaceAll('T!T','tXXXXXt');
        ReportWrapper reportData;
        try{
           reportData = (ReportWrapper)JSON.deserialize(jsonString, ReportWrapper.class);
        }catch(Exception e){
            System.debug(e.getMessage() + ' : StackTrace ' + e.getStackTraceString());
        }
        System.debug('@@@@@@@Report Data after parsing: '+reportData);
        
        
       
         ReportDataWrapper factMap = (ReportDataWrapper)JSON.deserialize(jsonString, ReportDataWrapper.class);
         System.debug('@@@@@>>     '+factMap);
        //httpRes.getBody();*/
        return reportData;
    }
 public class ReportWrapper{
        public boolean hasDetailRows{set; get;}
        public ReportAttributesWrapper attributes{set; get;}
        public GroupingWrapper groupingsDown{set; get;}
        public GroupingWrapper groupingsAcrosss{set; get;}
        public ReportDataWrapper factMap{set; get;}
        //public Map<String, NewTableWrapper> factMap{set; get;}
        public boolean allData{set; get;}
        public ExtendedMetadataWrapper reportExtendedMetadata{set;get;}
        public MetadataWrapper reportMetadata{set; get;}
    }
    
    public class ReportAttributesWrapper{
        public String instancesUrl {set; get;}
        public String describeUrl {set; get;}
        public String type {set; get;}
        public String reportId {set; get;}
        public String reportName {set; get;}
    }
    public class GroupingWrapper{
        public List<String> groupings{set; get;}
    }
    public class ReportDataWrapper{
        public NewTableWrapper tXXXXXt{set; get;}
    }
    public class NewTableWrapper{
        public List<RowWrapper>rows{set; get;}
        public List<AggregateWrapper> aggregates{set; get;}
    }
    public class TableWrapper{
        public List<RowWrapper> rows{set; get;}
        public CellWrapper aggregates{set; get;}
    }
    public class RowWrapper{
        public List<CellWrapper> dataCells{set; get;}
    }
    public class CellWrapper{
        public String value{set; get;}
        public String Label{set; get;}
    }
    public class AggregateWrapper{
        public long value{set; get;}
        public String label{set; get;}
    }
    public class ExtendedMetadataWrapper{
        public Map<String,ColumnInfo> detailColumnInfo{set; get;}
        public Map<String,Map<String,String>> aggregateColumnInfo{set; get;} 
        public GroupingColumnInfo groupingColumnInfo{set;get;}
    }
    public class ColumnInfo{
        public String dataType{set; get;}
        public String label{set; get;}
    }
    public class MetadataWrapper{
        public String Name{set;get;}
        public String id{set;get;}
        public List<String> aggregates{set; get;}
        public List<GroupingWrapper> groupingsDown{set; get;}
        public List<GroupingWrapper> groupingsAcross{set; get;}
        public boolean reportBooleanFilter{set;get;}
        public List<FilterWrapper> reportFilters{set; get;}
        public List<String> detailColumns{set; get;}
        public String developerName{set; get;}
        public ReportType reportType{set; get;}
        public String currencyValue{set; get;}
        public String reportFormat{set; get;}
    }
    
    public class FilterWrapper{
        public String value{set; get;}
        public String column{set; get;}
        public String operator{set; get;}
    }
    public class ReportType{
        public String type{set; get;}
        public String label{set; get;}
    }
    public class GroupingColumnInfo{
        
    }
 

JSON String:

{"attributes":{"describeUrl":"/services/data/v29.0/analytics/reports/00OC00000065lGJMAY/describe","instancesUrl":"/services/data/v29.0/analytics/reports/00OC00000065lGJMAY/instances","reportId":"00OC00000065lGJMAY","reportName":"my report","type":"Report"},"allData":true,"factMap":{"tXXXXXt":{"aggregates":[{"label":"2","value":2}],"rows":[{"dataCells":[{"label":"006C000000qCLto","value":"006C000000qCLtoIAG"},{"label":"Op2","value":"006C000000qCLtoIAG"},{"label":"-","value":null},{"label":"1/31/2015","value":"2015-01-31"},{"label":"-","value":null},{"label":"Prospecting","value":"Prospecting"},{"label":"10%","value":10},{"label":"Q1-2015","value":"Q1-2015"},{"label":"185","value":185},{"label":"7/13/2014","value":"2014-07-14"},{"label":"Nikhil Jain Dev","value":"005C000000609M2IAI"},{"label":"-","value":null},{"label":"Simplion","value":"001C000001FeLDvIAN"}]},{"dataCells":[{"label":"006C000000w65py","value":"006C000000w65pyIAA"},{"label":"Op1","value":"006C000000w65pyIAA"},{"label":"$10.00","value":{"amount":10,"currency":null}},{"label":"1/11/2015","value":"2015-01-11"},{"label":"-","value":null},{"label":"Qualification","value":"Qualification"},{"label":"10%","value":10},{"label":"Q1-2015","value":"Q1-2015"},{"label":"7","value":7},{"label":"1/7/2015","value":"2015-01-07"},{"label":"Nikhil Jain Dev","value":"005C000000609M2IAI"},{"label":"-","value":null},{"label":"Deimple Acnt","value":"001C000001HP9P5IAL"}]}]}},"groupingsAcross":{"groupings":[]},"groupingsDown":{"groupings":[]},"hasDetailRows":true,"reportExtendedMetadata":{"aggregateColumnInfo":{"RowCount":{"acrossGroupingContext":null,"dataType":"int","downGroupingContext":null,"label":"Record Count"}},"detailColumnInfo":{"OPPORTUNITY_ID":{"dataType":"id","label":"Opportunity ID"},"OPPORTUNITY_NAME":{"dataType":"string","label":"Opportunity Name"},"EXP_AMOUNT":{"dataType":"currency","label":"Expected Revenue"},"CLOSE_DATE":{"dataType":"date","label":"Close Date"},"NEXT_STEP":{"dataType":"string","label":"Next Step"},"STAGE_NAME":{"dataType":"picklist","label":"Stage"},"PROBABILITY":{"dataType":"percent","label":"Probability (%)"},"FISCAL_QUARTER":{"dataType":"string","label":"Fiscal Period"},"AGE":{"dataType":"int","label":"Age"},"CREATED_DATE":{"dataType":"datetime","label":"Created Date"},"FULL_NAME":{"dataType":"string","label":"Opportunity Owner"},"ROLLUP_DESCRIPTION":{"dataType":"string","label":"Owner Role"},"ACCOUNT_NAME":{"dataType":"string","label":"Account Name"}},"groupingColumnInfo":{}},"reportMetadata":{"aggregates":["RowCount"],"currency":null,"detailColumns":["OPPORTUNITY_ID","OPPORTUNITY_NAME","EXP_AMOUNT","CLOSE_DATE","NEXT_STEP","STAGE_NAME","PROBABILITY","FISCAL_QUARTER","AGE","CREATED_DATE","FULL_NAME","ROLLUP_DESCRIPTION","ACCOUNT_NAME"],"developerName":"my_report","groupingsAcross":[],"groupingsDown":[],"id":"00OC00000065lGJMAY","name":"my report","reportBooleanFilter":null,"reportFilters":[],"reportFormat":"TABULAR","reportType":{"label":"Opportunities","type":"Opportunity"}}}
If I run below query in query editor it runs fine and give all fields but in Apex or execute anomynous it gives just CaseNumber, ContactId, ID.

List<sObject> lst = [SELECT CaseNumber, Contact.FirstName, Contact.LastName, Contact.Email, ContactId, Id FROM Case  WHERE ID IN('500o0000001OaQsAAK','500o0000001OaR0AAK','500o0000001OaQeAAK') and Contact.Email <> null order by CaseNumber limit 10000];
System.debug(lst);

Any help would be appreciated
 
I have 83% of test coverage when I run 'run All' test. But when I try to upload a pckage from same org it failes saying 73%. What could be the possible reason of this fall of 10%

Regards
Gaurav
Hi,

We created a managed package and istalled in sandbox. We have a batch which failed with this error

First error: No such column 'myPrefix__Campaign__c' on entity 'myPrefix__XYZObject__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the de...

However the column very well exists there and If I use developer consol to to run query select myPrefix__Campaign__c from myPrefix__XYZObject__c the query runs perfect.

In my dev org this is working fine.

Any guess on this issue

Regards
Gaurav Khare
I have an excel sheet with zip to user mapping. Now Accounts with those zip needs to be mapped with corresponding userid. For this I followed following approach,
I created a custom object (to upload data via loader) with user look-up--> written a before insert trigger on custom object to fetch user Id based on name. Now while writing After Insert trigger I would need some zip-account mapping (can be multiple accounts per Zip) but I stuck keeping Select out for loop which would break definately as there are almost 50 K records, Could you please help me with After trigger with optimized code or any altogether different approach.
We need some email to case setup along with workflow i.e to a group of ppl as L1 and then upon approval to L2/L3 another group of people (emailIds)
I want to execute one Apex funxtion. I have created a class that implements schedulable in execute method I am writing a cron

... execute{
system.schedule( XYZ...)
myclass.function()
}

but when I go and see in setup/schedule jobs there are no jobs, do I need to do it from dveloper cconsol. I dont want to do this as I am creating a managed package so I just want as soon as my package gets installed a hourly job gets scheduled

I am trying to connect with Git Hub via http,  it gets connected [respone 200] then when I try to get data it just returns [response 200 OK] but return no data. However when I am using by curl it returm complete Json data. Why it is not working with http request: Please find code below

         HTTP h = new HTTP();
          HTTPRequest r = new HTTPRequest();
          r.setEndpoint('https://api.github.com/user');
          Blob headerValue = Blob.valueOf(sUsername + ':' + sPassword);
          String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
          r.setHeader('Authorization', authorizationHeader);
          r.setHeader('If-Modified-Since', 'Thu, 05 Jul 2012 15:31:30 GMT');
          r.setHeader('Accept', 'application/json');
          r.setHeader('Content-Type', 'application/json');
          r.setMethod('GET');
          String strResp ;
          try
          {
              HTTPResponse resp1 = h.send(r);
              strResp = resp1.toString();
              ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.INFO,strResp);
              ApexPages.addMessage(myMsg);
              return strResp;

          }catch (Exception e)
          {}

With CURL
>curl -i -k -u <User>:<pwd> https://api.github.com/user -H "If-Modified-Since: Thu, 05 Jul 2012 15:31:30 GMT" > gitgub3.txt

Also, r.setEndpoint('https://api.github.com/repos/<username>/testing'); send data with CURL and send response OK with code

Any suggestion???

Hi All,

 

I am using the Metadata API to add custom fields to a custom object.

 

The custom fields created should be identical in terms of field type to existing standard or custom fields in other standard or custom objects. For instance, I need to create a custom field that is of the same type as the Account Shipping Street.

 

The Account.ShippingStreet in salesforce is of type: textarea and length 255

 

When using the Metadata API to create a custom field of the same type, the field created ends up being of type: string and length 255, instead of type textarea.

 

I am using the deploy() method of the Metadata API so I create the package.xml file on the fly and deploy it. The <type> element in the file is textarea, and the <length> is 255.

 

Any ideas what I am missing here would be much appreciated.

 

Fernando