• Aruna
  • NEWBIE
  • 125 Points
  • Member since 2010

  • Chatter
    Feed
  • 4
    Best Answers
  • 4
    Likes Received
  • 0
    Likes Given
  • 91
    Questions
  • 135
    Replies
Hello everyone,

We do have requirement where in trigger need to check only some fields changed in the trigger dynamically.
I know generally we do by using old and new values in trigger to check if the field values are changed.
Oldmap.Fieldname__c!=new.FieldName__c
But our requirement instead of using field in the code dynamically need to get only some field and check if they have changed the data.
That means we do not want list each and every field api name .
Want to get field API name with old and new values dynamically.
is this possible.
I was looking at some blog where we can get all the fields but I want only some fields
https://developer.salesforce.com/forums/?id=906F00000008xFXIAY

is this possible to get dynamically get only get couple of fields changed in the apex code (trigger) if it can any on please send sample code.
  • August 07, 2020
  • Like
  • 0
I Hellow friends,

We have a javascript button in classic on a custom object related lisWhenWen the button is clicked it will open the task edit page by passing record type id and some other default values to URL. below is the code.
if({!Iobject.filedname}==false) 
{ 
window.alert("You must integration the some record to someother system before using this button"); 
} 
else{ 
var uri="/00T/e?recordtype=012j0000000m7fb&tsk3={! object.Name}&00N11000001sBSr={!object.RecordType}&tsk4={!Today()}&00Nj000000Alu1e={!Today()}&tsk3_lkid={!object.Id}&tsk12=Completed&00N0a00000Bzln4=ProdashInt-SFIntServices005j000000Bydz4&retURL={!object.Id}"; 

var res = encodeURI(uri); 

window.open(res,"_parent"); 
}
I am trying to convert above javascript button into lighting action. I am struggling to get the task edit page with some parameters passed to url .

I mean how do I convert below URL into lighting  working URL

var uri="/00T/e?recordtype=012j0000000m7fb&tsk3={! object.Name}&00N11000001sBSr={!object.RecordType}&tsk4={!Today()}&00Nj000000Alu1e={!Today()}&tsk3_lkid={!object.Id}&tsk12=Completed&00N0a00000Bzln4=ProdashInt-SFIntServices005j000000Bydz4&retURL={!object.Id}";
var res = encodeURI(uri);
window.open(res,"_parent");

Thanks In advance.

 
  • February 01, 2019
  • Like
  • 0
Hello every one ,
We have a Javascript button which calls the web service method.  Below is the code 
 
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")}

if (!window.createxxAccountInProgress) {
window.createxxAccountInProgress = true;
var result = sforce.apex.execute("RelatedxxAccountActions","CreatexxxAccount", {relatedxxAccountId:" {!Related_xxx_Account__c.Id}"});
result = JSON.parse(result[0]);
window.createxxxAccountInProgress = false;
if (!result || !result.isSuccess) {
alert("An error occurred and your xxxx Account was not created. Please try again." +
result && result.errorMessage 
? '\r\n' + result.errorMessage
: '');
}
else {
alert("Create xxxx Account request was sent successfully.");
}
}
can anyone please suggest me how do i convert above Javascript button into lighting quick action.

Thank you,
Aruna.
  • January 30, 2019
  • Like
  • 0
Hi friends,

We are having custom List view Buttons on Account, Contacts, Lead, Case, Opportunity, and on other custom objects which does export all the objects listview records.
I did create a Listview Quick Action in Search Layout (Lighting) by using Lighting component. The quick action is not visible.

I was reading some blog if you create a Listview quick action using lighting component it is not visible only you can do is create, update and task.
can any please confirm can we create a Listview quick action using Lighting component if it is can we create.
 
  • January 30, 2019
  • Like
  • 0
Hi I need to access the helper2 variable in the helper1 method for example
 
Sample apex class

Public class SampleApexCls{


 @AuraEnabled
  public static List<String> testSmapleMethod(){
     //some code here
      Return ListofValues;
   }
 @AuraEnabled
  public static Map<Id,String> testSmapleMethod2(){
     //some code here
      Return map;
   }

}
 
({
	getSmapleData :function(component){

        var action=component.get("c.testSmapleMethod");
		action.setCallback(this,function(response){
			var returnValue=response.getReturnValue();
		
                     this.getSmapleData1 (component) // I know how to call the funcation
                   // Whant to get "returnValue2" results in this method.

		});

	},
	getSmapleData1 :function(component){
		var action=component.get("c.testSmapleMethod2");
		action.setCallback(this,function(response){
			var returnValue2=response.getReturnValue();
		
		});
	}
})
how do I access "returnValue2" in  "getSmapleData"  funcation.
can  "getSmapleData1" return some value.

can any please help to get the one funcation values or varaible to display in other funcation like how we do in general apex class

 
  • January 25, 2019
  • Like
  • 0
Hi, I am trying to convert below javascript button into a lighting component.

