• vijayabakarareddy yarrabothula
  • NEWBIE
  • 90 Points
  • Member since 2016

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 5
    Questions
  • 15
    Replies
I have defined a list and gave it size of 6. On adding two elements in it by using list.add() method, the size of list is increasing. Why the size of list is increasing? Shouldnt it remain same?
Kindly find the snapshot of the coding.User-added image
HI ,

I have genrated one Partner WSDL and trying to genrate Apex code from that WSDL into another user salesforce, but i am getting error
 Apex Generation Failed
"Unsupported schema type: {http://www.w3.org/2001/XMLSchema}anyType"
Please help me , I am new in salesforce.

Thanks & Regards
Bhushan Singh 
 
trigger DisableDelete on Lead (before Delete) {
for(Lead l:trigger.old){
  if(l.Industry != 'Banking')
  l.addError('u can not delete this recored');
}
}
rigger FindDuplicateContact on Contact (before insert, before update) {
  for (Contact con : Trigger.new) {
    if (con.Email != null && con.Phone !=null) {
      List<contact> dupes = [SELECT Id FROM Contact
                               WHERE Email = :con.Email AND Phone=:con.phone];
      if (dupes != null && dupes.size() > 0) {
        String errorMessage = 'Duplicate contact found! ';
        errorMessage += 'Record ID is ' + dupes[0].Id;
        con.addError(errorMessage);
      }
    }
  }
}
public class c2{



  list<Account> acct=[select name,industry,phone,type,fax  From Account];
  
   list<Account> acct1=[select name,industry,phone,type,fax  From Account where industry='banking'];
   public list<Account> getacct(){
   
    return acct;
    }
    
    public list<Account> getacct1(){
   
    return acct1;
    }
    
}

//i am creating Account from using partner wsdl , And it is generating  session id and  login success  but data is not inserting into Account Obj
//upto line no 26 is  executing  after that it is not executing
//

global class CustomerServiceController{

    public PageReference doSave() {
    
     //connection
     partnerSoapSforceCom.soap mypartnerSoap= new  partnerSoapSforceCom.soap();
    partnerSoapSforceCom.LoginResult partnerloginResult =
     mypartnerSoap.Login('**********************@gmail.com','*******************fi4ZlW9JYldRbmNG2EfD9kd1');
     System.debug('baskar-------------------------------->'+partnerloginResult);
     System.debug('your sessio id------------------------>'+partnerloginResult.sessionId);
     
     
          
     //parameter passing
     
     String sessionId = partnerLoginResult.sessionId;
soapSforceComSchemasClassAccountser.SessionHeader_element 
 webserviceSessionHeader =
  new  soapSforceComSchemasClassAccountser.SessionHeader_element();
  webserviceSessionHeader.sessionId =sessionId;
   System.debug('this is line no 20-------------->');
  soapSforceComSchemasClassAccountser.AccountService objA1 =
   new  soapSforceComSchemasClassAccountser.AccountService();
    System.debug('this is line no 23-------------->');
   objA1.SessionHeader = webserviceSessionHeader;
   
    System.debug('this is line no 26-------------->');
   String status = objA1.createCustomer(objA.Name,objA.phone,objA.Site);
    if(status=='success'){
     System.debug('this is line no 29-------------->');
      Insert objA;
       System.debug('this is line no 31-------------->');
      }
      
      if(objA.Id!=NULL){
       System.debug('customer created successfully-------------->');
        statusmsg ='customer created successfully';
        }
    
        return null;
    }

  public Account objA{get;set;}
  public String statusmsg {get;set;}
  public CustomerServiceController(){
   objA= new Account();
   statusmsg='';
   
 }
 }



//apex code

<apex:page controller="CustomerServiceController" tabStyle="Account"> <apex:form > <apex:outputText value="{!statusmsg}"></apex:outputText> <apex:pageBlock title="new customer" > <apex:pageBlockSection columns="1" title="personal info"> <apex:inputField value="{!objA.Name}" > </apex:inputField> <apex:inputField value="{!objA.Phone}"> </apex:inputField> </apex:pageBlockSection> <apex:pageBlockSection columns="1" title="l Address info2"> <apex:inputField value="{!objA.Site}"></apex:inputField> </apex:pageBlockSection> <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!doSave}"/> </apex:pageBlockButtons> </apex:pageBlock> </apex:form> </apex:page>

//AccountService class in Source org

