• Carolina Ruiz Medina
  • SMARTIE
  • 863 Points
  • Member since 2014
  • Principal Developer, Product Innovation
  • FinancialForce


Badges

  • Chatter
    Feed
  • 8
    Best Answers
  • 2
    Likes Received
  • 2
    Likes Given
  • 5
    Questions
  • 92
    Replies
I have the same problem with webmaster@lincolncity-culturalcenter.org.  I started enrolling in all the education about SalesForce 
Displaying Json data in page block table but problem is it's more than 500 records so i want some pagination.
Like after clicking next button it should display rest of records


/////////////////////////////////////////////////Visualforce Page\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
<apex:tab label="DemoMail Sent" name="name3" id="tab3">        
<apex:repeat value="{!performcallout}" var="wraps">
<apex:pageBlockTable value="{!wraps.GroupData}" var="wrap" width="100%">
<apex:column headerValue="Subject" value="{!wrap.Subject}"/>
<apex:column headerValue="Video Title" value="{!wrap.SessionTitle}"/>
<apex:column headerValue="Sent Date" value="{!wrap.SentDate}"/>
<apex:column headerValue="Recipients" value="{!wrap.NoOfContacts}"/>
<apex:column headerValue="Opens" value="{!wrap.OpenTimes}"/>
<apex:column headerValue="Viewed" value="{!wrap.ViewedTimes}"/>
</apex:pageBlockTable>
</apex:repeat>
    </apex:tab>

//////////////////////////////////////////////Controller\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

public class demomailsent{
  public List<demomailsentwrap> ConsoleWrapperList{get;set;}
  