{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 
// query the record 
var qr = sforce.connection.query("SELECT Id, SyncedQuoteId FROM Opportunity where Id='" + "{!Opportunity.Id}" + "'"); 
var records = qr.getArray("records"); 

var qr1 = sforce.connection.query("SELECT Id, OpportunityId FROM Quote where OpportunityId='" + "{!Opportunity.Id}" + "'"); 

// display the field from the query 
var recTypeId='{!Opportunity.RecordTypeId}'; 

var oppQuoteId=qr.records.SyncedQuoteId; 
var quoteRecord=qr1.getArray("records"); 

if((recTypeId=='{!$Setup.Opportunity_Record_Types__c.New_Record_Type_Id__c}' || 
recTypeId=='{!$Setup.Opportunity_Record_Types__c.Pilot_Record_Type_Id__c}' || 
recTypeId=='{!$Setup.Opportunity_Record_Types__c.Renew_Upsell_Record_Type_Id__c}') 
&& (oppQuoteId==null && quoteRecord!='')) { 
window.alert("There is a root quote already attached to this Opportunity. If you need assistance with this opportunity, please reach out to xxxxx "); 

else {
window.open ("http://{!$Setup.Integration_Settings__c.Quoting_Tool_URL__c}/reps/xxxxx.aspx?SFAccountId={!CASESAFEID(Opportunity.AccountId)}&SFOppId={!CASESAFEID(Opportunity.Id)}"); 
}

Lighting component

<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction" access="global" >
    <aura:handler name="init" value="{!this}" action="{!c.oppRecordTypes}"/>
    <!--<aura:attribute name="Opportunity" type="Opportunity" />-->
    
    <aura:attribute name="recordId" type="String" />
    <aura:attribute name="syncedQuoteId" type="String" />
    <aura:attribute name="quoteId" type="String" />
    <aura:attribute name="lstOfRecordType" type="String[]" />
    <aura:attribute name="lstOfCutomObjectRecordType" type="String[]" />
   
 </aura:component>

Javascript controller
({
    oppRecordTypes : function(component, event, helper) {
        var action=component.get("c.oppRecordTypes");
       // action.setParams({"objectName" : Opportunity});
        action.setParams({"recordId" : component.get("v.recordId")});
        action.setCallback(this,function(response){
           var state = response.getState();
            if(state=="SUCCESS"){
                component.set("v.lstOfRecordType",response.getReturnValues());
                var oppRecordTypeNamesList=response.getReturnValues();                
                console.log("Record type names11="+oppRecordTypeNamesList);
                          
                var syncedQuoteId=component.get("c.getSyncedQuoteId");
                console.log("oppSyncedQuoteId111=" + syncedQuoteId);
                               
                var quoteId=component.get("c.getQuoteId");
                console.log("oppquoteId111=" + quoteId);
                
                var oppCustomRecordTypeNamesList=component.get("c.getOppCutomRecordTypes");
               console.log("oppCustomRecordTypeNamesList11="+oppCustomRecordTypeNamesList);                
            }
            else{
                console.log("cannot get record type names");
            }            
        } );
    },
        getSyncedQuoteId : function(component,event,helper){
        var action=component.get("c.getSyncedQuoteId");
        action.setParams({"oppId" : component.get("v.recordId")});
        action.setCallback(this,function(response){
            var state = response.getState();
            if(state="SUCCESS"){
                component.set("v.syncedQuoteId",response.getReturnValues());
                var oppSyncedQuoteId=response.getReturnValues();           
                console.log("oppSyncedQuoteId=" + oppSyncedQuoteId);
                            }
            else{
                console.log("cannot get syncedQuote ID");
            }
        });
    },
     getQuoteId : function(component,event,helper){
        var action=component.get("c.getQuoteId");
        action.setParams({"oppId" : component.get("v.recordId")});
        action.setCallback(this,function(response){
            var state=response.getState();
            if(state="SUCCESS"){
                componet.set("v.quoteId",response.getReturnValues());
                var oppQuoteId=response.getReturnValues();
                console.log("oppQuoteId="+oppQuoteId);
            }
            else{
                console.log("cannot get quote id")
            }
        });
    },    
    getOppCutomRecordTypes :function(component,event,helper){
        var action=component.get("c.getOppCutomRecordTypes");
        action.setCallback(this,function(response){
            var state=response.getState();
            if(state="SUCCESS"){
                component.set("v.lstOfCutomObjectRecordType",response.getReturnValues());
                var oppCustomRecordTypeNamesList=response.getReturnValues();
                   
                console.log("oppCustomRecordTypeNamesList="+oppCustomRecordTypeNamesList);
            }
            else{
                console.log("cannot get custom report type names");
            }
        });        
    }
})
APEX Class
public class AttachQuoteCntrl {
    public static List<String> recordTypeNames;
    
    @AuraEnabled     
    public static List<String> oppRecordTypes(){
         List<Schema.RecordTypeInfo> recordtypes = Schema.getGlobalDescribe().get('Opportunity').getDescribe().getRecordTypeInfos();    
         recordTypeNames=new List<String>();
         for(RecordTypeInfo rt : recordtypes){
            recordTypeNames.add(rt.getName());
        }    
        System.debug('********recordTypeNames='+recordTypeNames);
        
        return recordTypeNames;
    }
    @AuraEnabled 
    public static string getSyncedQuoteId(string oppId){
        Opportunity oppSyncedQuote= [Select id,SyncedQuoteId from opportunity where Id=:oppId limit 1];
        string syncedQuoteId=oppSyncedQuote.SyncedQuoteId;
        System.debug('********syncedQuoteId='+syncedQuoteId);
        return syncedQuoteId;
    }
    
    @AuraEnabled 
    public static string getQuoteId(string oppId){
        Quote oppQuote= [Select id,OpportunityId from Quote where OpportunityId=:oppId limit 1];
        string QuoteId=oppQuote.id;
        System.debug('********QuoteId='+QuoteId);
        return QuoteId;
    }
    
    @AuraEnabled 
    public static Opportunity_Record_Types__c getOppCutomRecordTypes(){
        return Opportunity_Record_Types__c.getInstance();
    }
}

I am unable to see the console.log in javascript console(developer tools)
can any please correct my code I am sure something is wrong with the code I am able to save the code and added quick action lighting component.
when clicking the quick action, first of all, I want to see if the records are coming are not in the console log.I am understanding why I am unable to see the logs in the developer tools console.
Please help me 



 
  • January 23, 2019
  • Like
  • 0
Hello everyone,

now we are moving from classic to lighting I need to convert all the javascript button to lighting.
We have a custom button which has below url on it

window.open('/apex/vfpagename?id=xxxxx'); 
User-added image
how do I replace window.open  in lighting and I want the button to work both in lighting and in classic.
Can any please help me on this if any sample code will be appreciated.

Thank you,
Aruna.
 
  • December 20, 2018
  • Like
  • 0
Hi is anyone got the solution to this sorting problem.

I am unable to do descending order sorting.
My requirement is I have map Of <Id,Name>  when user click on the link the map values need to sort either ascending or descending order

Example If the Map values contain
Map.put(id1,Name1);  
Map.put(id3,Name3);  
Map.put(id2,Name2);  
Map.put(id5,Name5);  
Map.put(id6,Name6);  
Map.put(id4,Name4);  

Result for ascending 
Map.put(id1,Name1);  
Map.put(id2,Name2);  
Map.put(id3,Name3);  
Map.put(id4,Name4);  
Map.put(id5,Name5);  
Map.put(id6,Name6); 

Result for desendoing\

Map.put(id6,Name6);  
Map.put(id5,Name5);  
Map.put(id4,Name4);  
Map.put(id3,Name3);  
Map.put(id2,Name2);  
Map.put(id1,Name1); 

I did use different methods to solve this but nothing is working me out. Please, anyone, help me out I need to solve this issue.
One ve page I need to display these values.

Thank you
Aruna
  • May 30, 2018
  • Like
  • 0
Hello,

is anyone has written recently salesforce platform developer -1 exam.  I think Salesforce changed the pattern.
Can any please let me know if you have latest dumps.


Thank you.
  • March 01, 2018
  • Like
  • 2
Hello there,

I am creating 2 pablock section . which display data with checkbox's and select all check box for each section .
when I am selecting top section select all chekbox it is also selecting below check checkbox data and If  i am using mutilple object getting too many quiry error also.
below is the class and vf page. can any one please solve this issue. an

public class Checkbox_Class
{

 
    List<accountwrapper> accountList = new List<accountwrapper>();
    List<accountwrapper_Two> accountList2 = new List<accountwrapper_Two>();
    List<Account> selectedAccounts = new List<Account>();

    public List<accountwrapper> getAccounts()
    {
        for(Account a : [select Id, Name, AccountNumber, Phone from Account ])
        accountList.add(new accountwrapper(a));
        return accountList;
    }
     public List<accountwrapper_Two> getAccounts2()
    {
        for(Account a : [select Id, Name, AccountNumber, Phone from Account ])
        accountList2.add(new accountwrapper_Two(a));
        return accountList2;
    }

    public PageReference getSelected()
    {
        selectedAccounts.clear();
        for(accountwrapper accwrapper : accountList)
        if(accwrapper.selected == true)
        selectedAccounts.add(accwrapper.acc);
        return null;
    }
      public PageReference getSelected2()
    {
        selectedAccounts.clear();
        for(accountwrapper_Two accwrapper2 : accountList2)
        if(accwrapper2.selected == true)
        selectedAccounts.add(accwrapper2.acc);
        return null;
    }

    public List<Account> GetSelectedAccounts()
    {
        if(selectedAccounts.size()>0)
        return selectedAccounts;
        else
        return null;
    }    

    public class accountwrapper
    {
        public Account acc{get; set;}
        public Boolean selected {get; set;}
        public accountwrapper(Account a)
        {
            acc = a;
            selected = false;
        }
    }
     public class accountwrapper_Two
    {
        public Account acc{get; set;}
        public Boolean selected {get; set;}
        public accountwrapper_Two(Account a)
        {
            acc = a;
            selected = false;
        }
    }
}
vf page

<!-- http://tablesorter.com/docs/-->
<apex:page controller="Checkbox_Class" Tabstyle="Account">
    
    <apex:includeScript value="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" />
    <apex:includeScript value="//cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.17.8/js/jquery.tablesorter.min.js" />
    <apex:stylesheet value="//cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.17.8/css/theme.blue.css" />

    
    <apex:form >
     
        <apex:pageBlock Title="Accounts with CheckBoxes">
            <apex:pageBlockSection Title="List of Available Accounts">
                <apex:dataTable value="{!accounts}" var="a" columnswidth="50px,50px" cellpadding="4" border="1" id="accsTable" styleclass="tablesorter">
                    <apex:column >
                        <apex:facet name="header"> <apex:inputCheckbox >
                            <apex:actionSupport event="onclick" action="{!GetSelected}" onsubmit="checkAll(this)" reRender="Selected_PBS"/>
                            </apex:inputCheckbox>
                        </apex:facet>
                        <apex:inputCheckbox value="{!a.selected}" id="checkedone">
                        <apex:actionSupport event="onclick" action="{!GetSelected}" rerender="Selected_PBS"/></apex:inputCheckbox>
                    </apex:column>
                    <apex:column headervalue="Account Name" value="{!a.acc.Name}" />
                    <apex:column headervalue="Account Number" value="{!a.acc.AccountNumber}" />
                    <apex:column headervalue="Phone" value="{!a.acc.Phone}" />
                </apex:dataTable>
            </apex:pageBlockSection>
            
            
            <apex:pageBlockSection Title="List of Available Accounts">
                <apex:dataTable value="{!accounts2}" var="a" columnswidth="50px,50px" cellpadding="4" border="1" id="accsTable" styleclass="tablesorter">
                    <apex:column >
                        <apex:facet name="header"> <apex:inputCheckbox >
                            <apex:actionSupport event="onclick" action="{!GetSelected2}" onsubmit="checkAll2(this)" reRender="Selected_PBS"/>
                            </apex:inputCheckbox>
                        </apex:facet>
                        <apex:inputCheckbox value="{!a.selected}" id="checkedone2">
                        <apex:actionSupport event="onclick" action="{!GetSelected2}" rerender="Selected_PBS"/></apex:inputCheckbox>
                    </apex:column>
                    <apex:column headervalue="Account Name" value="{!a.acc.Name}" />
                    <apex:column headervalue="Account Number" value="{!a.acc.AccountNumber}" />
                    <apex:column headervalue="Phone" value="{!a.acc.Phone}" />
                </apex:dataTable>
            </apex:pageBlockSection>

        </apex:pageBlock>
    </apex:form>
    <script>
        function checkAll(cb)
        {
            var inputElem = document.getElementsByTagName("input");
            for(var i=0; i<inputElem.length; i++)
            {
                if(inputElem[i].id.indexOf("checkedone")!=-1)
                inputElem[i].checked = cb.checked;
            }
        }
         function checkAll2(cb)
        {
            var inputElem = document.getElementsByTagName("input");
            for(var i=0; i<inputElem.length; i++)
            {
                if(inputElem[i].id.indexOf("checkedone2")!=-1)
                inputElem[i].checked = cb.checked;
            }
        }
        
      $(document).ready(function()
      {
        $("[id$='accsTable']").tablesorter({theme: 'none', dateFormat : "dd/mm/yyyy"});
      });

    </script>
</apex:page>
  • February 02, 2018
  • Like
  • 0
Hello,

We do have salesforce classic right now. in future, we are going to roll out to lighting.
the visual force pages whatever I am going to develop in classic version should be lighting friendly i,e, when we roll out to lighting the vf page, should not give any issue.
my question is when I am developing vf page in the classic version is it enough to use  lightningStylesheets="true" or should I develop vf page using lighting API.
Can anyone please guide how can develop vf page in a classic which can be used both in classic and lighting.

If I need to develop using lighting API, please give some example 
the page should display table formate  account records with checkboxes and sortable header's




 
  • January 26, 2018
  • Like
  • 0
Hello,

on vf page When I am displaying user full name and LastModifiedDate field. The LastmodifiedDate filed is displaying UK date and time.

User-added image the above date/ timr should be 2017-08-11 7:57:44

I did  used LastModifiedDate .format('YYYY-MM-DD hh:mm:ss','EST') 
can anyone please help how can display lastmodifieddate from UK time zone  to USA time zone

Thank you,
Aruna.
  • November 09, 2017
  • Like
  • 0
Hello there,

When record manually deleted in salesforce send that record id to other system as URL parameter.
I know it is asynchronous process with @future(callout=true).
I was looking at the HttpRequest  API document I did not find the method to set parameters and send to as request.
instead of sending JSON file in the body send as URL parameter.
Can anyone suggest me how can I send URL parameters to other systems using HttpRequest .

Thank you.



 
  • February 02, 2017
  • Like
  • 0
Hello there,

I am having below requirement.
In salesforce when a record is updated then send data of that record to external system using reset API JSON file.
I have written below code but I am not sure whether I am going in right direction 

Trigger

rigger ImplementationPlanActivity on Implementation_Plan_Activity__c (after update) {
    Trigger_Settings__c triggerSettings = Trigger_Settings__c.getInstance();
    if(triggerSettings.ImplementationPlanActivity__c == false){
        return;
    }
            set<Id> IPAIdSet=new Set<Id>();
            for(Implementation_Plan_Activity__c IPArecord : trigger.new ){
                IPAIdSet.add(IPArecord .id);
            }
            IPAResetAPIClass.IPAData(IPAIdSet);

        }
    }
Webservice class

global class IPAResetAPIClass{
@future(callout=true)
    global static void IPAData(Set<Id> newIPASetId){
    
        List<Implementation_Plan_Activity__c> ipaNewList=[SELECT id,Name,
                                                                    Account_Manager__r.Name,
                                                                    Account_Manager__r.Email,
                                                                    Account_Specialist__r.Name,
                                                                    Account_Specialist__r.Email,    
                                                                    SFID18__c ,
                                                                    RecordTypeId
                                                            FROM Implementation_Plan_Activity__c where Id IN : newIPASetId];
        
        List<impWarpperClass> warpperIPAList=new List<impWarpperClass>();
        
            warpperIPAList.add(new impWarpperClass(ipaNewList[0].id,
                                                    ipaNewList[0].Name,
                                                    ipaNewList[0].Account_Manager__r.Name,
                                                    ipaNewList[0].Account_Manager__r.Email,
                                                    ipaNewList[0].Account_Specialist__r.Name,
                                                    ipaNewList[0].Account_Specialist__r.Email,
                                                    ipaNewList[0].SFID18__c,
                                                    ipaNewList[0].RecordTypeId));
        
 
       RecordType recordTypeRecord=[Select id,Name from RecordType  where id=:ipaNewList[0].RecordTypeId limit 1];
       
       string  resource=null;
       if(recordTypeRecord.Name=='Auto Provisioning'){
           resource='Auto Provisioning';
       }
       else if(recordTypeRecord.Name =='Workbook'){
           resource='Workbook';
        }      
        system.debug('*********warpperIPAList='+warpperIPAList);
        
        string JSONString=JSON.serializePretty(warpperIPAList);
        system.debug('*********serialized imp='+JSONString);
        
        string endURL;
        
        endURL=geURL+resource+'/'+ipaNewList[0].id;
        system.debug('*********endURL='+endURL);
        HttpRequest req=new HttpRequest();
        //Set HttpRequest Method
        req.setMethod('POST');
      
        req.setHeader('content-type', 'application/json');
        //Set HTTPRequest Endpoint dummy url
        req.setEndpoint('http://requestb.in/13auzf41');
        //req.setEndpoint(endURL);
        
        //Set HTTP Request Body
        req.setBody(JSONString);
        Http http = new Http();
        try{
            HTTPResponse res = http.send(req);
            //Helpful debug messages
            System.debug(res.toString());
            System.debug('STATUS:'+res.getStatus());
            System.debug('STATUS_CODE:'+res.getStatusCode());
            System.debug('Content: ' + res.getBody());
            
            //we can create success object record
        }
        catch(Exception e){
            System.debug('******* error message='+e);
            //we can create error object record
        }
    
    }
    
    global class impWarpperClass{
    
        global string IPAId{get;set;}
        global string IPAName{get;set;}   
        global string IPAAccManagerName{get;set;}   
        global string IPAAccManagerEmail{get;set;} 
        global string IPAAccSpecialListrName{get;set;}   
        global string IPAAccSpecialListEmail{get;set;} 
           
        global string IPASFDCId{get;set;}
        global string IPARecordTypeId{get;set;}
        
        global impWarpperClass(string IPAId,string IPAName,
                                        string IPAAccManagerName,
                                        String IPAAccManagerEmail,
                                        string IPAAccSpecialListrName,
                                        string IPAAccSpecialListEmail,
                                        string IPASFDCId,
                                        string IPARecordTypeId){
            this.IPAId=IPAId;
            this.IPAName=IPAName;
            this.IPAAccManagerName=IPAAccManagerName;
            this.IPAAccManagerEmail=IPAAccManagerEmail;
            this.IPAAccSpecialListrName=IPAAccSpecialListrName;
            this.IPAAccManagerEmail=IPAAccSpecialListEmail;
            this.IPASFDCId=IPASFDCId;
            this.IPARecordTypeId=IPARecordTypeId;
            
        }
       
    }
  
       }

}
am I going right dirction. is this correct way to send data from salesforce to external system using rest api JSON file.
If I am wrong can any please let me know how can I expose salesforce data to external system when records is updted in salesforce.
Thank you.
  • December 28, 2016
  • Like
  • 0
