• Rodolfo Calvo
  • NEWBIE
  • 54 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 1
    Likes Given
  • 23
    Questions
  • 30
    Replies
Hello Team, 

I packaged a visualforce page and its controller but the code is still able to be seen. How can I hide my code?
Thanks in advance. 
Hello team, 
I have this code: 
public static testMethod PageReference search() 
      {
        try
        {
            //runSearch();
            results = performSearch(searchString);
        }
        catch(Exception e)
        {
            //showMessage = true;
            //message = 'An error has ocurred on public static testmethod PageReference search()';
        }
        return null;
      }
    
      public static List<Account> performSearch(String sString)
      {
        searchString =  sString;
        //String will make a callback of contacs
        String soql = 'select id, name, type, description, website, phone from Account';
        if(searchString != '' && searchString != null)
        soql = soql +  ' where name LIKE \'%' + searchString +'%\'';
        soql = soql + ' limit 25';
        System.debug(soql);
        return database.query(soql); 
      }

All my app is in @isTest
It shows an error: 
Cannot call test methods in non-test context
Error is in expression '{!search}' in component <apex:commandButton> in page lca: External entry point

What am I doing wrong?
If I create a package in salesforce for my app, an error is shown: 
No test methods found in the Apex code included in the package. At least 75% test coverage is required. 

I have more than 2000 lines of code in visualforce page and its controller. This requirement means that I have to re-write all my code??

Thanks in advance.
 Hello team,
I develop an app with a visualforce page and controller, how can I install my app in another salesforce account? Is there any easy way to do this?
 
Thanks in advance
I developed an app, how can I hide all the code I use for my application? 
Is there any way to make this possible? 

Thanks in advance. 
Hello team, I have a simple code such as following: 
public void showQuery()
    {
        try
        {
            //try something
            If(Success)
            {
                //Show JavaScript success message
            }
            else
            {
                //Show JavaScript missing something
            }
        }
        catch(Exception e)
        {
            //Show JavaScript code of error
        }
    }

How can I show a this JavaScript from code?
Thanks a lot in advance
Hello team, 
I need to get the boolean from a selectList. 
For example I have the following code.
 
<apex:selectList id="chooseRule" value="{!}" size="1">
                                <apex:selectOption itemEscaped="false" itemValue="bContains" itemLabel="Contains"/>
                                <apex:selectOption itemEscaped="false" itemValue="bStart" itemLabel="Start with"/>
                                <apex:selectOption itemEscaped="false" itemValue="bNotEqual" itemLabel="Not Equal to"/>
                            </apex:selectList>

How can I show in my code behind, something like: 
   
If(bContains.isSelected){ do something}

Something like that?. 
Thanks!
How can I merge more than 3 contacts?
Is there any code, open source or method I can use for this thing I need to do?

If someone could provide me some code would be great. 

Thanks in advance.
Hello team, 
I have this code
String soql = 'SELECT id, firstName, lastName, accountId FROM Contact';
I need to call all contacts from one simple account. 
I tried this: 
 
SELECT firstName, lastName, accountId FROM Contact WHERE accountid = '00000000000000'

This query worked fine, but my issue is calling all contact list from calling the account name: 
For example: I have Account_1, what I only have is the name, we imagine we do not have the ID, how could make this query by calling the name of the account?
I also tried this but there was no succeed.
String soql = 'SELECT id, firstName, lastName, accountId FROM Contact WHERE account.id;
How could I make this query correct? 
Thanks in advance
 
Hello team, 

Can someone tells me what I am doing wrong with my code?
I am trying to call the contacts by clicking a button
 
