• Deepak Rama
  • NEWBIE
  • 184 Points
  • Member since 2014

  • Chatter
    Feed
  • 6
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 27
    Replies
I have a checkbox named Views in Contact and Account. I would like the checkbox in Account to be checked if one of the Contacts have that checkbox checked.  I know about the cross object formula but that only seem to work from Parent to Child object not the other way around. Is there any way to do this except for creating a trigger? If the trigger is only the solution, can you give me an idea what to do? I'm not very familiar with trigger yet. I would need help with this. Thank you!
Hi, I tried to login to dataloader without success. I also changed server host to https://na15.salesforce.com (where our account is located) but nothing changes. The error is: "Error logging in to Salesforce. Please check your username and password." Any help?

I don't have any proxy installed in my computer or internet connection.

Thanks
Currently the trigger is creating 6 duplicate copies of the Opportunity instead of 1. Everything else seems to be working as intended though. 

It looks like its running multiple times through the second loop and adding 6 copies to the list, but shouldn't the "LIMIT 1" in the first section limit the "oppList" size to 1 record and the next 'for' loop only fire for one instance?

trigger insertNewOpp on Opportunity (after update) {

//create list of Opps
List<Opportunity> listOpp = new List<Opportunity>();

for(Opportunity opp : Trigger.new)
{
    //Make a list of all opps where Id is equal to that of the current opp
    List<Opportunity> oppList = [SELECT Id,AccountID,StageName,Primary_Contact__c, LeadSource, ForecastCategoryName, Name, CloseDate, RecordTypeId
        FROM Opportunity
        WHERE ID = :opp.Id
        LIMIT 1];
       
for(Opportunity oppi : oppList){
//if Opp is changed to Closed Won
   if(opp.StageName == 'Closed Won')
       {
           //Create a new opp with the following attributes
          Opportunity oppNew = new Opportunity (AccountID=oppi.AccountID, StageName='Prospecting', Primary_Contact__c=oppi.Primary_Contact__c, LeadSource=oppi.LeadSource, ForecastCategoryName='Omitted', Name=oppi.Name + 'New', CloseDate=oppi.CloseDate, RecordTypeId = '012d0000000SocP'); 
           //Add to the list
          listOpp.add(oppNew);
       }
       }
}
     
     if(listOpp.size() > 0)
     insert listOpp;
}
Hi developers,

I have my apex class deploy in my production instance and before I test this class and this was OK. When I try the implement my visualforce page I have this error "System.QueryException: List has more than 1 row for assignment to SObject" I prove this in my test instance and work fine. Please help me why is the problem.

This is my extension class

public class contactExtension {
    public contactExtension(ApexPages.StandardController contactController) {
       this.contact = (Contact)contactController.getRecord();
       idContact = contact.id;
    }
        
    public List<Beneficio__c> getBeneficiosBob()
    {
        Moneda__c monedabob = [select Name from Moneda__c where Moneda__c.name = 'Bolivianos'];
        idMonedabob = monedabob.id;
        x = 0;
        for (Beneficio__c ben : [select monto_estimado__c from Beneficio__c where Contacto__c = :idContact and Moneda__c = :idMonedabob]){
            if (ben.monto_estimado__c == null){
                ben.monto_estimado__c = 0;
            }
            x = ben.monto_estimado__c + x;
        }
              
        return [select Catalogo_Beneficio__c, Name, Moneda__c, monto_estimado__c, proposito__c,fecha_entrega__c from Beneficio__c where Contacto__c = :idContact and Moneda__c = :idMonedabob];
    }          
}

This is my visualforce page

<apex:page StandardController="Contact" extensions="contactExtension" >
  <apex:pageBlock title="Beneficios Bolivianos">
    <apex:pageBlockTable value="{!BeneficiosBob}" var="beneficio" cellPadding="3" border="1" columnsWidth="50px,110px,60px,60px,230px,30px" rules="all">
        <apex:column value="{!beneficio.Name}"/>
        <apex:column value="{!beneficio.Catalogo_Beneficio__c}"/>
        <apex:column value="{!beneficio.Moneda__c}"/>
        <apex:column value="{!beneficio.monto_estimado__c}" style="text-align:right;"/>
        <apex:column value="{!beneficio.proposito__c}"/>
        <apex:column value="{!beneficio.fecha_entrega__c}"/>
    </apex:pageBlockTable>
      <div class="resaltado">
         Total Bolivianos:       
         <apex:outputText value="{0,number,#,##0.00}" style="padding-left: 10px;">   
           <apex:param value="{!x}"/>
         </apex:outputText>
      </div>
  </apex:pageBlock>