Hello there,

I have created a Github remote repository and also created local branch and did some changes and pushed all the way to remote repo master.
But when I login into salesforce sandbox I don't see those changes.

how do I sync Github remote master repo to salesforce sandbox.

Note : I am not using eclipse force.com ide to clone the git hub project. I am using Gitshell command prompt to clone and to create the local branches.

Please help me to see the changes which I have done in git hub in salesforce sandbox.


 
  • December 22, 2016
  • Like
  • 0
Hello,

I am trying to get the report information  like  what are the filters on the report by using  report metadata.
But I am getting below error

reports.MetadataException: Can't run the report because it doesn't have any columns selected. Be sure to add fields as columns to the report through the user interface.

below is my code 
List <Report> reportList = [SELECT Id,Name,DeveloperName FROM Report ORDER BY Name DESC];
     for(Integer i=0;i<reportList.size();i++){
         
         String reportId = (String)reportList.get(i).get('Id');
         String Name = (String)reportList.get(i).get('Name');
         
         Reports.ReportResults results = Reports.ReportManager.runReport(reportId);
         Reports.ReportMetadata rm = results.getReportMetadata();
         
        system.debug('---Name---'+Name);
         system.debug('---reportId---'+reportId);
         system.debug('---results'+results);
         system.debug('---rm'+rm);
          
         for(Reports.ReportFilter rf : rm.getreportFilters()){
             if(rf!=null){
                 system.debug('---col name---'+rf.getcolumn());
                 system.debug('---col value---'+rf.getValue());
             }
         }
 
Please let me know how do overcome with this error.
 
  • August 29, 2016
  • Like
  • 0
Hi there,

I know Batch class is asynchronous

I am having a requirement where the soql will get larger set of data with all the joining queries.
I need to display larger data   on excel sheet when I click on vf page button.

By using normal apex class soql  will only return 50,000 records . so I thought of using apex batch and process the soql and then display the results in excel sheet.

is it possible to display apex batch results on excel ? or is there any other where we can process more than 1 million data and display on excel sheet.
 
  • August 25, 2016
  • Like
  • 0
Hi there,

I am having 2 questions 
1) I have developed an excel workbook with different tabs  using visual force page  by using below api