<apex:sectionHeader title="Contact Duplicates"/>
              <apex:pageBlockSection>
              <!-- SEARCH TAB -->
                <apex:actionRegion >  
                  <apex:outputPanel id="top" layout="block">
                  <!--[Styles CCS]-->
                    <apex:outputLabel for="txtSearch"/>
                    <apex:inputText id="txtSearch" html-placeholder="Search your account" value="{!searchStringCnt}" />
                      <span>
                      <apex:commandButton id="btnGo" value="Search" action="{!SearchCnt}" rerender="searchResults"></apex:commandButton>
                      </span>
                  </apex:outputPanel>
              
                  <apex:outputPanel id="pnlSearchResults" style="margin:10px;height:350px;overflow-Y:auto;" layout="block">
                    <apex:pageBlock id="searchResults"> 
                      <apex:pageBlockTable value="{!resultsCnt}" var="c" id="tblResults">
                      
                      <!--//[Checkbox]-->
                      <apex:column headerValue="Selection">
                            <apex:inputCheckbox id="ckDuplicates"></apex:inputCheckbox>
                        </apex:column>
                      
                        <apex:column>
                          <apex:facet name="header">
                            <apex:outputPanel >Firstname</apex:outputPanel>
                          </apex:facet>
                           <apex:outputLink>{!Contact.FirstName}</apex:outputLink>     
                        </apex:column> 
                          
                        <!--//Column Type-->
                        <apex:column>
                          <apex:facet name="header">
                            <apex:outputPanel >Lastname</apex:outputPanel>
                          </apex:facet>
                           <apex:outputLink>{!Contact.LastName}</apex:outputLink>     
                        </apex:column>
                        
                        <!--//Column Phone Number-->
                        <apex:column >
                          <apex:facet name="header">
                            <apex:outputPanel >Phone Number</apex:outputPanel>
                          </apex:facet>
                           <apex:outputLink>{!Contact.Phone}</apex:outputLink>     
                        </apex:column>
        
                      </apex:pageBlockTable>
                    </apex:pageBlock>
                  </apex:outputPanel>
                </apex:actionRegion>
              </apex:pageBlockSection>
Here is the method
///CONTACT DUPLICATE SERCHING
    //performs the keyword search
    public List<Account> resultsCnt {get;set;}
    //public Contact[] cnt {get;set;}
    public string searchStringCnt{get;set;}
      public PageReference searchCnt() {
        runSearchCnt();
        return null;
    }
    
        // prepare the query and issue the search command
      private void runSearchCnt() {
        //prepare query string for complex serarches & prevent injections
        resultsCnt = performSearchCnt(searchStringCnt);               
      } 

      //run the search and return the records found. 
      private List<Account> performSearchCnt(string searchStringCnt) {
    
        //String will make a callback of contacs
        //cnt = [SELECT id, firstName, lastName, phone FROM Contact];
        String soql = 'SELECT id, firstName, lastName, phone FROM Contact';
        if(searchStringCnt != '' && searchStringCnt != null)
        //soql = soql +  ' where name LIKE \'%' + searchStringCnt +'%\'';
        //soql = soql + ' limit 25';
        System.debug(soql);
        return database.query(soql); 
    
      }
      
      // used by the visualforce page to send the link to the right dom element
      public string getFormTagCnt() {
        return System.currentPageReference().getParameters().get('frm');
      }
    
      // used by the visualforce page to send the link to the right dom element for the text box
      public string getTextBoxCnt() {
        return System.currentPageReference().getParameters().get('txt');
      }


Thanks in advance
Does anyone know why this error occured? 
For me it does make any sense?
Unsupported attribute label in &lt;apex:inputText&gt;
User-added image
Hello to all, 

I am trying to develop a method to merge contacts from one simple account, but I need to merge more than 3 contacts, could someone give tutorial about merging contacts in code please? 

Thanks in advance. 
Hello team, 
How could I catch the value {!items} selected and capture it in a variable? I need a simple line of code. 

This is my VF page
<apex:pageBlock tabStyle="Account" title="Merge Accounts">
              <apex:pageBlockSection title="Choose Accounts to Merge" collapsible="false">
                <apex:selectList label="Account 1" value="{!accounts}" size="1">
                    <apex:selectOptions value="{!items}"/>
                </apex:selectList>
                  <!--//[Account to merge]-->
                <apex:selectList label="Account 2" value="{!accounts}" size="1">
                    <apex:selectOptions value="{!items}"/>
                </apex:selectList>
            </apex:pageBlockSection>
        </apex:pageBlock>

Here is the methods in controller
 
public String[] accounts = new String[]{};
            
        public PageReference test() {
            return null;
        }
    	//Here the accounts are invoke
        public List<SelectOption> getItems() 
		{
			List<Account> lstAcc = [select id,name from account limit 10];
			List<SelectOption> options = new List<SelectOption>();

			for(Account acc : lstAcc)
			{
				options.add( new SelectOption( acc.id,acc.Name ));
			}
            return options;
        }
        //Here we get the accounts in getiing them
        public String[] getAccounts() {
            return accounts;
        }
        //Here we set the accounts in setting them
        public void setAccounts(String[] accounts) {
            this.accounts = accounts;
        }

I need to catch the value from selectList in a variable to make validations in a new method.
Thanks in advance.
Hello team, 