</apex:page>

Regards,
In order for Tableau to connect to Salesforce data, all of the following must be enabled on both your company's account and your user profile. Where and how do I do all of these?

- SOAP API for logging on.

- REST API for getting meta data.

- BULK API for downloading objects.

- REST API for downloading objects that the BULK API does not support.

- Replication SOAP APIs for retrieving changes in the data.
How do we know who created the process builder process and who updated it?
I am not able to see those fields anywhere on the UI. Does metadata have those?

 
We have been directed to this community by support to find out how we can gracefully shut down a force.com url. If anyone has done this before or knows how to point the custom.force.com url to non salesforce website that would be greatly appreciated.
Alright, I'm sure this just has to do with me being very new to Salesforce coding and sites and not knowing what I'm doing but I've beaten my head against this rock enough and beg the wisdom of those more experianced.

I'm making a very simple public page. I'm not even using a custom controller, just the standard contact one.  The premise is that the contact will have recieved an email asking for their permission to send them some information about services.  The email will have a link to my page with the contact id in the url (?id=<the id number>).  The form lets them see their email address on record and check a box to give us permission to email them more.  They click submit, the info gets saved and they get a thank you page.  Thats it, and it works flawlesly when I'm logged in, and it looks fine when I open the page as an anonymous user and don't give it a contact id to work with, however, the moment I put in a contact id when viewing anonymously, I get the Authorization Required page.

<apex:page standardController="Contact" sidebar="false" showHeader="false">
    <div style="width:500px; margin-top:100px; margin-left:auto; margin-right:auto;">
    <apex:pageBlock >
        <h1>Thank you for your interest!</h1><br />
        <p>Please check the box below and click submit to recieve further information.</p><br />
        <apex:pagemessages />
        <apex:form >
        <apex:actionFunction name="saveAndThanks" action="{!Save}" oncomplete="window.parent.location.href='http://abstraktmg.force.com/emailoptin/Email_OptIn_ThankYou'"/>
        <p>Your Email:</p>
        <apex:inputField value="{!Contact.Email}" /><br/>
        <apex:inputCheckbox value="{!Contact.Email_Opt_In__c}"/>I want to know more.<br />
        <apex:CommandButton onClick="saveAndThanks();" value="Submit" />
        </apex:form>
    </apex:pageBlock>
    </div>
</apex:page>
I've tried a lot of the normal debugging advice but since it only gets the error when an id is added, I'm kind of stuck since most of the debugs, like "Preview as Admin" don't seem to run properly with a url argument included.  I did get the guest account added for monitoring but the log doesn't seem to be generating anything usefull.

31.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WORKFLOW,INFO
19:41:15.077 (77125771)|EXECUTION_STARTED
19:41:15.077 (77165945)|CODE_UNIT_STARTED|[EXTERNAL]|066G0000002LFVU|VF: /apex/Email_OptIn
19:41:15.077 (77189102)|CODE_UNIT_STARTED|[EXTERNAL]|VF Controller Save
19:41:15.077 (77213288)|CODE_UNIT_FINISHED|VF Controller Save
19:41:15.946 (189796502)|CUMULATIVE_LIMIT_USAGE
19:41:15.946|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 10
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 10
  Number of Mobile Apex push calls: 0 out of 10

19:41:15.946|CUMULATIVE_LIMIT_USAGE_END

19:41:15.189 (189846151)|CODE_UNIT_FINISHED|VF: /apex/Email_OptIn
19:41:15.191 (191580457)|EXECUTION_FINISHED

Any and all help is much appreciated.  Thank you.

I am getting the below error while redirecting to VF page while selecting the new record type when i click continue

An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience.

Thank you again for your patience and assistance. And thanks for using salesforce.com!

Error ID: 608742340-43136 (-1373969722)