<apex:page contentType="txt/xml#report.xls">
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40">
<Worksheet ss:Name="Summary"> <Table border="0" ss:StyleID="background" x:FullColumns="1" x:FullRows="1">
<Row ss:Height="25" ss:StyleID="background"> <Cell><Data ss:Type="String">&nbsp;</Data></Cell>
<Cell ss:StyleID="TableColHeader" ><Data ss:Type="String">Test1</Data></Cell>
<Cell ss:StyleID="TableColHeader" ><Data ss:Type="String">Test2 </Data></Cell>
</Worksheet>
</Workbook>
</apex:page>
I am able to generate but when I am trying to open it on mobile it is not opening. 
Can any one please let me know how can we open .xls file on mobile.

2)  On visualforce page I am having very long tables. when the users scroll down they want headers need to scroll down(float) .

I was doing google but didn't find  proper code sample with steps. everyone was saying use Jquery . but which version of Jquery and what are other steps.

Can any one please let me know  steps or sample code  how to do floating  table headers on visualforce page.

Thank you,


 
  • August 09, 2016
  • Like
  • 0
Hi there .

In production I need to schedule 2 schedule class one is 7:00 AM other one is @ 7:30 AM MON - FRI and JAN-DEC and 2016-2020.
I need confirmation is below script is correct ? is below script runs every day @ 7: AM and 7: 30 AM from MON-FRI and JAN-DEC and 2016-2020

//Scedule a class every day @ 7 AM except weekends from 2016-2020
//Seconds Minutes Hours Day_of_month Month Day_of_week optional_year
System.schedule('Sch1', '0 00 7 ? * MON-FRI 2016-2020', Sch1);

//Scedule a class every day @ 7 :30AM except weekends from 2016-2020
//Seconds Minutes Hours Day_of_month Month Day_of_week optional_year
System.schedule('Sch2', '0 30 7 ? * MON-FRI 2016-2020',Sch2);

Please any confirm  if it correct or not . if it is not please correct my script and send me .

Thank you:)
  • July 29, 2016
  • Like
  • 0
Hello there,

I need to display 2 different types of decimal place number one with one decimal like (300.4) and other with 2 decimal places like (192.56)
I did some search and I found below logic but still I am unable to display decimal places.
 
<apex:outputText value="{0, number, ###.##}">
     <apex:param value="{!amountVarienceValue}" />
  </apex:outputText>

 <apex:outputText value="{0, number, ###.#}">
     <apex:param value="{!amountVarienceValue}" />
  </apex:outputText>

Can please anyone just how to display decimal places on visual force page.

Thank you.
  • June 28, 2016
  • Like
  • 0
Hello,

is anyone has written recently salesforce platform developer -1 exam.  I think Salesforce changed the pattern.
Can any please let me know if you have latest dumps.


Thank you.
  • March 01, 2018
  • Like
  • 2