I have this code: 
<apex:pageBlock>
              <apex:pageBlockSection title="Custom Picklist Using selectList and selectOption" collapsible="false">
                <apex:selectList value="{!selectedCountry1}" multiselect="false" size="1">
                    <apex:selectOption itemValue="INDIA" itemLabel="India"/>
                    <apex:selectOption itemValue="USA" itemLabel="USA"/>
                    <apex:selectOption itemValue="United Kingdom" itemLabel="UK"/>
                </apex:selectList>
                 
                <apex:outputText value="{!selectedCountry1}" label="You have selected:"/>
            </apex:pageBlockSection>
        </apex:pageBlock>

Controller
public String selectedCountry1{get;set;}

How can I show all my accounts in the selectList? I need an example of coding the method! 
Thanks in advance! 
Hello team, 

I am developing my app in salesforce, but I have a question, is it possible to call a class from VF?
<apex:page standardController="Account" showHeader="true">
This is the header of my visualforce page, I need to call a class where I have some other functions. Email, updating and more. How can I call it? I get into developer console and I press file - new - apex class and I just stated to code. 

Can somebody help me with this issue please?
Thanks in advance. 
 
Hello team,

Is there a good tutorial to make a merge contacts app in apex? 
I have been looking for how to do this. Please could someone explain to me how to make a aplic custom visualforce merge page for contacts or accounts?? 

Thanks in advance! 
Hello team,
I need to create a cleansing app, of course I need to create user authentication and firstly a simple CRUD. I need to develop it MVC c# asp.net. Please can somebody help me out with this?
How could I develop it? I need a tutorial for it.
Something like cloudingo.com
Thanks. 
Hello team,
I need to create a cleansing app, of course I need to create user authentication and firstly a simple CRUD. I need to develop it MVC c# asp.net. Please can somebody help me out with this?
How could I develop it? I need a tutorial for it.
Thanks. 
 
Can someone tells me if it is possible to make a CRUD from asp.net c# MVC application? If it is how can I make it? I have read a lot of documents, texts and forums with no succeed!! 

Thansk in advance! :D 
Hello team, 

I am developing a Cleansing App, I achived to log in with 0Auth2 to salesforce successfully. But at the moment to make my first query the catch statement showed me an error. 

There is an unexpected error: System.AggregateException: Se han producido uno o varios errores. ---> Salesforce.Common.ForceException: The requested resource does not exist en Salesforce.Common.ServiceHttpClient.<HttpGetAsync>d__1`1.MoveNext() --- Fin del seguimiento de la pila de la excepción interna --- en System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) en System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) en System.Threading.Tasks.Task.Wait() en OAuthDemoMVC5.Controllers.SalesforceController.sqlQuery() en C:\Users\RodolfoPC\Desktop\SFAuth0\Auth0\src\DemoMVC5\OAuthDemoMVC5\Controllers\SalesforceController.cs:línea 58 ---> (Nº de excepción interna 0) Salesforce.Common.ForceException: The requested resource does not exist en Salesforce.Common.ServiceHttpClient.<HttpGetAsync>d__1`1.MoveNext()<---

This is my statement: 
 
var client = new ForceClient(auth.InstanceUrl, auth.AccessToken, auth.ApiVersion);
                Task<QueryResult<dynamic>> results = client.QueryAllAsync<dynamic>("SELECT id, FirstName, LastName, Email FROM Contact");
                results.Wait();

                var contacts = results.Result.Records;

                foreach (var contact in contacts)
                {
                    //Console.WriteLine(contact.FirstName);
                    //ViewData["Contacts"] = contact.FirstName.toString();
                    ViewBag.conTShow = contact.FistName.toString();

                }
            }
            catch(Exception e)
            {
                //Console.Write("There is an error: " + e.ToString().Trim());
                ViewBag.conError = "There is an unexpected error: " + e.ToString().Trim();
            }

Can someone help me with this issue please?
Thansk and regards!
If I create a package in salesforce for my app, an error is shown: 
No test methods found in the Apex code included in the package. At least 75% test coverage is required. 

I have more than 2000 lines of code in visualforce page and its controller. This requirement means that I have to re-write all my code??

Thanks in advance.
Hello team, 
I have this code
String soql = 'SELECT id, firstName, lastName, accountId FROM Contact';
I need to call all contacts from one simple account. 
I tried this: 
 
SELECT firstName, lastName, accountId FROM Contact WHERE accountid = '00000000000000'

This query worked fine, but my issue is calling all contact list from calling the account name: 
For example: I have Account_1, what I only have is the name, we imagine we do not have the ID, how could make this query by calling the name of the account?
I also tried this but there was no succeed.
String soql = 'SELECT id, firstName, lastName, accountId FROM Contact WHERE account.id;
How could I make this query correct? 
Thanks in advance
 