global class AccountService{
webService static String createCustomer(String Name,String phone, String Site)
{
Account objA= new Account();
objA.Name= Name;
objA.phone=phone;
objA.Site=site;

 if(objA.Id!= NULL)
 {
 return 'success';
  
  }
   else{
   return 'failure'
   ;}

}
User-added image 
C:\Users\Sanjeev>java -classpath c:\wsc-20.jar;C:\tools.jar com.sforce.ws.tools.wsdlc C:\enterprise.wsdl.xml C:\enterprise.jar
[WSC][wsdlc.run:312]Created temp dir: C:\Users\Sanjeev\AppData\Local\Temp\wsdlc-temp-5235696605020187642-dir
[WSC][wsdlc.<init>:79]Generating Java files from schema ...
[WSC][wsdlc.<init>:79]Generated 676 java files.
[WSC][wsdlc.compileTypes:262]Compiling to target 1.6...
javac: target release 1.6 conflicts with default source release 1.8
Error: Failed to compile

C:\Users\Sanjeev>
 
I have defined a list and gave it size of 6. On adding two elements in it by using list.add() method, the size of list is increasing. Why the size of list is increasing? Shouldnt it remain same?
Kindly find the snapshot of the coding.User-added image
Hello,

First of all, I am just the administrator, not a developer and not a coder. However today I am wearing all the hats.  I am hoping someone would be kind enough to help me with the following. I am not sure of even where to start, except that I should do this by a trigger. However I know nothing of how to actually accomplish this. I am hoping that someone could provide the code necessary as I am not savvy enough to write any of it myself. Being a non-profit, we do not have the budget to enlist a professional for this and the task has fallen to me to handle.

Short story - Due to a third party integration, we found that we needed an email address on the account page. However, with the one-to-one model, we are essentially unable to access the true Account record for an individual.  What I would like to accomplish is this:  a trigger that will copy the email address from our Contact object into our email field on the Account object. This would happen when the field is changed in any way.

I hope that I've provided enough information, but if not I will gladly elaborate where needed. Thanks in advance everyone.
HI ,

I have genrated one Partner WSDL and trying to genrate Apex code from that WSDL into another user salesforce, but i am getting error
 Apex Generation Failed
"Unsupported schema type: {http://www.w3.org/2001/XMLSchema}anyType"
Please help me , I am new in salesforce.

Thanks & Regards
Bhushan Singh 
 
I am having 5 picklists in the visualforce page. The first picklist have 2 values (e.g Product 1, Product 2). When the product 1 value selected then it will show only 2 remaining picklists and thier values but when product 2 is selected it should show remaining 4 picklist fields how can I do that. Please help. My Vf Code is.
<apex:page StandardController="Account" extensions="accpickvalues">
    <apex:form >
<apex:pageBlock mode="edit">
        <apex:message id="msg" />
        <apex:pageBlockSection title="Select Model Attributes" >
            
            <apex:inputField value="{!c.Valve_Series__c}"/>
            <apex:inputField value="{!c.Model__c}"/>
              <apex:inputField value="{!c.Valve_Type__c}"/>
            <apex:inputField value="{!c.Body_Size__c}"/>
            <apex:inputField value="{!c.Body_Material__c}"/>
      
            </apex:pageBlockSection> 
        </apex:pageBlock> 
 </apex:form>
</apex:page>

 
Hi
Please help me clear the following concept.

a) Trying to understand what is account share and opportunity share   sobjects.
How they related to account and opportuntity
In what business case scenario do we use them
what is RowCause field? How does it affect Master-detail relationship?

b) How to resolve  " Field is not writeable: " error in apex?
  
Thanks
Pooja 
Hi,

Currently, I am calling a batch class from the trigger.While running the trigger I am getting below error.


Database.executeBatch cannot be called from a batch start, batch execute, or future method.

If anyone know how to resolve this issue. Please let me know.

Thanks,
Vijay
Hello
 I would like to make a mass email function based on the email addresses of a custom object email field.
How can i send please help me.
Thanks in advance.
 
rigger FindDuplicateContact on Contact (before insert, before update) {
  for (Contact con : Trigger.new) {
    if (con.Email != null && con.Phone !=null) {
      List<contact> dupes = [SELECT Id FROM Contact
                               WHERE Email = :con.Email AND Phone=:con.phone];
      if (dupes != null && dupes.size() > 0) {
        String errorMessage = 'Duplicate contact found! ';
        errorMessage += 'Record ID is ' + dupes[0].Id;
        con.addError(errorMessage);
      }
    }
  }
}

Hey everyone

I'm on Salesforce Classic, and am a sytem admin.

I have enabled "Development Mode" in my user profile, but everytime I go to Dev mode from My name --> Development Mode

and click New --> Apex Trigger, this option is greyed out and I can't click it. See attached image

User-added image

Can someone please help me out? I'm new to SF :( sorry for such a silly question

Hi,

I have executed "Run all test" to get code coverage of all apex classes. Is there way to get all apex classes code coverage with percentage copy to excel sheet. I am able to see all classes with percentage in Developer console. But not able to copy all those. Please provide some suggestion.

I am not sure which function should be used between ISNULL and ISBLANK.

 

Can anyone describe this for me?

 

Thank you in advance.

  • July 06, 2010
  • Like
  • 0
I have 6 millions recods.Those records insert into external system to salesforce how to achive it ?

Thanks