I am trying to create excel sheet with multiple tabs using visulaforce page .
I am facing some issues in formating number for example below cell is having number formate with comma separated but when I look @ out put excel sheet the number is not with comma 
<Cell ss:StyleID="s23"><Data ss:Type="Number">1,76,213</Data></Cell>
                <Cell ss:StyleID="s23"><Data ss:Type="Number">680</Data></Cell>
                <Cell ss:StyleID="s23"><Data ss:Type="Number">465</Data></Cell>
                <Cell ss:StyleID="s23"><Data ss:Type="Number">4,756</Data></Cell>
                
                <Cell ss:StyleID="s23"><Data ss:Type="Number">4,566</Data></Cell>
                <Cell ss:StyleID="s23"><Data ss:Type="Number">4,35,353</Data></Cell>
                <Cell ss:StyleID="s23"><Data ss:Type="Number">567</Data></Cell>
                <Cell ss:StyleID="s23"><Data ss:Type="Number">4,564</Data></Cell>
                
                <Cell ss:StyleID="s23"><Data ss:Type="Number">26,752</Data></Cell>
                <Cell ss:StyleID="s23"><Data ss:Type="Number">23,015</Data></Cell>
                <Cell ss:StyleID="s23"><Data ss:Type="Number">6</Data></Cell>
                <Cell ss:StyleID="s23"><Data ss:Type="Number">4,56,6</Data></Cell>

Out put, if you look @ below screen i need to put some % and $ and different symbols in the cells .
when I ma trying to put those symbols excel sheet is not considering and it is not opening getting file is corrupted and when see the more details is saying one of the cell is having invalid data.

NumberFormateIssue

any please suggest how to formate a number using apex visualforce.
Example will be help full
 
  • December 10, 2015
  • Like
  • 1
Hi there,

I have a task need to select a opportunities using standatd list  view page under "Action " check box.
when i check a check box select those opportunities and do some business logic and diaply message.
my question how can i know what are the opportunities are selected using Action check box  is it possible ? since that is standard page opportunity list view page .

  • September 02, 2014
  • Like
  • 1
Hi, I am trying to convert below javascript button into a lighting component.