Hello Team, 

I packaged a visualforce page and its controller but the code is still able to be seen. How can I hide my code?
Thanks in advance. 
Hello team, 
I have this code: 
public static testMethod PageReference search() 
      {
        try
        {
            //runSearch();
            results = performSearch(searchString);
        }
        catch(Exception e)
        {
            //showMessage = true;
            //message = 'An error has ocurred on public static testmethod PageReference search()';
        }
        return null;
      }
    
      public static List<Account> performSearch(String sString)
      {
        searchString =  sString;
        //String will make a callback of contacs
        String soql = 'select id, name, type, description, website, phone from Account';
        if(searchString != '' && searchString != null)
        soql = soql +  ' where name LIKE \'%' + searchString +'%\'';
        soql = soql + ' limit 25';
        System.debug(soql);
        return database.query(soql); 
      }

All my app is in @isTest
It shows an error: 
Cannot call test methods in non-test context
Error is in expression '{!search}' in component <apex:commandButton> in page lca: External entry point

What am I doing wrong?
If I create a package in salesforce for my app, an error is shown: 
No test methods found in the Apex code included in the package. At least 75% test coverage is required. 

I have more than 2000 lines of code in visualforce page and its controller. This requirement means that I have to re-write all my code??

Thanks in advance.
 Hello team,
I develop an app with a visualforce page and controller, how can I install my app in another salesforce account? Is there any easy way to do this?
 
Thanks in advance
Hello team, 
I have this code
String soql = 'SELECT id, firstName, lastName, accountId FROM Contact';
I need to call all contacts from one simple account. 
I tried this: 
 
SELECT firstName, lastName, accountId FROM Contact WHERE accountid = '00000000000000'

This query worked fine, but my issue is calling all contact list from calling the account name: 
For example: I have Account_1, what I only have is the name, we imagine we do not have the ID, how could make this query by calling the name of the account?
I also tried this but there was no succeed.
String soql = 'SELECT id, firstName, lastName, accountId FROM Contact WHERE account.id;
How could I make this query correct? 
Thanks in advance
 
I have a scenario where too many calculations to be done with large volume of data to load a custom visualforce page report. I have almost avoided unnecessary loop in Apex code. Since it is more than 100k records, calculation is taking long time which is exceeding limit of 10000ms. So it is hitting CPU Limit Exceeded error. Is there a way to increase CPU time?
Hello to all, 

I am trying to develop a method to merge contacts from one simple account, but I need to merge more than 3 contacts, could someone give tutorial about merging contacts in code please? 

Thanks in advance. 
Hello team, 

I have this code: 
<apex:pageBlock>
              <apex:pageBlockSection title="Custom Picklist Using selectList and selectOption" collapsible="false">
                <apex:selectList value="{!selectedCountry1}" multiselect="false" size="1">
                    <apex:selectOption itemValue="INDIA" itemLabel="India"/>
                    <apex:selectOption itemValue="USA" itemLabel="USA"/>
                    <apex:selectOption itemValue="United Kingdom" itemLabel="UK"/>
                </apex:selectList>
                 
                <apex:outputText value="{!selectedCountry1}" label="You have selected:"/>
            </apex:pageBlockSection>
        </apex:pageBlock>

Controller
public String selectedCountry1{get;set;}

How can I show all my accounts in the selectList? I need an example of coding the method! 
Thanks in advance! 
Hello team,
I need to create a cleansing app, of course I need to create user authentication and firstly a simple CRUD. I need to develop it MVC c# asp.net. Please can somebody help me out with this?
How could I develop it? I need a tutorial for it.
Thanks. 
 
Hello team, 

I need to know if there is any possibility to create a Data Cleansing App for multiple companies. So, as first step, I need to create a data cleansing for my own company first of course, Is there any Data Cleansgin Open Source or guide to help me with my question. I need the code, some kind of guide or something. I want to create something like Cloudingo and Dupcatcher. 

Thanks team. 
How to make a simple SELECT from accounts module of an salesforce app module in asp.net C#.
How could be possible to make queries in asp.net MVC C# application and show them in a window of the app. 

Thanks! 
I have a scenario where too many calculations to be done with large volume of data to load a custom visualforce page report. I have almost avoided unnecessary loop in Apex code. Since it is more than 100k records, calculation is taking long time which is exceeding limit of 10000ms. So it is hitting CPU Limit Exceeded error. Is there a way to increase CPU time?