       public List<demomailsentwrap> getperformcallout(){
      ConsoleWrapperList = new List<demomailsentwrap>();
       HttpRequest req = new HttpRequest(); 
       HttpResponse res = new HttpResponse();
        Http http = new Http(); 
        req.setEndpoint('http://webapi.demomail.net/test/DemomailSent.js'); 
        req.setMethod('GET');
        //req.setHeader('Authorization', 'OAuth '+UserInfo.getSessionId());
        res = http.send(req);
         //System.assert(false,res.getBody()+'******');
       
         if(res.getstatusCode() == 200 && res.getbody() != null)
          { 
        String replaceIllegal= res.getbody().replaceAll('\n','').replaceAll('\r','');
        ConsoleWrapperList=(List<demomailsentwrap>)System.JSON.deserialize(replaceIllegal,List<demomailsentwrap>.class);
        //ConsoleWrapperList1 = ConsoleWrapperList.replaceall('\r\n','');
          //System.debug('Response Checking Engine: '+ res.getBody());
          }
            return consolewrapperlist; 
             
          }
//////////////////////////////////////////////  Wrapper Class\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\


public class demomailsentwrap {

public String TotalViewCount{get;set;}   

public String TotalRecords{get;set;}    
public String TotalDisplayRecords{get;set;} 
public String ErrorCode{get;set;}   
public List<GroupData> GroupData{get;set;}  
public class GroupData 
{        
public String ID{get;set;}  
public String Subject{get;set;}            
public String SessionTitle{get;set;}          
public String SentDate{get;set;}          
public String NoOfContacts{get;set;}          
public String OpenTimes{get;set;}          
public String ViewedTimes{get;set;}          
  
}     
}
I want to add a button to my opportunity header record that is called Insert Products. This will send the opportunity ID to a visualforce page which will have a select file button and an insert button that will loop through the CSV and insert the records to the related opportunity.

This is for non technical users so using Data loader is not an option.

I got this working using standard apex class however hit a limit when i load over 1,000 records (which would happen regularly).

I need to convert this to a batch process however am not sure how to do this.

Any one able to point me in the right direction? I understand a batch should have a start, execute and finish. However i am not sure where i should split the csv and where to read and load?

I found this link which i could not work out how to translate into my requirements:http://developer.financialforce.com/customizations/importing-large-csv-files-via-batch-apex/

Here is the code i have for the standard apex class which works.
 
public class importOppLinesController {
public List<OpportunityLineItem> oLiObj {get;set;}
public String recOppId {
        get;
        // *** setter is NOT being called ***
        set {
            recOppId = value;
            System.debug('valuevalue);
        }
    }
public Blob csvFileBody{get;set;}
public string csvAsString{get;set;}
public String[] csvFileLines{get;set;}

public List<OpportunityLineItem> oppLine{get;set;}
  public importOppLinesController(){
    csvFileLines = new String[]{};
    oppLine = New List<OpportunityLineItem>();
  }
  public void importCSVFile(){

       PricebookEntry pbeId;
       String unitPrice = '';

       try{
           csvAsString = csvFileBody.toString();
           csvFileLines = csvAsString.split('\n
           for(Integer i=1;i<csvFileLines.size();i++){
               OpportunityLineItem oLiObj = new OpportunityLineItem() ;
               string[] csvRecordData = csvFileLines[i].split(',');

               String pbeCode = csvRecordData[0];
                pbeId = [SELECT Id FROM PricebookEntry WHERE ProductCode = :pbeCode AND Pricebook2Id = 'xxxx HardCodedValue xxxx'][0];                  

                oLiObj.PricebookEntryId = pbeId.Id;

               oLiObj.Quantity = Decimal.valueOf(csvRecordData[1]) ;
               unitPrice = String.valueOf(csvRecordData[2]);
               oLiObj.UnitPrice =  Decimal.valueOf(unitPrice);

               oLiObj.OpportunityId = 'recOppId';;
               insert (oLiObj);
           }
        }
        catch (Exception e)
        {

             ApexPages.Message errorMessage = new ApexPages.Message(ApexPages.severity.ERROR, e + ' - ' + unitPrice);

            ApexPages.addMessage(errorMessage);
        }
  }
}

 
Hi Folks,

What is the best version control tool for salesforce. Is it SVN or GITHUB.
In case of multiple vendors working on the same project then which is the best version control and migration tools.
Is Jenkins and bamboos free or paid migration tools.

This is urgent.Thanks in advance!!!

Regards,
Krish 
I need to delete a Wave Dataset(s) but I can't do that because the dataset is associated with a Dataflow.

Thus, I need to delete the Dataflow; however, I'm unable to do so??

There are no instructions for doing so and one unable to upload a blank json file to replace the existing Datflow?

I need help with this specifically, since the datasets put me over my storage limit and prevent completion of other Trailhead trainings.  However, more generally there should be a simple delete Dataflow function, as other users have mentioned.
Hello,

I read another disscusion that had the same problem I did ( "Sorry, we can't enroll you in a Salesforce Developer Edition account because the email address you entered is already in use. To sign up with a different email address, go to https://developer.salesforce.com/form/signup/freetrial.jsp .")

The solution was to have the password reset. May I please have my password reset? Username: vflores@salesforce.com

Thank you in advance!
can you please give me the examples of using future method from batch Apex class.please give some ideas.
I want to display a list of records processed out of a batch process on a Visuaforce page.
I tried the option given in below link
 https://developer.salesforce.com/forums/ForumsMain?id=906F000000096w4IAA

but its not working for me.
Any help highly appreciated.
How to check negative percent data value in formula field. For ex: -40% means dispaly the -(50-40)%
Hi All,
I'm submitting my package to AppExchange Security Review and I've a doubt…
I need check the Fields Level Security in Test class also?
Thanks!


 
Stack Trace MassTransfferOwnershipController.doSearch: line 306, column 1
                   MassCaseTransferTestClass.MassCaseTransferTestClass: line 52, column 1

My Controllers method

 public PageReference doSearch()
    { 
       
        theResultList = new List<wrapperClass>();
        
        //system.debug('IN THE LOOP'+toUserFunc);
        
        if(selectedCaseFiler <> 'Select from list...' && selectedCaseFiler1 == 'Select from list...'&&  selectedCaseFiler2 == 'Select from list...')
        {
            CaseFiler = String.escapeSingleQuotes(selectedCaseFiler);
            CaseFilter = String.escapeSingleQuotes(selectedFilterValue);
            theQ = 'SELECT id,OwnerId,CaseNumber,Origin,Priority,Status,Account.Name,New_Owner__c  FROM Case WHERE OwnerId = :myId AND '+CaseFiler+' = :CaseFilter';
            
        }
        else if(selectedCaseFiler <> 'Select from list...' && selectedCaseFiler1 <> 'Select from list...' &&  selectedCaseFiler2 == 'Select from list...')
        {
              CaseFilerFirst = String.escapeSingleQuotes(selectedCaseFiler);
              CaseFilterFirst = String.escapeSingleQuotes(selectedFilterValue);
              CaseFilerFirst1 = String.escapeSingleQuotes(selectedCaseFiler1);
              CaseFilterFirst1 = String.escapeSingleQuotes(selectedFilterValue1);
             theQ = 'SELECT id,OwnerId,CaseNumber,Origin,Priority,Status,Account.Name,New_Owner__c FROM Case WHERE OwnerId = :myId AND '+CaseFilerFirst+' = :CaseFilterFirst AND '+CaseFilerFirst1+' = :CaseFilterFirst1 ';
            system.debug('IF LOOP 2 '+theQ);
        }
        else if(selectedCaseFiler <> 'Select from list...' && selectedCaseFiler1 <> 'Select from list...' &&  selectedCaseFiler2 <> 'Select from list...')
        {
            CaseFilerSecond = String.escapeSingleQuotes(selectedCaseFiler );
            CaseFilterSecond = String.escapeSingleQuotes(selectedFilterValue);
            CaseFilerSecond1 = String.escapeSingleQuotes(selectedCaseFiler1 );
            CaseFilterSecond1 = String.escapeSingleQuotes(selectedFilterValue1);
            CaseFilerSecond2 = String.escapeSingleQuotes(selectedCaseFiler2 );
            CaseFilterSecond2 = String.escapeSingleQuotes(selectedFilterValue2);
              
            theQ = 'SELECT id,OwnerId,CaseNumber,Origin,Priority,Status,Account.Name,New_Owner__c FROM Case WHERE OwnerId = :myId AND '+ CaseFilerSecond +' = :CaseFilterSecond AND '+ CaseFilerSecond1+' = :CaseFilterSecond1 AND '+CaseFilerSecond2+' = :CaseFilterSecond2 ';           
           system.debug('IF LOOP 3 '+theQ);
        }
        else
        {
        
            theQ = 'SELECT id,OwnerId,CaseNumber,Origin,Priority,Status,Account.Name,New_Owner__c FROM Case WHERE OwnerId = '+myId;
        }
        /*
        else
        {
            theQ = 'SELECT id,OwnerId FROM '+selectedObject+' WHERE OwnerId = :myId AND Stage = \''+selectedOpportunityFiler+'\'';
        }
        */
        
        system.debug('THE QUERY IS:-'+theQ);
        for(Case s : Database.Query(theQ))
        {
            system.debug('THE S:-'+s);
            wrapperClass wc = new wrapperClass(s);
            system.debug('THE WC:-'+wc);
            theResultList.add(wc);
        }
        system.debug('THE LIST IS:-'+theResultList);
        if(theResultList.isEmpty())
        {
             ApexPages.AddMessage(new ApexPages.Message(ApexPages.Severity.INFO, 'NO RECORDS FOUND.'));
             showResult = FALSE;
        }
        showResult = TRUE;
        
        
        return null;
    }

My Test Class

@isTest(SeeAllData=true)
private class MassCaseTransferTestClass
{
    static testMethod void MassCaseTransferTestClass()
    {
        Test.setCurrentPage(Page.MassTransfferOwnershipPage);

       List <User> user= [select id from User where Profile.Name = 'System Administrator'];
        
        String userId;   
        for(User usr: user)
        {
            userId = usr.id;
         }  
        
        
        Case c = new Case(OwnerId=userId,Origin='Phone',Subject='Test Case 1');
        insert c;
        
       
        
        Transffer_Ownership__c testObj = new Transffer_Ownership__c(User__c=userId);
        insert testObj; 
        
       
        ApexPages.Standardcontroller sc = New ApexPages.StandardController(testObj);
        MassTransfferOwnershipController mct = new MassTransfferOwnershipController(sc);    
        
        ApexPages.Standardcontroller sc1 = New ApexPages.StandardController(c);
        MassTransfferOwnershipController mct1 = new MassTransfferOwnershipController(sc1);    
        
        
        
        mct1.selectedCaseFiler = 'Origin';
        mct1.selectedCaseFiler1 = 'Origin';
        mct1.selectedCaseFiler2 = 'Origin';
       
        
        mct.getObjectsList(); //Covered
        mct.getblockChoices(); //Covered
        mct.getCaseFilersList(); //Covered
        mct1.getFiltersList(); //Covered
        
        mct.userPopulate();
        mct.touserPopulate();
        
        
        mct1.getOpportunityFilersList();
       
        mct1.getFiltersList1();
        mct1.getFiltersList2();
        mct1.doSearch();
        mct1.doTransfer(); 
        mct1.doTransfer1(); 
        mct1.finalMethod(); 
        
    }
    
    static testMethod void MassCaseTransferTestClass_2()
    {
    
      List<User> user = [select id from User where Profile.Name = 'System Administrator'];
      
      String userId ;
      for(User usr: user)
        {
            userId  = usr.id;
        }
        
      Case c2 = new Case(OwnerId=userId ,Priority='High',Subject='Test Case 2');
      insert c2;
      
      Transffer_Ownership__c testObj = new Transffer_Ownership__c(User__c=userId);
      insert testObj;
        
        
       
        ApexPages.Standardcontroller sc = New ApexPages.StandardController(testObj);
        MassTransfferOwnershipController mct = new MassTransfferOwnershipController(sc);    
      
      ApexPages.Standardcontroller sc2 = New ApexPages.StandardController(c2);
      MassTransfferOwnershipController mct2 = new MassTransfferOwnershipController(sc2);   

      
 
      mct2.selectedCaseFiler = 'Priority';
      mct2.selectedCaseFiler1 = 'Priority';
      mct2.selectedCaseFiler2 = 'Priority'; 
      
      
       mct.getObjectsList(); //Covered
        mct.getblockChoices(); //Covered
        mct.getCaseFilersList(); //Covered
        mct2.getFiltersList(); //Covered
        
        mct.userPopulate();
        mct.touserPopulate();
        
        
        mct2.getOpportunityFilersList();
       
        
        mct2.getFiltersList1();
        mct2.getFiltersList2();
        mct2.doSearch();
        mct2.doTransfer();
   
       
    }
    
    static testMethod void MassCaseTransferTestClass_3()
    {
    
      List<User> user = [select id from User where Profile.Name = 'System Administrator'];
      
      String userId ;
      
       for(User usr: user)
        {
            userId = usr.id;
        }
      
          
      Case c3 = new Case(OwnerId=userId ,Status='Open',Subject='Test Case 2');
      insert c3;
      
      Transffer_Ownership__c testObj = new Transffer_Ownership__c(User__c=userId);
      insert testObj;
        
        
       
        ApexPages.Standardcontroller sc = New ApexPages.StandardController(testObj);
        MassTransfferOwnershipController mct = new MassTransfferOwnershipController(sc);    
      
      ApexPages.Standardcontroller sc3 = New ApexPages.StandardController(c3);
      MassTransfferOwnershipController mct3 = new MassTransfferOwnershipController(sc3);   

      
 
      mct3.selectedCaseFiler = 'Status';
      mct3.selectedCaseFiler1 = 'Status';
      mct3.selectedCaseFiler2 = 'Status'; 
      
      
       mct.getObjectsList(); //Covered
        mct.getblockChoices(); //Covered
        mct.getCaseFilersList(); //Covered
        mct3.getFiltersList(); //Covered
        
        mct.userPopulate();
        mct.touserPopulate();
        
        
        mct3.getOpportunityFilersList();
       
        
        mct3.getFiltersList1();
        mct3.getFiltersList2();
        mct3.doSearch();
        mct3.doTransfer();
   
    }

}
Could someone help me to resovle this issue?

Description: my native iOS App integrated with Salesforce production, and user can upload pictures from App to Salesforce working well before. But today it's not working, all users got error message "An unexpected error occurred. Please include this ErrorId if you contact support: 1436668424-30151(-1219322115)". Also upload pictures in Salesforce1, got same error. By the way, it works fine in Sandbox. 

Thanks for your help in advance!
Hi,

I've created a custom objects and I need that Standard Users can read it.
The solution is to clone Standard Users Profile and make a custom profile, but the custom object is inside managed packages and will be in appexchange in the future, so... how I can modify read permissions at object?

Thanks
 
We only want to expose a subset of an object’s records via API, is this possible? If so, how?
 

I'm following a well written tutorial written by @andymahood__c: http://www.tquila.com/blog/2014/11/17/setting-lightning-connect-and-your-first-external-object

When I get to the step #3 ... "Select Edit on the CustomerID field, ...", I don't see Account (or any objects to relate) listed in the drop down box. I have created the custom field on ACCOUNT named CusotmerID Text(5) and marked it as External ID as follows:

CustomerID CustomerID__c Text(5) (External ID) [Checked]

Any ideas?
Hi All,
I am not able to create A custom button on page Layout section of any Object on developer edition. Please help me
Create an Apex class that returns an array (or list) of strings: 
Create an Apex class that returns an array (or list) of formatted strings ('Test 0', 'Test 1', ...). The length of the array is determined by an integer parameter.The Apex class must be called 'StringArrayTest' and be in the public scope.
The Apex class must have a public static method called 'generateStringArray'.
The 'generateStringArray' method must return an array (or list) of strings. Each string must have a value in the format 'Test n' where n is the index of the current string in the array. The number of returned strings is specified by the integer parameter to the 'generateStringArray' method.

MyApexClass to above Challenge:

public class StringArrayTest {
    
    public static List<string> generateStringArray(Integer n)
    {
        List<String> myArray = new List<String>();
        
        for(Integer i=0;i<n;i++)
        {
            myArray.add('Test'+i);
            System.debug(myArray[i]);
        }
        return myArray;
        
    }


It's compile and execute as per requirement in Developer console. But Traihead showing the below error:

Challenge not yet complete... here's what's wrong: 
Executing the 'generateStringArray' method failed. Either the method does not exist, is not static, or does not return the proper number of strings.

Anyhelp would be greatly appreciated. Thanks.