{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 
// query the record 
var qr = sforce.connection.query("SELECT Id, SyncedQuoteId FROM Opportunity where Id='" + "{!Opportunity.Id}" + "'"); 
var records = qr.getArray("records"); 

var qr1 = sforce.connection.query("SELECT Id, OpportunityId FROM Quote where OpportunityId='" + "{!Opportunity.Id}" + "'"); 

// display the field from the query 
var recTypeId='{!Opportunity.RecordTypeId}'; 

var oppQuoteId=qr.records.SyncedQuoteId; 
var quoteRecord=qr1.getArray("records"); 

if((recTypeId=='{!$Setup.Opportunity_Record_Types__c.New_Record_Type_Id__c}' || 
recTypeId=='{!$Setup.Opportunity_Record_Types__c.Pilot_Record_Type_Id__c}' || 
recTypeId=='{!$Setup.Opportunity_Record_Types__c.Renew_Upsell_Record_Type_Id__c}') 
&& (oppQuoteId==null && quoteRecord!='')) { 
window.alert("There is a root quote already attached to this Opportunity. If you need assistance with this opportunity, please reach out to xxxxx "); 

else {
window.open ("http://{!$Setup.Integration_Settings__c.Quoting_Tool_URL__c}/reps/xxxxx.aspx?SFAccountId={!CASESAFEID(Opportunity.AccountId)}&SFOppId={!CASESAFEID(Opportunity.Id)}"); 
}

Lighting component

<aura:component implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction" access="global" >
    <aura:handler name="init" value="{!this}" action="{!c.oppRecordTypes}"/>
    <!--<aura:attribute name="Opportunity" type="Opportunity" />-->
    
    <aura:attribute name="recordId" type="String" />
    <aura:attribute name="syncedQuoteId" type="String" />
    <aura:attribute name="quoteId" type="String" />
    <aura:attribute name="lstOfRecordType" type="String[]" />
    <aura:attribute name="lstOfCutomObjectRecordType" type="String[]" />
   
 </aura:component>

Javascript controller
({
    oppRecordTypes : function(component, event, helper) {
        var action=component.get("c.oppRecordTypes");
       // action.setParams({"objectName" : Opportunity});
        action.setParams({"recordId" : component.get("v.recordId")});
        action.setCallback(this,function(response){
           var state = response.getState();
            if(state=="SUCCESS"){
                component.set("v.lstOfRecordType",response.getReturnValues());
                var oppRecordTypeNamesList=response.getReturnValues();                
                console.log("Record type names11="+oppRecordTypeNamesList);
                          
                var syncedQuoteId=component.get("c.getSyncedQuoteId");
                console.log("oppSyncedQuoteId111=" + syncedQuoteId);
                               
                var quoteId=component.get("c.getQuoteId");
                console.log("oppquoteId111=" + quoteId);
                
                var oppCustomRecordTypeNamesList=component.get("c.getOppCutomRecordTypes");
               console.log("oppCustomRecordTypeNamesList11="+oppCustomRecordTypeNamesList);                
            }
            else{
                console.log("cannot get record type names");
            }            
        } );
    },
        getSyncedQuoteId : function(component,event,helper){
        var action=component.get("c.getSyncedQuoteId");
        action.setParams({"oppId" : component.get("v.recordId")});
        action.setCallback(this,function(response){
            var state = response.getState();
            if(state="SUCCESS"){
                component.set("v.syncedQuoteId",response.getReturnValues());
                var oppSyncedQuoteId=response.getReturnValues();           
                console.log("oppSyncedQuoteId=" + oppSyncedQuoteId);
                            }
            else{
                console.log("cannot get syncedQuote ID");
            }
        });
    },
     getQuoteId : function(component,event,helper){
        var action=component.get("c.getQuoteId");
        action.setParams({"oppId" : component.get("v.recordId")});
        action.setCallback(this,function(response){
            var state=response.getState();
            if(state="SUCCESS"){
                componet.set("v.quoteId",response.getReturnValues());
                var oppQuoteId=response.getReturnValues();
                console.log("oppQuoteId="+oppQuoteId);
            }
            else{
                console.log("cannot get quote id")
            }
        });
    },    
    getOppCutomRecordTypes :function(component,event,helper){
        var action=component.get("c.getOppCutomRecordTypes");
        action.setCallback(this,function(response){
            var state=response.getState();
            if(state="SUCCESS"){
                component.set("v.lstOfCutomObjectRecordType",response.getReturnValues());
                var oppCustomRecordTypeNamesList=response.getReturnValues();
                   
                console.log("oppCustomRecordTypeNamesList="+oppCustomRecordTypeNamesList);
            }
            else{
                console.log("cannot get custom report type names");
            }
        });        
    }
})
APEX Class
public class AttachQuoteCntrl {
    public static List<String> recordTypeNames;
    
    @AuraEnabled     
    public static List<String> oppRecordTypes(){
         List<Schema.RecordTypeInfo> recordtypes = Schema.getGlobalDescribe().get('Opportunity').getDescribe().getRecordTypeInfos();    
         recordTypeNames=new List<String>();
         for(RecordTypeInfo rt : recordtypes){
            recordTypeNames.add(rt.getName());
        }    
        System.debug('********recordTypeNames='+recordTypeNames);
        
        return recordTypeNames;
    }
    @AuraEnabled 
    public static string getSyncedQuoteId(string oppId){
        Opportunity oppSyncedQuote= [Select id,SyncedQuoteId from opportunity where Id=:oppId limit 1];
        string syncedQuoteId=oppSyncedQuote.SyncedQuoteId;
        System.debug('********syncedQuoteId='+syncedQuoteId);
        return syncedQuoteId;
    }
    
    @AuraEnabled 
    public static string getQuoteId(string oppId){
        Quote oppQuote= [Select id,OpportunityId from Quote where OpportunityId=:oppId limit 1];
        string QuoteId=oppQuote.id;
        System.debug('********QuoteId='+QuoteId);
        return QuoteId;
    }
    
    @AuraEnabled 
    public static Opportunity_Record_Types__c getOppCutomRecordTypes(){
        return Opportunity_Record_Types__c.getInstance();
    }
}

I am unable to see the console.log in javascript console(developer tools)
can any please correct my code I am sure something is wrong with the code I am able to save the code and added quick action lighting component.
when clicking the quick action, first of all, I want to see if the records are coming are not in the console log.I am understanding why I am unable to see the logs in the developer tools console.
Please help me 



 
  • January 23, 2019
  • Like
  • 0
Hello everyone,

now we are moving from classic to lighting I need to convert all the javascript button to lighting.
We have a custom button which has below url on it

window.open('/apex/vfpagename?id=xxxxx'); 
User-added image
how do I replace window.open  in lighting and I want the button to work both in lighting and in classic.
Can any please help me on this if any sample code will be appreciated.

Thank you,
Aruna.
 
  • December 20, 2018
  • Like
  • 0
Hi is anyone got the solution to this sorting problem.

I am unable to do descending order sorting.
My requirement is I have map Of <Id,Name>  when user click on the link the map values need to sort either ascending or descending order

Example If the Map values contain
Map.put(id1,Name1);  
Map.put(id3,Name3);  
Map.put(id2,Name2);  
Map.put(id5,Name5);  
Map.put(id6,Name6);  
Map.put(id4,Name4);  

Result for ascending 
Map.put(id1,Name1);  
Map.put(id2,Name2);  
Map.put(id3,Name3);  
Map.put(id4,Name4);  
Map.put(id5,Name5);  
Map.put(id6,Name6); 

Result for desendoing\

Map.put(id6,Name6);  
Map.put(id5,Name5);  
Map.put(id4,Name4);  
Map.put(id3,Name3);  
Map.put(id2,Name2);  
Map.put(id1,Name1); 

I did use different methods to solve this but nothing is working me out. Please, anyone, help me out I need to solve this issue.
One ve page I need to display these values.

Thank you
Aruna
  • May 30, 2018
  • Like
  • 0
Hello,

is anyone has written recently salesforce platform developer -1 exam.  I think Salesforce changed the pattern.
Can any please let me know if you have latest dumps.


Thank you.
  • March 01, 2018
  • Like
  • 2
Hi,

It was really simple to open URL in new window with passing parameters and some Validations using salesforce classic Onclick Java. for example:
if({!ISBLANK( Account.CSOne_Case_Number__c )})
{
window.open('https://.na29.visual.force.com/apex/Relationship360?rId={!Account.Gainsight_Relationship_ID__c}');
}

Now we are moving to Salesforce Lightning and As Onclick Javascript is not supported. can someone please let me know how can I achieve this in Lightning.

Thanks in advance.

Saurabh Sisodia
Hello Reader

I  have a Custom object  (called API_Order__c) which has  lookup  field to Account
My plan is  to insert  MULTIPLE  records  in 1  REST API call and I am trying to build  the good JSON
I am not able to do this. I tried  the stanbdard REST  and I tried  to  use the COmposite/tree  REST

Seee below what I havew tried:

TEST 1

I want to  create  1 record  using REST command AND I want to reference the Account with External ID.
I use the below  REST
Method: POST
URL: /services/data/v39.0/sobjects/API_Order__c/

{
  "SourceFile__c" : "DE_1A_MSV3",
  "Order_Date__c" : "2017-07-07",
  "Account__r" : 
         {
         "External_ID_vod__c":"WDEF01663170"
         },
  "Account_Name__c" : "Adler-Apotheke",
  "NumberOfExpectedItemLines__c" : "2", 
  "External_Id__c" : "API_O_1003"
}

this is WORKING

​TEST 2
BUT  if I want to insert  MULTIPLE  records  I do not  know  what is  the right syntax


[
{
  "SourceFile__c" : "Value 1",
  "Order_Date__c" : "2017-07-07",
  "Account__r" : 
         {
         "External_ID_vod__c":"XXXX"
         },
  "External_Id__c" : "API_O_1003"
},
{
  "SourceFile__c" : "Value 2",
  "Order_Date__c" : "2017-07-08",
  "Account__r" : 
         {
         "External_ID_vod__c":"YYYY"
         },
  "External_Id__c" : "API_O_1003"
}
]

I god  JSON parsng ERROR

TEST 3

I tried to use  the COMPOSITE  REST  call  to insert Multiple records and if I am passing the Salesforce ID  of  the  Account lookup is OK 

POST
/services/data/v39.0/composite/tree/API_Order__c

{
"records" :[
  {
  "attributes" : {"type" : "API_Order__c", "referenceId" : "ref1"},
  "SourceFile__c" : "DE_1A_MSV3",
  "Order_Date__c" : "2017-07-07",
  "Account__c" : "0015E000004jH2I"
  }, 
  {
  "attributes" : {"type" : "API_Order__c", "referenceId" : "ref2"},
  "SourceFile__c" : "Val2",
  "Order_Date__c" : "2017-07-07",
  "Account__c" : "0015E000004jH2I"
   }]
}

TEST 4
BUT IF  I TRY  TO REFERENC ETHE ACCOUNT WITH EXTER NAL ID  I FAIL

POST
/services/data/v39.0/composite/tree/API_Order__c

{
"records" :[
  {
  "attributes" : {"type" : "API_Order__c", "referenceId" : "ref1"},
  "SourceFile__c" : "DE_1A_MSV3",
  "Order_Date__c" : "2017-07-07",
  "Account__r" : 
         {
         "External_ID_vod__c":"WDEF01663170"
         },
  "Account_Name__c" : "Adler-Apotheke",
  "NumberOfExpectedItemLines__c" : "2", 
  "External_Id__c" : "API_O_1001"
  },
  {
  "attributes" : {"type" : "API_Order__c", "referenceId" : "ref2"},
  "SourceFile__c" : "DE_1A_MSV3",
  "Order_Date__c" : "2017-07-07",
  "Account__r" : 
         {
         "External_ID_vod__c":"WDEF01663170"
         },
  "Account_Name__c" : "Adler-Apotheke",
  "NumberOfExpectedItemLines__c" : "2",
  "External_Id__c" : "API_O_1002"
   }]
}

I have the ERROR  message: Cannot reference a foreign key field Account__r.


Any help?  

Thanks in advance Csaba
Hello there,

I am having below requirement.
In salesforce when a record is updated then send data of that record to external system using reset API JSON file.
I have written below code but I am not sure whether I am going in right direction 

Trigger

rigger ImplementationPlanActivity on Implementation_Plan_Activity__c (after update) {
    Trigger_Settings__c triggerSettings = Trigger_Settings__c.getInstance();
    if(triggerSettings.ImplementationPlanActivity__c == false){
        return;
    }
            set<Id> IPAIdSet=new Set<Id>();
            for(Implementation_Plan_Activity__c IPArecord : trigger.new ){
                IPAIdSet.add(IPArecord .id);
            }
            IPAResetAPIClass.IPAData(IPAIdSet);

        }
    }
Webservice class

global class IPAResetAPIClass{
@future(callout=true)
    global static void IPAData(Set<Id> newIPASetId){
    
        List<Implementation_Plan_Activity__c> ipaNewList=[SELECT id,Name,
                                                                    Account_Manager__r.Name,
                                                                    Account_Manager__r.Email,
                                                                    Account_Specialist__r.Name,
                                                                    Account_Specialist__r.Email,    
                                                                    SFID18__c ,
                                                                    RecordTypeId
                                                            FROM Implementation_Plan_Activity__c where Id IN : newIPASetId];
        
        List<impWarpperClass> warpperIPAList=new List<impWarpperClass>();
        
            warpperIPAList.add(new impWarpperClass(ipaNewList[0].id,
                                                    ipaNewList[0].Name,
                                                    ipaNewList[0].Account_Manager__r.Name,
                                                    ipaNewList[0].Account_Manager__r.Email,
                                                    ipaNewList[0].Account_Specialist__r.Name,
                                                    ipaNewList[0].Account_Specialist__r.Email,
                                                    ipaNewList[0].SFID18__c,
                                                    ipaNewList[0].RecordTypeId));
        
 
       RecordType recordTypeRecord=[Select id,Name from RecordType  where id=:ipaNewList[0].RecordTypeId limit 1];
       
       string  resource=null;
       if(recordTypeRecord.Name=='Auto Provisioning'){
           resource='Auto Provisioning';
       }
       else if(recordTypeRecord.Name =='Workbook'){
           resource='Workbook';
        }      
        system.debug('*********warpperIPAList='+warpperIPAList);
        
        string JSONString=JSON.serializePretty(warpperIPAList);
        system.debug('*********serialized imp='+JSONString);
        
        string endURL;
        
        endURL=geURL+resource+'/'+ipaNewList[0].id;
        system.debug('*********endURL='+endURL);
        HttpRequest req=new HttpRequest();
        //Set HttpRequest Method
        req.setMethod('POST');
      
        req.setHeader('content-type', 'application/json');
        //Set HTTPRequest Endpoint dummy url
        req.setEndpoint('http://requestb.in/13auzf41');
        //req.setEndpoint(endURL);
        
        //Set HTTP Request Body
        req.setBody(JSONString);
        Http http = new Http();
        try{
            HTTPResponse res = http.send(req);
            //Helpful debug messages
            System.debug(res.toString());
            System.debug('STATUS:'+res.getStatus());
            System.debug('STATUS_CODE:'+res.getStatusCode());
            System.debug('Content: ' + res.getBody());
            
            //we can create success object record
        }
        catch(Exception e){
            System.debug('******* error message='+e);
            //we can create error object record
        }
    
    }
    
    global class impWarpperClass{
    
        global string IPAId{get;set;}
        global string IPAName{get;set;}   
        global string IPAAccManagerName{get;set;}   
        global string IPAAccManagerEmail{get;set;} 
        global string IPAAccSpecialListrName{get;set;}   
        global string IPAAccSpecialListEmail{get;set;} 
           
        global string IPASFDCId{get;set;}
        global string IPARecordTypeId{get;set;}
        
        global impWarpperClass(string IPAId,string IPAName,
                                        string IPAAccManagerName,
                                        String IPAAccManagerEmail,
                                        string IPAAccSpecialListrName,
                                        string IPAAccSpecialListEmail,
                                        string IPASFDCId,
                                        string IPARecordTypeId){
            this.IPAId=IPAId;
            this.IPAName=IPAName;
            this.IPAAccManagerName=IPAAccManagerName;
            this.IPAAccManagerEmail=IPAAccManagerEmail;
            this.IPAAccSpecialListrName=IPAAccSpecialListrName;
            this.IPAAccManagerEmail=IPAAccSpecialListEmail;
            this.IPASFDCId=IPASFDCId;
            this.IPARecordTypeId=IPARecordTypeId;
            
        }
       
    }
  
       }

}
am I going right dirction. is this correct way to send data from salesforce to external system using rest api JSON file.
If I am wrong can any please let me know how can I expose salesforce data to external system when records is updted in salesforce.
Thank you.
  • December 28, 2016
  • Like
  • 0