apex page and apex class used
<apex:page standardController="Agreement__c" extensions="DispatcherContactNewController"  action="{!pageredir}" showHeader="false" sidebar="false" cache="true" expires="50" >     
This is my new test page
</apex:page>


public with sharing class CustomAgreement {
    public String home {get;set;}
      
    public Pagereference pageredir()
    {
        home= 'CustomAgreement';
        if(home==null)
            return null;          
            Pagereference newpage = new Pagereference ('/apex/'+home);
            return newpage;
            }   
}
I have a checkbox named Views in Contact and Account. I would like the checkbox in Account to be checked if one of the Contacts have that checkbox checked.  I know about the cross object formula but that only seem to work from Parent to Child object not the other way around. Is there any way to do this except for creating a trigger? If the trigger is only the solution, can you give me an idea what to do? I'm not very familiar with trigger yet. I would need help with this. Thank you!
Hi, I tried to login to dataloader without success. I also changed server host to https://na15.salesforce.com (where our account is located) but nothing changes. The error is: "Error logging in to Salesforce. Please check your username and password." Any help?

I don't have any proxy installed in my computer or internet connection.

Thanks
Hi, 

I was just wondering, can you backup custom object, it's field and security setting before doing a refresh? I just lost a custom object I was working on in Fullcopy sandbox. Without realizing it's not in production, I did a refresh and lost all my work. 

I know you can backup data means each records of the object. However, I haven't seen any post regarding the object backup. 
I'm new to Apex and have a very general question:

* Should I put Try..Catch..Finally statements in ALL of my class methods?  Or,
* Should I only add the Try..Catch..Finally to the main method and not add any handling on the subroutines?

What's the best practice?

Hi,

We have a custom email functionality built in our instance. Here we save the content (invoice/indent) on button click first and send the same content through email again on button click (email button).

Now when we click the "email" to send the content through email from Salesforce, we get an error.

Error: 

"An internal server error has occurred
An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience.

Thank you again for your patience and assistance. And thanks for using salesforce.com!

Error ID: 926367360-106915 (1923490463)"

Please get in touch @7204275528 for further info. on this issue.

Thanks & Regard
Shamsher Singh

Hi, I'm trying to log a case with salesforce to enable some features on my developer Org. But I'm not able to do so. when I go to help$Training and click Submit Case, it is asking for my credentials and once I give them, it is again redirecting back to same help page. does any one know how we can get rid of this.

Thank You
Currently the trigger is creating 6 duplicate copies of the Opportunity instead of 1. Everything else seems to be working as intended though. 

It looks like its running multiple times through the second loop and adding 6 copies to the list, but shouldn't the "LIMIT 1" in the first section limit the "oppList" size to 1 record and the next 'for' loop only fire for one instance?

trigger insertNewOpp on Opportunity (after update) {

//create list of Opps
List<Opportunity> listOpp = new List<Opportunity>();

for(Opportunity opp : Trigger.new)
{
    //Make a list of all opps where Id is equal to that of the current opp
    List<Opportunity> oppList = [SELECT Id,AccountID,StageName,Primary_Contact__c, LeadSource, ForecastCategoryName, Name, CloseDate, RecordTypeId
        FROM Opportunity
        WHERE ID = :opp.Id
        LIMIT 1];
       
for(Opportunity oppi : oppList){
//if Opp is changed to Closed Won
   if(opp.StageName == 'Closed Won')
       {
           //Create a new opp with the following attributes
          Opportunity oppNew = new Opportunity (AccountID=oppi.AccountID, StageName='Prospecting', Primary_Contact__c=oppi.Primary_Contact__c, LeadSource=oppi.LeadSource, ForecastCategoryName='Omitted', Name=oppi.Name + 'New', CloseDate=oppi.CloseDate, RecordTypeId = '012d0000000SocP'); 
           //Add to the list
          listOpp.add(oppNew);
       }
       }
}
     
     if(listOpp.size() > 0)
     insert listOpp;
}
In order for Tableau to connect to Salesforce data, all of the following must be enabled on both your company's account and your user profile. Where and how do I do all of these?

- SOAP API for logging on.

- REST API for getting meta data.

- BULK API for downloading objects.

- REST API for downloading objects that the BULK API does not support.

- Replication SOAP APIs for retrieving changes in the data.