Hi there,

I know Batch class is asynchronous

I am having a requirement where the soql will get larger set of data with all the joining queries.
I need to display larger data   on excel sheet when I click on vf page button.

By using normal apex class soql  will only return 50,000 records . so I thought of using apex batch and process the soql and then display the results in excel sheet.

is it possible to display apex batch results on excel ? or is there any other where we can process more than 1 million data and display on excel sheet.
 
  • August 25, 2016
  • Like
  • 0
Hi there I have created excel workbook with help of XML Spreadsheet Reference.
I am unable to insert the image in the sheet.
can any one please suggest me how to insert an image in the sheet.
below is the code which i have used to generate sheet with multiple tabs.
<apex:page id="pg" standardStylesheets="false" controller="MorningReportwithExcelTabs" contenttype="application/vnd.ms-excel#CAMorningReportWithMultipleTabs.xls" >

{!xmlheader}

<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
    <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
        <WindowHeight>8535</WindowHeight>
        <WindowWidth>12345</WindowWidth>
        <WindowTopX>480</WindowTopX>
        <WindowTopY>90</WindowTopY>
        <ProtectStructure>False</ProtectStructure>
        <ProtectWindows>False</ProtectWindows>
    </ExcelWorkbook>
    <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
    <Author></Author>
    <LastAuthor></LastAuthor>
    <Company></Company>
    <Version>11.6360</Version>
    </DocumentProperties>
    <Styles>
        <Style ss:ID="Default" ss:Name="Normal">
        <Alignment ss:Vertical="Bottom"/>
        <Borders/>
        <Font ss:bgcolor="#FF0000"/>
        <Interior ss:bgcolor="#FF0000"/>
        <NumberFormat/>
        <Protection/>
    </Style>
    <Style ss:ID="s16">
        <Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#FFFFFF" ss:Bold="1" ss:Italic="1"/>
        <Interior ss:Color="#92D050" ss:Pattern="Solid"/>
        <Alignment ss:Horizontal="CenterAcrossSelection"/>
    </Style>
    <Style ss:ID="s23">
        <Font x:Family="Swiss" ss:Bold="0" ss:bgcolor="#FF0000"/>
        
    </Style>
 <Worksheet ss:Name="Top 5 Daily Orders">
 <Table ss:ExpandedColumnCount="200">


        <Column ss:Width="200"/>
        <Column ss:Width="200"/>
        <Column ss:Width="80"/>
        <Column ss:Width="100"/>
        <Column ss:Width="100"/>
        <Column ss:Width="100"/>
        <Column ss:Width="100"/>
        <Column ss:Width="100"/>
        <Column ss:Width="100"/>
        <Column ss:Width="100"/>

            
            <Row>
                <Cell ss:StyleID="s16" ><Data ss:Type="String">Rep Name</Data></Cell>
                <Cell ss:StyleID="s16" ><Data ss:Type="String">Bill to </Data></Cell>
                <Cell ss:StyleID="s16"><Data ss:Type="String">State</Data></Cell>
                <Cell ss:StyleID="s16"><Data ss:Type="String">Ready</Data></Cell>
                <Cell ss:StyleID="s16"><Data ss:Type="String">Toolbox w/I-Ready</Data></Cell>
                <Cell ss:StyleID="s16"><Data ss:Type="String">i-Ready</Data></Cell>
                <Cell ss:StyleID="s16"><Data ss:Type="String">Training</Data></Cell>
                <Cell ss:StyleID="s16"><Data ss:Type="String">Brigance</Data></Cell>
                <Cell ss:StyleID="s16"><Data ss:Type="String">Other</Data></Cell>
                <Cell ss:StyleID="s24"><Data ss:Type="String">TOTAL</Data></Cell>
                
            </Row>
            
            <Row>
                <Cell ss:StyleID="s23"><Data ss:Type="String">OGDEN</Data></Cell>
                <Cell ss:StyleID="s23"><Data ss:Type="String">ELK GROVE USD</Data></Cell>
                <Cell ss:StyleID="s23"><Data ss:Type="String">CA</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">123456678901</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">2343</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">2344</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">23342</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">2342432</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">55789</Data></Cell>
                <Cell ss:StyleID="s24"><Data ss:Type="Number">23424543</Data></Cell>
            
            </Row>
            
            <Row>
                <Cell ss:StyleID="s23"><Data ss:Type="String">SHARZER</Data></Cell>
                <Cell ss:StyleID="s23"><Data ss:Type="String">ELK GROVE USD</Data></Cell>
                <Cell ss:StyleID="s23"><Data ss:Type="String">CA</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">3,220</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">4,210</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">5,320</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">2,456,100</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">23,456,789</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">45675</Data></Cell>
                <Cell ss:StyleID="s24"><Data ss:Type="Number">176100</Data></Cell>
            
            </Row>
            
            <Row>
                <Cell ss:StyleID="s23"><Data ss:Type="String">DOMESTIC HOUSE</Data></Cell>
                <Cell ss:StyleID="s23"><Data ss:Type="String">ELK GROVE USD</Data></Cell>
                <Cell ss:StyleID="s23"><Data ss:Type="String">CA</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">3,220</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">4,210</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">5,320</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">2,456,100</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">23,456,789</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">67788</Data></Cell>
                <Cell ss:StyleID="s24"><Data ss:Type="Number">176100</Data></Cell>
            
            </Row>
            
            <Row>
                <Cell ss:StyleID="s23"><Data ss:Type="String">MCMATH</Data></Cell>
                <Cell ss:StyleID="s23"><Data ss:Type="String">ELK GROVE USD</Data></Cell>
                <Cell ss:StyleID="s23"><Data ss:Type="String">CA</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">3,220</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">4,210</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">5,320</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">2,456,100</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">23,456,789</Data></Cell>
                <Cell ss:StyleID="s30"><Data ss:Type="Number">87766</Data></Cell>
                <Cell ss:StyleID="s24"><Data ss:Type="Number">176100</Data></Cell>
            
            </Row>
  • March 07, 2016
  • Like
  • 0
i have created
1.AnimalLocator User-added image



2.AnimalLocatorMock
User-added image

3.AnimalLocatorTest

User-added image


error i am getting

User-added image

please help me
Hi,
Need help in udnerstanding the error type and resolving the same.​
System.CalloutException: IO Exception: Unable to tunnel through proxy. Proxy returns "HTTP/1.0 403 Forbidden

We are trying to integrate with Perlchain CPQ machine, There is no provision for passing the user name and password in the wsdl provided by CPQ. I have followed the link and tweaked to pass these two as part of header.
http://blog.dacology.com/callouts-from-salesforce-adding-soap-headers-for-wsse-security/

I'm still getting the error, 
System.CalloutException: IO Exception: Unable to tunnel through proxy. Proxy returns "HTTP/1.0 403 Forbidden

Need help in resolving this.

//Generated by wsdl2apex

public class xsServicesOp {

        public class Security {
            public UsernameToken usernameToken;
            private String[] usernameToken_type_info = new String[]{'UsernameToken','http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','UsernameToken','0','1','true'};
            private String[] apex_schema_type_info = new String[]{'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','true','false'};
            private String[] field_order_type_info = new String[]{'usernameToken'};
        }
        public class UsernameToken {
            public String username;
            public String password;
            private String[] username_type_info = new String[]{'Username','http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','string','0','1','true'};
            private String[] password_type_info = new String[]{'Password','http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','string','1','1','true'};
            private String[] apex_schema_type_info = new String[]{'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','true','false'};
            private String[] field_order_type_info = new String[]{'username','password'};
        }  
    public class CreateOpportunityPortType {
        public String endpoint_x = //'http://localhost:8010/CreateOpptyMed/1';
           (I have replace endpoint with the correct url)
                                    
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
            //instantiate the header
            public UsernameToken userToken;
            public Security Header;
            private String Header_hns = 'Security=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';
            //end
        private String[] ns_map_type_info = new String[]{'http://www.test.machine/messages/opportunity/1', 'CdmMessagesOpport', 'http://www.test.machine/opportunity/1', 'CdmOpportunity', 'http://www.test.machine/services/opportunity/1', 'CdmServicesOpport', 'http://www.test.machine/common/1', 'CdmCommon', 'urn:codelist:ISO639-2-2002', 'CdmCodelist', 'http://www.test.machine/customer/1', 'CdmCustomer'};
        public CdmMessagesOpport.CreateOpportunityResponseMessageType CreateOpportunity(CdmOpportunity.OpportunityType Opportunity,CdmOpportunity.AccountType Account,CdmOpportunity.ProductsType[] Products) {
            CdmMessagesOpport.CreateOpportunityRequestMessageType request_x = new CdmMessagesOpport.CreateOpportunityRequestMessageType();
            request_x.Opportunity = Opportunity;
            request_x.Account = Account;
            request_x.Products = Products;
            CdmMessagesOpport.CreateOpportunityResponseMessageType response_x;
            Map<String, CdmMessagesOpport.CreateOpportunityResponseMessageType> response_map_x = new Map<String, CdmMessagesOpport.CreateOpportunityResponseMessageType>();
            response_map_x.put('response_x', response_x);
            
            userToken = new UsernameToken();
            userToken.username = 'onecanon';
            userToken.password = 'password';


            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://www.test.machine/services/opportunity/1',
              'CreateOpportunityRequestMessage',
              'http://www.test.machine/services/opportunity/1',
              'CreateOpportunityResponseMessage',
              'CdmMessagesOpport.CreateOpportunityResponseMessageType'}
            );
            response_x = response_map_x.get('response_x');
            return response_x;
        }
    }
}

 
Hello everybody,

I would like to run a report (Matrix report with lookup and formula fields) from Apex with the code below:

// Get the report ID
List <Report> reportList = [SELECT Id,DeveloperName FROM Report where 
    DeveloperName = 'My_custom_report'];
String reportId = (String)reportList.get(0).get('Id');

// Run a report synchronously
Reports.reportResults results = Reports.ReportManager.runReport(reportId);

The following exception is thrown:

reports.MetadataException: Can't run the report because it doesn't have any columns selected. Be sure to add fields as columns to the report through the user interface.

Can somebody explain me what the problem is?

Cheers

HI all,

 

I want to do sorting of map based on value. here is code:

 

for (Pricebook2 pb : [select id, Name from Pricebook2 where id in :ids order by name])
        {
            myPBNames.put(pb.id, pb.name);
        }

 

Results are got sorted based on id. But i want this should be based on name.

 

Even Order by is not working. Please suggest.