• Raghu_dev
  • NEWBIE
  • 50 Points
  • Member since 2008

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 34
    Replies

This code works in chrome, not in IE. How would I make it work in IE?

 

 

<apex:pageBlockSectionItem >

<apex:outputLabel value="Value 1" for="cbxlevel1"/>

<apex:outputPanel styleClass="requiredInput" layout="block">

<apex:selectList value="{!selectedId}" id="cbxlevel2" size="1">

<apex:selectOptions value="{!availableValues}"/>

<apex:actionSupport event="onclick" action="{!getStuff}" rerender="cbxlevel2"/>

</apex:selectList>

</apex:outputPanel>

</apex:pageBlockSectionItem>

 

 getStuff does not get fired when I pick something from the selectList. It works on chrome though

 

 Any help would be appreciated. 

 

  • March 04, 2010
  • Like
  • 0

Hello wonderful developers out there !! I have been breaking my head for the past three days to get this done but kind of gave up now. I am a medium to advanced developer/analyst (with all the great help from the community) and got stuck with this special problem. I am trying to develop something like address validation (not with any external webservice etc) using some data loaded from a thirdparty vendor into custom object. I managed to accomplish the solution(almost 95%)  using visualforce but got stuck with this one small issue.

 

I have 4 dependent fields - Country, State and City and Zipcode fields for which i am using one custom component (developed by another great developer from the community) to show city names when the user starts typing in city name after selecting Country and State. All this works absolutely fine till that point. Problem starts when user picks the city name from the dropdown when I was expecting zipcode rerender but somehow that rerender is not happening. This is happening when I try to create a new record(editing of the existing record works fine). One thing i observed from the debug logs is the master picklist value(in this case, State) is going back as null to the controller.  This is the code snippet  i have been using  and please help me.

 

Debug log : 

 

17:30:52.262|METHOD_ENTRY|[80,7]|system.debug(String)
17:30:52.263|USER_DEBUG|[80,7]|DEBUG|This.State value now null

 

Apex Page:

 

<apex:page standardController="Account" extensions="AccountController" tabstyle="Account" standardStylesheets="true">
    
    <script type="text/javascript" src="{!URLFOR($Resource.autocompletejs)}" />
	<apex:stylesheet value="{!$Resource.autocompletecss}"/>	
	
	<style>
	
		.cField{
			width:300px;
		}
	</style>
    <script>

		//This is a small workaround for getting the component to work with the enter key
		//I'll include this behavior as part of the component in a next release
 		function noenter(e){
 
		     var key;    
		     if(window.event){
		          key = window.event.keyCode; //IE
		          //alert ('key entered - '+ key);
		     } 
		     else
		          key = e.which; //firefox    
		
		     return (key != 13);	

 		}
 		
       	function disableautocomplete() {
		  var forms = document.getElementsByTagName('form');
		  
		  for (var i = 0; i < forms.length; ++i) {
		    if (forms[i].setAttribute) {
		      forms[i].setAttribute('autocomplete', 'off')
		    } else {
		      forms[i].autocomplete = 'off'
		    }
		  }
		}
		
		if (window.addEventListener) {
		  window.addEventListener('load', disableautocomplete, true)
		} else if (window.attachEvent) {
		  window.attachEvent('onload', disableautocomplete)
		} else {
		  window.onload = disableautocomplete
		}
	</script>
    <apex:form id="addressForm">
        <apex:pageBlock mode="edit" id="thePageBlock">
            <apex:pageMessages />
            <apex:pageBlockSection title="Account Information" columns="2" id="theInfoSection">
                 <apex:inputField id="accname" value="{!Account.name}"/>
               	 <apex:inputField id="accowner" value="{!Account.Owner.Name}"/>
                 <apex:inputField id="accphone" value="{!Account.Phone}"/>
                 <apex:inputField id="accfax" value="{!Account.Fax}"/>
                 <apex:inputField id="accwebsite" value="{!Account.Website}"/>
                 
            </apex:pageBlockSection> 
            <apex:pageBlockSection title="Address Information" columns="1" id="theSection">
                	
                <apex:actionRegion >
	                <table class="detailList">
	                   <tbody>
	                    <tr> 
	                   	    <td class="labelCol first">Street Address</td>
	                   		<td class="data2Col first">
	                   			<apex:inputField id="theAddress1" value="{!Account.MODS_Address__c}" required="true"/> 
	                   		</td>
	                   	</tr>
	                   	<tr> 
	                   	    <td class="labelCol first">P.O Box(Address 2)</td>
	                   		<td class="data2Col first">
	                   			<apex:inputField id="theAddress2" value="{!Account.MODS_Address_2__c}" required="false"/> 
	                   		</td>
	                   	</tr>
	                   	<tr> 
	                   	    <td class="labelCol first  ">Country </td>
	                   		<td class="data2Col first">
	                   			<apex:inputField id="theCountry" value="{!Account.MODS_Country__c}" required="true"/> 
	                   		</td>
	                   	</tr>
		                <tr>
					       <td class="labelCol first  ">State </td>
					       <td class="data2Col first">
					        	<apex:actionRegion >  
			                    <apex:selectList id="theState" value="{!account.MODS_State__c}" required="true" size="1">
			                    	<apex:selectOptions value="{!States}"/>
			                		<apex:actionSupport event="onchange" action="{!resetCity}" rerender="cityDisplay"/>
			                	</apex:selectList>
			                	</apex:actionRegion>
	                	   </td>
	                		
	                	</tr>
	                	</tbody>
	                </table>	
                </apex:actionRegion> 
                <apex:outputPanel id="cityDisplay" layout="block" style="font-weight:bold">
                   <table class="detailList">
                   <tbody>
	                <tr>
				       <td class="labelCol first  ">City</td>
				        <td class="data2Col first  ">
				            <apex:inputField onkeypress="return noenter(event)" value="{!Account.MODS_City__c}" id="cityname" styleClass="cField" required="true">
	           					<c:AutoComplete Width="200" ClassName="autocomplete" InputId="{!$Component.cityname}" AutoCompleteId="accACid" ObjectName="Vertex_Data__c" StateName="{!$Component.theState}"/>
	           					<apex:actionSupport event="onblur" action="{!resetZip}" rerender="zipDisplay"/>
	           				</apex:inputField>      
				        </td>
				        <!-- <td class="data2Col first  ">
				        	<apex:commandButton value="Get Zipcodes" action="{!doNothing}" rerender="zipDisplay"/>
				        </td>
				         -->
				    </tr>
				       
				    </tbody>
				  </table>
				 </apex:outputPanel> 
				 
				 
                  <apex:outputPanel id="zipDisplay" layout="block" style="font-weight:bold">
                  <table class="detailList">
	                  <tbody>
		                  <tr>
						       <td class="labelCol first">Zipcode</td>
						        <td class="data2Col first">
						            <apex:selectList id="theZip" value="{!account.Zip_code_Postal_code__c}" size="1" required="false">
					                    <apex:selectOptions value="{!Zips}"/>
					                </apex:selectList>      
						        </td>
						    </tr>       
					    </tbody>
				  </table>
				  </apex:outputPanel>	
             </apex:pageBlockSection>
            <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Save" action="{!Save}"/>
                <apex:commandButton value="Cancel" action="{!Cancel}"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
			
</apex:page>

Controller code :  

 

 

public class AccountController {
	//private final ApexPages.standardController theController;
    private final Account account; //{get { theController. } private set;}
    /*public String stateVal{get {
    	return account.MODS_State__c;
    }}
    public void setStateVal(String s){
    	account.MODS_State__c = s;
    }
    public String zipVal{ get {
    	return account.Zip_code_Postal_code__c;
    	}
    }
    
    
    public void setZipVal(String s){
    	account.Zip_code_Postal_code__c = s;
    }
    */
    /*
    
    public String getState() { return state; }
    public void setState(String s) { 
    	this.account.MODS_State__c = s; 
    	state=s;
    	}
    */
    /*String city;
    public String getCity() { return this.account.MODS_City__c; }
    public void setCity(String s) { this.account.MODS_City__c = s; }
	*/
    public AccountController(ApexPages.StandardController stdController) {
    	//this.account = (Account)stdController.getRecord();
        //Id id = ApexPages.currentPage().getParameters().get('id');
        this.account = stdController.getId() != null ? 
        						[SELECT  
                                    a.Name,
                                    a.MODS_Address__c, 
                                    a.MODS_Address_2__c, 
                                    a.MODS_City__c, 
                                    a.MODS_State__c, 
                                    a.MODS_Country__c,
                                    a.Zip_code_Postal_code__c,
                                    a.Owner.Name,
                                    a.Phone,
                                    a.Fax,
                                    a.WebSite
                                   FROM account a WHERE a.id = :stdController.getId()]:
        						new Account();
        
       
    }
	 
	public Account getAccount() {
            return account;
    }
	
	/*public String getStateVal(){ return stateVal;}
	public void setStateVal(String stateVal) { 
		system.debug('Inside setter, String S value ' + stateVal);
		account.MODS_State__c = stateVal; 
	}
	*/
   public void resetCity(){
   		account.MODS_City__c = null;
   		account.Zip_code_Postal_code__c = null;
   }
  
   public void resetZip(){
   		account.Zip_code_Postal_code__c = (account.Zip_code_Postal_code__c != '- None -' ) ? account.Zip_code_Postal_code__c : null ;
   }
   
   public list<AggregateResult> lstAR = new list<AggregateResult>();
   
   public List<SelectOption> getZips() {
      List<SelectOption> optionList = new List<SelectOption>();
      optionList.add(new SelectOption('', '- None -')); 

      
      system.debug('This.State value now ' +  this.account.MODS_State__c);
      if(this.account.MODS_State__c != null) {
      //if(state != null) {
        for (Vertex_Data__c vd : [select Postal_Code__c from Vertex_Data__c where State__c =: this.account.MODS_State__c and City__c = : this.account.MODS_City__c]){ 
          optionList.add(new SelectOption(vd.Postal_Code__c,vd.Postal_Code__c));
        }
      }
      return optionList;
     
   }

   public List<SelectOption> getStates() {
      List<SelectOption> optionList = new List<SelectOption>();
      
      optionList.add(new SelectOption('','- None -'));
	  optionList.add(new SelectOption('PA','PA'));
	  optionList.add(new SelectOption('CT','CT'));
      return optionList;   
      /*lstAR = [SELECT State__c FROM Vertex_Data__c GROUP BY State__c];  
	  
      
      for (AggregateResult vd : lstAR){ 
        optionList.add(new SelectOption((String)vd.get('State__c'), (String)vd.get('State__c')));
      }
      */  
    }
    
    /*public PageReference searchZips() {
      //List<SelectOption> optionList = new List<SelectOption>();
      
      optionList.add(new SelectOption('', '- None -')); 

      system.debug('State value now ' + stateVal);
      system.debug('This.State value now ' +  account.MODS_State__c);
      if(stateVal != null) {
      //if(state != null) {
        for (Vertex_Data__c vd : [select Postal_Code__c from Vertex_Data__c where State__c =: stateVal and City__c = : this.account.MODS_City__c]){ 
          optionList.add(new SelectOption(vd.Postal_Code__c,vd.Postal_Code__c));
        }
      }
      return null;
     
    }*/
    public PageReference doNothing() {
    	return null;
    }
   /* 
    public List<SelectOption> getCities() {
      List<SelectOption> optionList = new List<SelectOption>();
      
       optionList.add(new SelectOption('', '- None -')); 

      
      if(account.MODS_State__c != NULL) {
        for (Vertex_Data__c vd : [select City__c from Vertex_Data__c where State__c =: this.account.MODS_State__c]){ 
          optionList.add(new SelectOption(vd.city__c,vd.City__c));
        }
      }
      return optionList;
    }
	*/
	
	public PageReference save() {
      try {
      	  if (this.account.id == null) {
      	  	insert account;	
      	  }
          else
           update account;
           
       } catch(System.DMLException e) {
           ApexPages.addMessages(e);
           
       }
       //  After Save, navigate to the default view page:  
       
       //theController.save();
       return (new ApexPages.StandardController(account)).view();
   }
   public PageReference cancel() {
       PageReference accountPage = new ApexPages.StandardController(account).view();
       accountPage.setRedirect(true);
       return accountPage;
   }
}

 

 

 

Hello Community, 

 

I have a requirement where I have to add checkboxes to a related list and when user changes value on master record, I have to change all the checked records from related list (change in value in one of the fields from related list). 

 

Is there a way I could do the above or am I just dreaming ? And btw, I am a newbie in Visualforce (I am sure you could figure out from the request). I really appreciate if you could throw some ideas  on how I can handle this requirement(attached image). All I did so far is the following lines of code 

 

 

<apex:page standardController="Projects__c" >

<apex:detail subject="{!Projects__c.Id}" relatedList="false" title="false"/>

<apex:relatedList list="Leads__r"/>

</apex:page>

 Any help in directing me to the solution for the above requirement is greatly appreciated.

 

Thank you

Raghu 

 ProjectStatusChange

 

 

Message Edited by Raghu_dev on 12-06-2009 08:00 PM

Once again, I bumped into several issues importing wsdl into Salesforce. Here is the background - I am using a wsdl from a hosted service (Bridger/Choicepoint - https://bixgtest.choicepoint.com/webservices/3.0/xgdirect1.asmx?WSDL) and trying to import into sfdc for further processing. But the issue started when I started importing the wsdl and sfdc is throwing the following error - Multiple port types are not supported. I scanned through the wsdl and removed multiple ports (locally) and tried to import which seems like it imported successfully but the last step (generate apex code) gave an error saying - soap 1.1 address is not found. Not sure where to find the correct solution and if anyone knows better please help me.

 

Please feel free to access the above wsdl.

 

Thank you

Raghu 

Message Edited by Raghu_dev on 03-09-2009 11:44 AM
Hi, I have a problem creating(actually cloning) attachment from a s-control. I search all the community tags/threads and there was none which can help me identify the issue. Idea is, s-control creates a copy of attachment and attach it to a specific account. But this s-control is giving an error as stated on my message subject. Please help me if someone out there has the problem solution. Here is the code
Code:
function moveAttachments() {
var desc = sforce.connection.describeSObject("Attachment"); 
var qfields = desc.toUpdateFieldNames(); var attrelList = sforce.connection.query("Select Id, " + qfields + " from Attachment where ParentId = '"+ curProsId + "' limit 1"); //delete attrelList.Id; attrelList.ParentId = masterSFDCId; //attrelList.ParentType = "Account"; attrelList.Id = null; attrelList.ContentType = "txt"; attrelList.Name = "Test" var cloneAtt = sforce.connection.create([attrelList]); }

 

Thanks
Raghu



Hi,

We have a very dynamic assignment rules on leads which change very frequently and we want to be more affective and time saving making these changes. Hence we would want to get the business admin change the assignment rules on a excel spreadsheet and use the excel connector to automatically update the SFDC. Please let me know if this is possible at all using the excel connector or please suggest the best practice to achieve this functionality (not using sfdc UI)

Appreciate your help.

thanks
Raghu
Hi,

Could some one help me on how to print all the field names and associated labels for a specified salesforce object(eg., Account). I need this for documentation purposes. Appreciate your help.

Message Edited by Raghu_dev on 10-07-2008 08:25 AM
Hi,

Can I use the static resource in a s-control ?

Like,
Code:
<script type="text/javascript" src="{!Resource.Companies}"> </script>

 
If no, is there a simpler way to use a .js file from the s-control. I have lot of functions defined in a .js file and I want to re-use them in multiple s-controls. Could someone pls let me know how I can do this.

Thanks


Hi, Can some one help me how to loop through the map object?

For eg., I have the following map variable declared and populated the values.. I want to query the map variable at the later stages in the code and loop through the results. Please advice


Code:
 Map<String, Lead> leadMap = new Map<String, Lead>();
 for (Lead lead : Trigger.new) {
  leadMap.put(lead.DUNS_NEW__c, lead);
 }

 Let me explain the requirement a little more..

I want to use the map as a resultset (or a recordset). Because of the governing rules in salesforce, I am trying to replace my repetitive soql statements align to maps and sets. Actual requirement is as follows.

There will be a huge load of leads from several vendors into our sfdc org. These leads will have DUNS numbers. The trigger on lead will have to look for the duns number on account (which was already populated from a different process) object and attach the lead to that account.

my earlier code was working perfect but because of the soql governing limits on trigger , I have to change that code to work.
Here is the actual code :
Code:
trigger dunsOnLeads on Lead (before insert, before update) {

 for (Lead ld : Trigger.new) {
        
        String str = ld.DUNS_NEW__c;
        String mstrSfdcId = '';
        Id sfdcId;
        // for customer identification
        String custmstrSfdcId = '';
        Id custsfdcId;
        // for prospect identification
        String prosmstrSfdcId = '';
        Id prossfdcId;
        
        System.debug('Duns on Lead ' + str);
        Integer custi=0;
        Integer prosi=0;
        
        Integer i=0;
        if (str != null) //find for null (or space)
        {
         // look for active customers 
         for (Account tmpAccnt : [select Id, Master_SFDC_ID__c, MODS_Account_Type__c, customer_number__c  from Account where IsDeleted = false and Duns__c = :ld.duns_new__c]) 
         {
             if ((tmpAccnt.MODS_Account_Type__c == 'Customer') && (tmpAccnt.customer_number__c != ''))
             {
              custmstrSfdcId = tmpAccnt.Master_SFDC_ID__c;
              custsfdcId = tmpAccnt.Id;
              custi++;
             }
             else
             {
              prosmstrSfdcId = tmpAccnt.Master_SFDC_ID__c;
              prossfdcId = tmpAccnt.Id;
              prosi++;
             } 
         }
         if (custi > 0) // there are no customers found with the same duns number
         {
          mstrSfdcId = custmstrSfdcId;
          sfdcId = custsfdcId;
          i = custi;
         }
         else if (prosi > 0)
         {
          mstrSfdcId = prosmstrSfdcId;
          sfdcId = prossfdcId;
          i = prosi;
         }
         // if no customers found with the same match, look for prospects
         /*if (i==0) 
         {
          for (Account tmpAccnt : [select Id, Master_SFDC_ID__c from Account where 
           IsDeleted = false and MODS_Account_Type__c = 'Prospect'
           and Duns__c = :ld.duns_new__c]) {
              mstrSfdcId = tmpAccnt.Master_SFDC_ID__c;
              sfdcId = tmpAccnt.Id;
              i++;
          }
         }*/
         // if the account is identified as slave, master sfdc id is the unique id of the master. 
         // in that case, lead will be attached to that master account.
         //System.debug('Master SFDC: ' + mstrSfdcId);
         //System.debug('Integer i: ' + i);
         //System.debug('SFDC Id: ' + sfdcId);
         if (i > 1 && mstrSfdcId == null)
         {
           ld.account__c = sfdcId;
           // Attach this lead to the last account from search and also, show this lead on the view
           ld.Dup_DUNS__c = True;
         }
         else if (i > 1 && mstrSfdcId != null)
         {
          ld.account__c = mstrSfdcId; 
         }
         else if (i == 1 && mstrSfdcId != null)
         {
          ld.account__c = mstrSfdcId;  
         }
         else if (i == 1 && mstrSfdcId == null && sfdcId != null)
         {
          ld.account__c = sfdcId;  
         }
         else if (i==0)
         {
          ld.account__c = null;
          ld.Dup_DUNS__c = False;
         }
        }
        else
        {
          ld.account__c = null;
          ld.Dup_DUNS__c = False;
        }
 
    }
}

 

Here is the idea how to replace that code align to maps and sets .. pls advice if the approach is wrong

1. Get all the lead duns # and the Ids associated to those leads into a map
Code:
 Map<String, Lead> leadMap = new Map<String, Lead>();
 for (Lead lead : Trigger.new) {
  leadMap.put(lead.DUNS_NEW__c, lead.Id);
 }

 

2. Query the account with the keys (duns) from the above map
Code:
for (Account newAccnt = new [select Id, Master_SFDC_ID__c, MODS_Account_Type__c, customer_number__c  from Account where IsDeleted = false and Duns__c IN : leadMap.keyset()])

3. The above query can result in bulk records as there are duplicate duns numbers in accounts.
4. Now, I have to loop  through the leadmap to identify the account associated to that lead (as the duns on lead and duns on account matches)
 ---- How to query or search the map object ?
 ---- How to loop through the map object  ?
5. Then populate the lead account id with the account id of the matching account record.

Please help





Thanks
Raghu

Message Edited by Raghu_dev on 09-08-2008 09:05 AM

Message Edited by Raghu_dev on 09-08-2008 09:46 AM
Hi,

I am having problem when accessing strikeiron webservice. Please help me.

I am accessing strikeiron webservice and trying to show the output in a scontrol but I am getting an error saying

System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element http://www.strikeiron.com=ServiceStatus

Code:
// Here is the scontrol code //

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <script type="text/javascript" src="/js/functions.js"></script>
    <script src="/soap/ajax/12.0/connection.js"></script>
    <script src="/soap/ajax/12.0/apex.js"></script>
</head>

<body>
<div class="pagelabel"> Call webservice</div>
  <script language="javascript" type="text/javascript"> 
  function callStrikeIron()
  {
   //alert("Call Strike");
   var elem = document.getElementById("docBody");
   sforce.apex.debug=true;
   var theBody = '<table><tr><td>ZipInfo</td><td>';
   var result = sforce.apex.execute("StrikeIronWrapper", "wrapper", {varZipCode:"19406"});
   theBody += result + '</td></tr></table>';
   elem.innerHTML = theBody;
  }
  
  callStrikeIron();
  </script>
<div id="docBody"></div>
</body>
</html>

// Here is the actual class

//Generated by wsdl2apex

global class zipInfoLookup{
    public class ZipInfoListing {
        public String CityName;
        public String PreferredName;
        public String StateAbbreviation;
        public String Classification;
        public String County;
        private String[] CityName_type_info = new String[]{'CityName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] PreferredName_type_info = new String[]{'PreferredName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] StateAbbreviation_type_info = new String[]{'StateAbbreviation','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Classification_type_info = new String[]{'Classification','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] County_type_info = new String[]{'County','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'CityName','PreferredName','StateAbbreviation','Classification','County'};
    }
    public class ServiceOutput {
        public zipInfoLookup.SIWsStatus ServiceStatus;
        private String[] ServiceStatus_type_info = new String[]{'ServiceStatus','http://www.strikeiron.com','SIWsStatus','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ServiceStatus'};
    }
    public class ZipInfoResult {
        public String Code;
        public String Latitude;
        public String Longitude;
        public String TimeZone;
        public String StandardGMTOffset;
        public String DaylightGMTOffset;
        public zipInfoLookup.ArrayOfZipInfoListing Listings;
        private String[] Code_type_info = new String[]{'Code','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Latitude_type_info = new String[]{'Latitude','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Longitude_type_info = new String[]{'Longitude','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] TimeZone_type_info = new String[]{'TimeZone','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] StandardGMTOffset_type_info = new String[]{'StandardGMTOffset','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] DaylightGMTOffset_type_info = new String[]{'DaylightGMTOffset','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Listings_type_info = new String[]{'Listings','http://www.strikeiron.com','ArrayOfZipInfoListing','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'Code','Latitude','Longitude','TimeZone','StandardGMTOffset','DaylightGMTOffset','Listings'};
    }
    public class ServiceInfoRecord {
        public String InfoKey;
        public String InfoValue;
        private String[] InfoKey_type_info = new String[]{'InfoKey','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] InfoValue_type_info = new String[]{'InfoValue','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'InfoKey','InfoValue'};
    }
    public class zipinfoSoap {
        public String endpoint_x = 'http://ws.strikeiron.com/StrikeIron/ZipInfo3/zipinfo';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public wsStrikeironCom.SubscriptionInfo SubscriptionInfo;
        public wsStrikeironCom.LicenseInfo LicenseInfo;
        private String SubscriptionInfo_hns = 'SubscriptionInfo=http://ws.strikeiron.com';
        private String LicenseInfo_hns = 'LicenseInfo=http://ws.strikeiron.com';
        private String[] ns_map_type_info = new String[]{'http://ws.strikeiron.com', 'wsStrikeironCom', 'http://www.strikeiron.com', 'zipInfoLookup'};
        public void GetRemainingHits() {
            wsStrikeironCom.GetRemainingHits_element request_x = new wsStrikeironCom.GetRemainingHits_element();
            wsStrikeironCom.GetRemainingHitsResponse_element response_x;
            Map<String, wsStrikeironCom.GetRemainingHitsResponse_element> response_map_x = new Map<String, wsStrikeironCom.GetRemainingHitsResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://ws.strikeiron.com/StrikeIron/ZipInfo3/zipinfo/GetRemainingHits',
              'http://ws.strikeiron.com',
              'GetRemainingHits',
              'http://ws.strikeiron.com',
              'GetRemainingHitsResponse',
              'wsStrikeironCom.GetRemainingHitsResponse_element'}
            );
            response_x = response_map_x.get('response_x');
        }
        public zipInfoLookup.StatusCodeOutput GetAllStatuses() {
            zipInfoLookup.GetAllStatuses_element request_x = new zipInfoLookup.GetAllStatuses_element();
            zipInfoLookup.GetAllStatusesResponse_element response_x;
            Map<String, zipInfoLookup.GetAllStatusesResponse_element> response_map_x = new Map<String, zipInfoLookup.GetAllStatusesResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://www.strikeiron.com/GetAllStatuses',
              'http://www.strikeiron.com',
              'GetAllStatuses',
              'http://www.strikeiron.com',
              'GetAllStatusesResponse',
              'zipInfoLookup.GetAllStatusesResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.GetAllStatusesResult;
        }
        public zipInfoLookup.ServiceInfoOutput GetServiceInfo() {
            zipInfoLookup.GetServiceInfo_element request_x = new zipInfoLookup.GetServiceInfo_element();
            zipInfoLookup.GetServiceInfoResponse_element response_x;
            Map<String, zipInfoLookup.GetServiceInfoResponse_element> response_map_x = new Map<String, zipInfoLookup.GetServiceInfoResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://www.strikeiron.com/GetServiceInfo',
              'http://www.strikeiron.com',
              'GetServiceInfo',
              'http://www.strikeiron.com',
              'GetServiceInfoResponse',
              'zipInfoLookup.GetServiceInfoResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.GetServiceInfoResult;
        }
        public zipInfoLookup.ZipInfoOutput GetCityState(String ZipCode) {
         // zipInfoLookup.ZipInfoOutput
            zipInfoLookup.GetCityState_element request_x = new zipInfoLookup.GetCityState_element();
            zipInfoLookup.GetCityStateResponse_element response_x;
            request_x.ZipCode = ZipCode;
            Map<String, zipInfoLookup.GetCityStateResponse_element> response_map_x = new Map<String, zipInfoLookup.GetCityStateResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://www.strikeiron.com/GetCityState',
              'http://www.strikeiron.com',
              'GetCityState',
              'http://www.strikeiron.com',
              'GetCityStateResponse',
              'zipInfoLookup.GetCityStateResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            system.debug('response ' + response_x);
            return response_x.GetCityStateResult;
        }
    }
    public class GetServiceInfo_element {
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{};
    }
    public class SIWsStatus {
        public Integer StatusNbr;
        public String StatusDescription;
        private String[] StatusNbr_type_info = new String[]{'StatusNbr','http://www.w3.org/2001/XMLSchema','int','1','1','false'};
        private String[] StatusDescription_type_info = new String[]{'StatusDescription','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'StatusNbr','StatusDescription'};
    }
    public class ArrayOfZipInfoListing {
        public zipInfoLookup.ZipInfoListing[] ZipInfoListing;
        private String[] ZipInfoListing_type_info = new String[]{'ZipInfoListing','http://www.strikeiron.com','ZipInfoListing','0','-1','true'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ZipInfoListing'};
    }
    public class StatusCodeOutput {
        public zipInfoLookup.StatusCodeResult ServiceResult;
        private String[] ServiceResult_type_info = new String[]{'ServiceResult','http://www.strikeiron.com','StatusCodeResult','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ServiceResult'};
    }
    public class ArrayOfSIWsStatus {
        public zipInfoLookup.SIWsStatus[] SIWsStatus;
        private String[] SIWsStatus_type_info = new String[]{'SIWsStatus','http://www.strikeiron.com','SIWsStatus','0','-1','true'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'SIWsStatus'};
    }
    global class ZipInfoOutput {
        public zipInfoLookup.ZipInfoResult ServiceResult;
        private String[] ServiceResult_type_info = new String[]{'ServiceResult','http://www.strikeiron.com','ZipInfoResult','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ServiceResult'};
    }
    public class SIWsResult {
        public Integer Count;
        private String[] Count_type_info = new String[]{'Count','http://www.w3.org/2001/XMLSchema','int','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'Count'};
    }
    public class GetCityState_element {
        public String ZipCode;
        private String[] ZipCode_type_info = new String[]{'ZipCode','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ZipCode'};
    }
    public class StatusCodeResult {
        public zipInfoLookup.ArrayOfSIWsStatus Statuses;
        private String[] Statuses_type_info = new String[]{'Statuses','http://www.strikeiron.com','ArrayOfSIWsStatus','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'Statuses'};
    }
    public class SIServiceInfoResult {
        public zipInfoLookup.ArrayOfServiceInfoRecord ServiceInfo;
        private String[] ServiceInfo_type_info = new String[]{'ServiceInfo','http://www.strikeiron.com','ArrayOfServiceInfoRecord','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ServiceInfo'};
    }
    public class ArrayOfServiceInfoRecord {
        public zipInfoLookup.ServiceInfoRecord[] ServiceInfoRecord;
        private String[] ServiceInfoRecord_type_info = new String[]{'ServiceInfoRecord','http://www.strikeiron.com','ServiceInfoRecord','0','-1','true'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ServiceInfoRecord'};
    }
    public class GetAllStatuses_element {
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{};
    }
    public class GetServiceInfoResponse_element {
        public zipInfoLookup.ServiceInfoOutput GetServiceInfoResult;
        private String[] GetServiceInfoResult_type_info = new String[]{'GetServiceInfoResult','http://www.strikeiron.com','ServiceInfoOutput','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'GetServiceInfoResult'};
    }
    public class GetCityStateResponse_element {
        public zipInfoLookup.ZipInfoOutput GetCityStateResult;
        private String[] GetCityStateResult_type_info = new String[]{'GetCityStateResult','http://www.strikeiron.com','ZipInfoOutput','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'GetCityStateResult'};
    }
    public class GetAllStatusesResponse_element {
        public zipInfoLookup.StatusCodeOutput GetAllStatusesResult;
        private String[] GetAllStatusesResult_type_info = new String[]{'GetAllStatusesResult','http://www.strikeiron.com','StatusCodeOutput','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'GetAllStatusesResult'};
    }
    public class ServiceInfoOutput {
        public zipInfoLookup.SIServiceInfoResult ServiceResult;
        private String[] ServiceResult_type_info = new String[]{'ServiceResult','http://www.strikeiron.com','SIServiceInfoResult','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ServiceResult'};
    }
}
// Here is the wrapper
global class StrikeIronWrapper {
 webservice static zipInfoLookup.ZipInfoOutput wrapper(string varZipCode){
  //zipInfoLookup zipInfoLookupCls = new zipInfoLookup();
  zipInfoLookup.zipinfoSoap zip = new zipInfoLookup.zipinfoSoap();
  zip.LicenseInfo = new wsStrikeironCom.LicenseInfo();
  zip.LicenseInfo.RegisteredUser = new wsStrikeironCom.RegisteredUser();
  zip.LicenseInfo.RegisteredUser.UserID = 'test@test.com';
  zip.LicenseInfo.RegisteredUser.Password = 'test';
  //zipInfoLookup.ZipInfoOutput zipinfo = zip.GetCityState('06010');
  zipInfoLookup.ZipInfoOutput zipinfo =  zip.GetCityState(varZipCode);
  return zipinfo;
 }

 

Hi,

I am having problem when accessing strikeiron webservice. Please help me.

I am accessing strikeiron webservice and trying to show the output in a scontrol but I am getting an error saying

System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element http://www.strikeiron.com=ServiceStatus

Code:
// Here is the scontrol code //

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <script type="text/javascript" src="/js/functions.js"></script>
    <script src="/soap/ajax/12.0/connection.js"></script>
    <script src="/soap/ajax/12.0/apex.js"></script>
</head>

<body>
<div class="pagelabel"> Call webservice</div>
  <script language="javascript" type="text/javascript"> 
  function callStrikeIron()
  {
   //alert("Call Strike");
   var elem = document.getElementById("docBody");
   sforce.apex.debug=true;
   var theBody = '<table><tr><td>ZipInfo</td><td>';
   var result = sforce.apex.execute("StrikeIronWrapper", "wrapper", {varZipCode:"19406"});
   theBody += result + '</td></tr></table>';
   elem.innerHTML = theBody;
  }
  
  callStrikeIron();
  </script>
<div id="docBody"></div>
</body>
</html>

// Here is the actual class

//Generated by wsdl2apex

global class zipInfoLookup{
    public class ZipInfoListing {
        public String CityName;
        public String PreferredName;
        public String StateAbbreviation;
        public String Classification;
        public String County;
        private String[] CityName_type_info = new String[]{'CityName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] PreferredName_type_info = new String[]{'PreferredName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] StateAbbreviation_type_info = new String[]{'StateAbbreviation','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Classification_type_info = new String[]{'Classification','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] County_type_info = new String[]{'County','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'CityName','PreferredName','StateAbbreviation','Classification','County'};
    }
    public class ServiceOutput {
        public zipInfoLookup.SIWsStatus ServiceStatus;
        private String[] ServiceStatus_type_info = new String[]{'ServiceStatus','http://www.strikeiron.com','SIWsStatus','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ServiceStatus'};
    }
    public class ZipInfoResult {
        public String Code;
        public String Latitude;
        public String Longitude;
        public String TimeZone;
        public String StandardGMTOffset;
        public String DaylightGMTOffset;
        public zipInfoLookup.ArrayOfZipInfoListing Listings;
        private String[] Code_type_info = new String[]{'Code','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Latitude_type_info = new String[]{'Latitude','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Longitude_type_info = new String[]{'Longitude','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] TimeZone_type_info = new String[]{'TimeZone','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] StandardGMTOffset_type_info = new String[]{'StandardGMTOffset','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] DaylightGMTOffset_type_info = new String[]{'DaylightGMTOffset','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] Listings_type_info = new String[]{'Listings','http://www.strikeiron.com','ArrayOfZipInfoListing','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'Code','Latitude','Longitude','TimeZone','StandardGMTOffset','DaylightGMTOffset','Listings'};
    }
    public class ServiceInfoRecord {
        public String InfoKey;
        public String InfoValue;
        private String[] InfoKey_type_info = new String[]{'InfoKey','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] InfoValue_type_info = new String[]{'InfoValue','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'InfoKey','InfoValue'};
    }
    public class zipinfoSoap {
        public String endpoint_x = 'http://ws.strikeiron.com/StrikeIron/ZipInfo3/zipinfo';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public wsStrikeironCom.SubscriptionInfo SubscriptionInfo;
        public wsStrikeironCom.LicenseInfo LicenseInfo;
        private String SubscriptionInfo_hns = 'SubscriptionInfo=http://ws.strikeiron.com';
        private String LicenseInfo_hns = 'LicenseInfo=http://ws.strikeiron.com';
        private String[] ns_map_type_info = new String[]{'http://ws.strikeiron.com', 'wsStrikeironCom', 'http://www.strikeiron.com', 'zipInfoLookup'};
        public void GetRemainingHits() {
            wsStrikeironCom.GetRemainingHits_element request_x = new wsStrikeironCom.GetRemainingHits_element();
            wsStrikeironCom.GetRemainingHitsResponse_element response_x;
            Map<String, wsStrikeironCom.GetRemainingHitsResponse_element> response_map_x = new Map<String, wsStrikeironCom.GetRemainingHitsResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://ws.strikeiron.com/StrikeIron/ZipInfo3/zipinfo/GetRemainingHits',
              'http://ws.strikeiron.com',
              'GetRemainingHits',
              'http://ws.strikeiron.com',
              'GetRemainingHitsResponse',
              'wsStrikeironCom.GetRemainingHitsResponse_element'}
            );
            response_x = response_map_x.get('response_x');
        }
        public zipInfoLookup.StatusCodeOutput GetAllStatuses() {
            zipInfoLookup.GetAllStatuses_element request_x = new zipInfoLookup.GetAllStatuses_element();
            zipInfoLookup.GetAllStatusesResponse_element response_x;
            Map<String, zipInfoLookup.GetAllStatusesResponse_element> response_map_x = new Map<String, zipInfoLookup.GetAllStatusesResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://www.strikeiron.com/GetAllStatuses',
              'http://www.strikeiron.com',
              'GetAllStatuses',
              'http://www.strikeiron.com',
              'GetAllStatusesResponse',
              'zipInfoLookup.GetAllStatusesResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.GetAllStatusesResult;
        }
        public zipInfoLookup.ServiceInfoOutput GetServiceInfo() {
            zipInfoLookup.GetServiceInfo_element request_x = new zipInfoLookup.GetServiceInfo_element();
            zipInfoLookup.GetServiceInfoResponse_element response_x;
            Map<String, zipInfoLookup.GetServiceInfoResponse_element> response_map_x = new Map<String, zipInfoLookup.GetServiceInfoResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://www.strikeiron.com/GetServiceInfo',
              'http://www.strikeiron.com',
              'GetServiceInfo',
              'http://www.strikeiron.com',
              'GetServiceInfoResponse',
              'zipInfoLookup.GetServiceInfoResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.GetServiceInfoResult;
        }
        public zipInfoLookup.ZipInfoOutput GetCityState(String ZipCode) {
         // zipInfoLookup.ZipInfoOutput
            zipInfoLookup.GetCityState_element request_x = new zipInfoLookup.GetCityState_element();
            zipInfoLookup.GetCityStateResponse_element response_x;
            request_x.ZipCode = ZipCode;
            Map<String, zipInfoLookup.GetCityStateResponse_element> response_map_x = new Map<String, zipInfoLookup.GetCityStateResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://www.strikeiron.com/GetCityState',
              'http://www.strikeiron.com',
              'GetCityState',
              'http://www.strikeiron.com',
              'GetCityStateResponse',
              'zipInfoLookup.GetCityStateResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            system.debug('response ' + response_x);
            return response_x.GetCityStateResult;
        }
    }
    public class GetServiceInfo_element {
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{};
    }
    public class SIWsStatus {
        public Integer StatusNbr;
        public String StatusDescription;
        private String[] StatusNbr_type_info = new String[]{'StatusNbr','http://www.w3.org/2001/XMLSchema','int','1','1','false'};
        private String[] StatusDescription_type_info = new String[]{'StatusDescription','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'StatusNbr','StatusDescription'};
    }
    public class ArrayOfZipInfoListing {
        public zipInfoLookup.ZipInfoListing[] ZipInfoListing;
        private String[] ZipInfoListing_type_info = new String[]{'ZipInfoListing','http://www.strikeiron.com','ZipInfoListing','0','-1','true'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ZipInfoListing'};
    }
    public class StatusCodeOutput {
        public zipInfoLookup.StatusCodeResult ServiceResult;
        private String[] ServiceResult_type_info = new String[]{'ServiceResult','http://www.strikeiron.com','StatusCodeResult','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ServiceResult'};
    }
    public class ArrayOfSIWsStatus {
        public zipInfoLookup.SIWsStatus[] SIWsStatus;
        private String[] SIWsStatus_type_info = new String[]{'SIWsStatus','http://www.strikeiron.com','SIWsStatus','0','-1','true'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'SIWsStatus'};
    }
    global class ZipInfoOutput {
        public zipInfoLookup.ZipInfoResult ServiceResult;
        private String[] ServiceResult_type_info = new String[]{'ServiceResult','http://www.strikeiron.com','ZipInfoResult','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ServiceResult'};
    }
    public class SIWsResult {
        public Integer Count;
        private String[] Count_type_info = new String[]{'Count','http://www.w3.org/2001/XMLSchema','int','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'Count'};
    }
    public class GetCityState_element {
        public String ZipCode;
        private String[] ZipCode_type_info = new String[]{'ZipCode','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ZipCode'};
    }
    public class StatusCodeResult {
        public zipInfoLookup.ArrayOfSIWsStatus Statuses;
        private String[] Statuses_type_info = new String[]{'Statuses','http://www.strikeiron.com','ArrayOfSIWsStatus','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'Statuses'};
    }
    public class SIServiceInfoResult {
        public zipInfoLookup.ArrayOfServiceInfoRecord ServiceInfo;
        private String[] ServiceInfo_type_info = new String[]{'ServiceInfo','http://www.strikeiron.com','ArrayOfServiceInfoRecord','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ServiceInfo'};
    }
    public class ArrayOfServiceInfoRecord {
        public zipInfoLookup.ServiceInfoRecord[] ServiceInfoRecord;
        private String[] ServiceInfoRecord_type_info = new String[]{'ServiceInfoRecord','http://www.strikeiron.com','ServiceInfoRecord','0','-1','true'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ServiceInfoRecord'};
    }
    public class GetAllStatuses_element {
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{};
    }
    public class GetServiceInfoResponse_element {
        public zipInfoLookup.ServiceInfoOutput GetServiceInfoResult;
        private String[] GetServiceInfoResult_type_info = new String[]{'GetServiceInfoResult','http://www.strikeiron.com','ServiceInfoOutput','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'GetServiceInfoResult'};
    }
    public class GetCityStateResponse_element {
        public zipInfoLookup.ZipInfoOutput GetCityStateResult;
        private String[] GetCityStateResult_type_info = new String[]{'GetCityStateResult','http://www.strikeiron.com','ZipInfoOutput','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'GetCityStateResult'};
    }
    public class GetAllStatusesResponse_element {
        public zipInfoLookup.StatusCodeOutput GetAllStatusesResult;
        private String[] GetAllStatusesResult_type_info = new String[]{'GetAllStatusesResult','http://www.strikeiron.com','StatusCodeOutput','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'GetAllStatusesResult'};
    }
    public class ServiceInfoOutput {
        public zipInfoLookup.SIServiceInfoResult ServiceResult;
        private String[] ServiceResult_type_info = new String[]{'ServiceResult','http://www.strikeiron.com','SIServiceInfoResult','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.strikeiron.com','true'};
        private String[] field_order_type_info = new String[]{'ServiceResult'};
    }
}
// Here is the wrapper
global class StrikeIronWrapper {
 webservice static zipInfoLookup.ZipInfoOutput wrapper(string varZipCode){
  //zipInfoLookup zipInfoLookupCls = new zipInfoLookup();
  zipInfoLookup.zipinfoSoap zip = new zipInfoLookup.zipinfoSoap();
  zip.LicenseInfo = new wsStrikeironCom.LicenseInfo();
  zip.LicenseInfo.RegisteredUser = new wsStrikeironCom.RegisteredUser();
  zip.LicenseInfo.RegisteredUser.UserID = 'test@test.com';
  zip.LicenseInfo.RegisteredUser.Password = 'test';
  //zipInfoLookup.ZipInfoOutput zipinfo = zip.GetCityState('06010');
  zipInfoLookup.ZipInfoOutput zipinfo =  zip.GetCityState(varZipCode);
  return zipinfo;
 }
}


Hello all !!

I have to do a find and replace a string on a variable (string). I know there is a matcher object but I couldnt find much documentation on the usage. Any one else used this object ? or is there any other simple function to get this done. Pls help

Thanks
Raghu


Message Edited by Raghu_dev on 05-14-2008 05:45 PM
Hello there !!. I have a problem which I believe is so simple to resolve but I couldnt get through it.

I am doing a scontrol to display a related object data(in this case it is account object) on the child object page layout. I have all the coding working wrt to syntax and displaying the field value( if I display the ID. Like, account.Id.) If you take a look at the code i attached, it is easily understandable. But WHEN I TRY TO DISPLAY/ACCESS ANY OTHER COLUMN VALUE it is showing as undefined on scontrol. Any help from the masters out there ? And btw, as I mention on all my prev posts, i am still new to SFDC and any help is much appreciated.

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <script type="text/javascript" src="/js/functions.js"></script>
    <script src="/soap/ajax/12.0/connection.js"></script>
    <script src="/soap/ajax/8.0/connection.js" type="text/javascript"></script>
    <script type="text/javascript">
     function setupPage() {
   var sourceId = '{!Risk__c.Id}';
   var state =
   {
          //state that you need when the callback is called
          output : document.getElementById("output"),
          startTime : new Date().getTime()
      };
     var callback =
     {
       //call layoutResult if the request is successful
        onSuccess: layoutResults,
       //call queryFailed if the api request fails
        onFailure: queryFailed,
        source: state
   };
   var queryString = "SELECT account__r.Id, account__r.sale_details__c FROM Risk__c WHERE Id = '" + sourceId + "'";
   sforce.connection.query (queryString, callback);
     
     }
     function layoutResults(queryResult, source)
  {
    var output = ""; 
    alert("Query result size " + queryResult.size);
   if (queryResult.size > 0)
   {
     //var describeResult = sforce.connection.describeSObject("Risk__c");
     var rit = new sforce.QueryResultIterator(queryResult);
       var rk = rit.next();
       var acntId = rk.Account__r.Id;
       var acntQueryString = "SELECT Id, Lease_details__c FROM Account WHERE Id = '" + acntId + "'";
    var acntQueryResult = sforce.connection.query(acntQueryString);
    /*var ait = new sforce.QueryResultIterator(acntQueryResult);
    var account = ait.next();
    alert ("account result set size " + account.get('Id'));
           //var records = queryResult.getArray('records');
    output += "<table><tr><td><font size=2 color=blue>" + account.Name + "</font></td><tr></table>";
             source.output.innerHTML = output; */
        var records = acntQueryResult.getArray('records');
     for (var i = 0; i < records.length; i++)
     {
     var account = records[i];
     output += "<table><tr><td><font size=2 color=blue>" + account.lease_Details__c  + "</font></td><tr></table>";
     }
     source.output.innerHTML = output; 
   } 
  }
  function queryFailed(error, source)
  {
   alert("QueryFailed..." + error);
   source.output.innerHTML = "An error has occurred - query: " + error;
  }
     </script>
</head>

<body onload="setupPage()">
<div id="output"> </div>
</body>
</html>

 



Message Edited by Raghu_dev on 05-14-2008 11:57 AM

Message Edited by Raghu_dev on 05-14-2008 11:58 AM
Hi, I need to disable/enable a scontrol (in this case it is a button) based on some logic(if condition). Please let me know how this can be achieved.

Here is the scenario :
We have a "account change queue" object. This object does store all the change requests submitted by reps and the change request transforms through several stages (nothing but status). During some stages, reps are not allowed to do a "request change" (which is a scontrol button) and hence the page should render with a disabled button based on the status field.

The code looks similar to the following..


<script type="text/javascript">
function setupPage() {
sourceId = '{!Queue_Billing_Profile_Change__c.Id}';
var status = '{!Queue_Billing_Profile_Change__c.Billing_Profile_Change_Status__c}';
if (status == "Under Review")
{
// button should be disabled for the above status.
}


</script>




Thanks
Hi,

Does anyone had this requirement. If yes, please help me. And btw, I am kind of new to SFDC.

I need to show a custom field on the account page layout which should default the value to following.

"Sale Number # "
& "Amount $ "
& "One-Times $ "
& "Terms of Sale "
& "Cashier's check?___ "
& "Credit Card?___ "

That sounds simple right ? But I need them in multiline.. like below

Sale Number #
Amount $
One-Times $
Terms of Sale
Cashier's check?___
Credit Card?___

I tried "\n" but didnt help.

Thanks

Hi,

 

   I am getting "Error: Failed to parse wsdl: attribute name can not be null at 484:53"  when i am trying to parse wsdl using Wsdl2Apex.The line where it seems to complain is in bold in the snippit below.

 

<s:complexType name="AssessmentResult">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="1" name="ClientId" type="s1:EntityId"/>
          <s:element minOccurs="0" maxOccurs="1" name="ProviderId" type="s1:EntityId"/>
          <s:element minOccurs="0" maxOccurs="1" name="ClientOrderId" type="s1:EntityId"/>
          <s:element minOccurs="0" maxOccurs="1" name="ReceiptId" type="s1:EntityId"/>
          <s:element minOccurs="0" maxOccurs="unbounded" name="Results" type="s1:Results"/>
          <s:element minOccurs="0" maxOccurs="1" name="AssessmentStatus" type="s1:AssessmentStatus"/>
          <s:element minOccurs="0" maxOccurs="1" name="UserArea" type="s1:UserArea"/>
        </s:sequence>
        <s:attribute ref="xml:lang" use="optional"/>
        <s:attribute name="validFrom" type="s:string"/>
        <s:attribute name="validTo" type="s:string"/>
      </s:complexType>

 

 

Any Idea?

 

Thanks

I have made an object called "State". There are three custom fields :

                                                                     1. State

                                                                     2. City

                                                                     3. Village

                                                                      in this object.

I have made  picklists for state, city and village . I want that whenever i select a state, city associated with this state got select. And also when i want that  whenever i select a city, Village associated with this city got select.If you have any solution please tell me.Thanks .

I have written code for that which is as follow:-

                                             For page

<apex:page controller="sampleCon">
<apex:form >
<apex:actionFunction name="Citysearch" action="{!getCities}" reRender="result" status="status1"/>
<apex:actionFunction name="Villagesearch" action="{!getVillages}" reRender="result" status="status2"/>

<apex:selectList value="{!State}" size="1" onclick="searchCity()" >
<apex:selectOptions value="{!items}" />
<apex:actionStatus startText="Searching..." stopText="Search Result" id="status1" >
</apex:actionstatus>
</apex:selectList>

<apex:selectList value="{!City}" size="1" onclick="searchVillage()">
<apex:selectOptions value="{!Cities}"/>
<apex:actionStatus starttext="searching..." stoptext="Search Complete" id="status2" >
</apex:actionStatus>
</apex:selectList>

<apex:selectList value="{!Village}" size="1">
<apex:selectOptions value="{!Villages}"/>
</apex:selectList>

</apex:form>
<script>
function searchCity(){
// alert('hiiiiiiiiiii');
getCities();
}
function searchVillage()
{
// alert('hello');
getVillages();
}
</script>
</apex:page>
For controller
public class sampleCon {
        String id;
        public StateCity__c State{get;set;}
        public StateCity__c City{get;set;}
        public StateCity__c Village{get;set;}
        
        public List<SelectOption> getItems() {
                    List<SelectOption> options = new List<SelectOption>();
                    options.add(new SelectOption('id','Rajasthan'));
                    options.add(new SelectOption('id','MP'));
                    return options;
                    }
        
        public List<SelectOption> getCities() {
                    id = ApexPages.currentPage().getParameters().get('id');
                    List<SelectOption> options = new List<SelectOption>();
                    options.add(new SelectOption('id','Ajmer'));
                    options.add(new SelectOption('id','Bhopal'));
                    return options;
                    }
        
        public List<SelectOption> getVillages() {
                    id = ApexPages.currentPage().getParameters().get('id');
                    List<SelectOption> options = new List<SelectOption>();
                    options.add(new SelectOption('id','Kishangarh'));
                    options.add(new SelectOption('id','Nimach'));
                    return options;
                    }               
}

This code works in chrome, not in IE. How would I make it work in IE?

 

 

<apex:pageBlockSectionItem >

<apex:outputLabel value="Value 1" for="cbxlevel1"/>

<apex:outputPanel styleClass="requiredInput" layout="block">

<apex:selectList value="{!selectedId}" id="cbxlevel2" size="1">

<apex:selectOptions value="{!availableValues}"/>

<apex:actionSupport event="onclick" action="{!getStuff}" rerender="cbxlevel2"/>

</apex:selectList>

</apex:outputPanel>

</apex:pageBlockSectionItem>

 

 getStuff does not get fired when I pick something from the selectList. It works on chrome though

 

 Any help would be appreciated. 

 

  • March 04, 2010
  • Like
  • 0

Hello Community, 

 

I have a requirement where I have to add checkboxes to a related list and when user changes value on master record, I have to change all the checked records from related list (change in value in one of the fields from related list). 

 

Is there a way I could do the above or am I just dreaming ? And btw, I am a newbie in Visualforce (I am sure you could figure out from the request). I really appreciate if you could throw some ideas  on how I can handle this requirement(attached image). All I did so far is the following lines of code 

 

 

<apex:page standardController="Projects__c" >

<apex:detail subject="{!Projects__c.Id}" relatedList="false" title="false"/>

<apex:relatedList list="Leads__r"/>

</apex:page>

 Any help in directing me to the solution for the above requirement is greatly appreciated.

 

Thank you

Raghu 

 ProjectStatusChange

 

 

Message Edited by Raghu_dev on 12-06-2009 08:00 PM

Hi,

 

I have downloaded and installed the Eclipse 3.4.0 IDE, Force.com Plugin to do custom development. However I'm unable to connect to the Developer / Sanbox server whenever I try to create a new project. I'm getting the following error. I have configured the proxy settings correctly and gave the necessary proxy authentication information.

 

java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.0 407 Proxy Authentication Required"

at sun.net.www.protocol.http.HttpURLConnection.doTunneling(Unknown Source)

at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)

at sun.net.www.protocol.http.HttpURLConnection.doTunneling(Unknown Source)

at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)

at sun.net.www.protocol.http.HttpURLConnection.doTunneling(Unknown Source)

at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)

at sun.net.www.protocol.http.HttpURLConnection.doTunneling(Unknown Source)

at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)

at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)

at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)

at com.sforce.ws.transport.JdkHttpTransport.connect(JdkHttpTransport.java:115)

at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:89)

at com.sforce.soap.partner.wsc.PartnerConnection.login(PartnerConnection.java:1113)

at com.salesforce.ide.core.remote.Connection.login(Connection.java:232)

at com.salesforce.ide.core.remote.Connection$$FastClassByCGLIB$$8e61a81d.invoke(<generated>)

at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)

at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)

at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77)

at com.salesforce.ide.core.internal.aspects.LoginRetryAspect.loginRetry(LoginRetryAspect.java:24)

at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)

at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)

at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:64)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)

at com.salesforce.ide.core.remote.Connection$$EnhancerByCGLIB$$308b0a97.login(<generated>)

at com.salesforce.ide.core.factories.ConnectionFactory.getNewConnection(ConnectionFactory.java:73)

at com.salesforce.ide.core.factories.ConnectionFactory.storeConnection(ConnectionFactory.java:159)

at com.salesforce.ide.core.factories.ConnectionFactory.getConnection(ConnectionFactory.java:126)

at com.salesforce.ide.core.project.ProjectController.getRemotePackageNames(ProjectController.java:779)

at com.salesforce.ide.core.project.ProjectController.loadRemotePackageNames(ProjectController.java:806)

at com.salesforce.ide.ui.wizards.project.ProjectOrganizationPage$1.run(ProjectOrganizationPage.java:335)

at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:446)

at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:354)

at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)

at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:275)

at org.eclipse.ui.internal.progress.ProgressManager.run(ProgressManager.java:1191)

at com.salesforce.ide.ui.wizards.project.ProjectOrganizationPage.loadOrgDetails(ProjectOrganizationPage.java:324)

at com.salesforce.ide.ui.wizards.project.ProjectOrganizationPage.prepareNextPage(ProjectOrganizationPage.java:229)

at com.salesforce.ide.ui.wizards.project.ProjectOrganizationPage.getNextPage(ProjectOrganizationPage.java:218)

at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:813)

at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:369)

at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)

at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)

at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)

at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)

at org.eclipse.jface.window.Window.open(Window.java:801)

at org.eclipse.ui.internal.actions.NewWizardShortcutAction.run(NewWizardShortcutAction.java:135)

at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)

at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)

at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)

at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)

at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)

at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)

at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)

at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)

at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)

at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)

at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)

at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)

at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)

at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)

at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)

at org.eclipse.equinox.launcher.Main.run(Main.java:1236)

 

 

Hi,

 

Before I moved to Salesforce I used to create Data Models, sometimes by reverse engineering.

 

These Data Models were very useful.

 

Is there a Data Modelling Tool for Salesforce or is there a way I can create Data Models for SF Objects or Custom Objects ?

 

Thanks a lot.

 

Barry

 

Once again, I bumped into several issues importing wsdl into Salesforce. Here is the background - I am using a wsdl from a hosted service (Bridger/Choicepoint - https://bixgtest.choicepoint.com/webservices/3.0/xgdirect1.asmx?WSDL) and trying to import into sfdc for further processing. But the issue started when I started importing the wsdl and sfdc is throwing the following error - Multiple port types are not supported. I scanned through the wsdl and removed multiple ports (locally) and tried to import which seems like it imported successfully but the last step (generate apex code) gave an error saying - soap 1.1 address is not found. Not sure where to find the correct solution and if anyone knows better please help me.

 

Please feel free to access the above wsdl.

 

Thank you

Raghu 

Message Edited by Raghu_dev on 03-09-2009 11:44 AM

Hi,

   Is it possible to schedule my application built on Force.com so that my application runs in some time interval.

Can anyone gimme some link to this particular problem?? cheers


I don't know what is wrong with this wsdl? when I click Parse WSDL, it gives that error message, can anyone help me fix the file?
Thanks
the original code is posted below
 
 
Code:
<—xml version="1.0" encoding="utf-8"–>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
      <s:element name="SForceLogin">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="UID" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="Pwd" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="SForceLoginResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="SForceLoginResult" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="Query">
        <s:complexType />
      </s:element>
      <s:element name="QueryResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="QueryResult" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
  </wsdl:types>
  <wsdl:message name="SForceLoginSoapIn">
    <wsdl:part name="parameters" element="tns:SForceLogin" />
  </wsdl:message>
  <wsdl:message name="SForceLoginSoapOut">
    <wsdl:part name="parameters" element="tns:SForceLoginResponse" />
  </wsdl:message>
  <wsdl:message name="QuerySoapIn">
    <wsdl:part name="parameters" element="tns:Query" />
  </wsdl:message>
  <wsdl:message name="QuerySoapOut">
    <wsdl:part name="parameters" element="tns:QueryResponse" />
  </wsdl:message>
  <wsdl:portType name="ServiceSoap">
    <wsdl:operation name="SForceLogin">
      <wsdl:input message="tns:SForceLoginSoapIn" />
      <wsdl:output message="tns:SForceLoginSoapOut" />
    </wsdl:operation>
    <wsdl:operation name="Query">
      <wsdl:input message="tns:QuerySoapIn" />
      <wsdl:output message="tns:QuerySoapOut" />
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="ServiceSoap" type="tns:ServiceSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="SForceLogin">
      <soap:operation soapAction="http://tempuri.org/SForceLogin" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="Query">
      <soap:operation soapAction="http://tempuri.org/Query" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:binding name="ServiceSoap12" type="tns:ServiceSoap">
    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="SForceLogin">
      <soap12:operation soapAction="http://tempuri.org/SForceLogin" style="document" />
      <wsdl:input>
        <soap12:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="Query">
      <soap12:operation soapAction="http://tempuri.org/Query" style="document" />
      <wsdl:input>
        <soap12:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="Service">
    <wsdl:port name="ServiceSoap" binding="tns:ServiceSoap">
      <soap:address location="http://localhost:1908/Salesforce_Origination/Service.asmx" />
    </wsdl:port>
    <wsdl:port name="ServiceSoap12" binding="tns:ServiceSoap12">
      <soap12:address location="http://localhost:1908/Salesforce_Origination/Service.asmx" />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

 
Hi,

We have a very dynamic assignment rules on leads which change very frequently and we want to be more affective and time saving making these changes. Hence we would want to get the business admin change the assignment rules on a excel spreadsheet and use the excel connector to automatically update the SFDC. Please let me know if this is possible at all using the excel connector or please suggest the best practice to achieve this functionality (not using sfdc UI)

Appreciate your help.

thanks
Raghu
Hi,

Could some one help me on how to print all the field names and associated labels for a specified salesforce object(eg., Account). I need this for documentation purposes. Appreciate your help.

Message Edited by Raghu_dev on 10-07-2008 08:25 AM
Hi,

I have my sandbox project created in Eclipse but when I try to refresh it from the server it gives me the error:

Unable to tunnel through my proxy. Proxy returns "http/1.1 407 Proxy Authentication Required"

I have already done the proxy setup in preferences > Network connections. My proxy doesn't need any Authentication.
Still error is there. Please help me regarding this, not able to go ahead.......

thanks!
  • September 15, 2008
  • Like
  • 0
Hi, Can some one help me how to loop through the map object?

For eg., I have the following map variable declared and populated the values.. I want to query the map variable at the later stages in the code and loop through the results. Please advice


Code:
 Map<String, Lead> leadMap = new Map<String, Lead>();
 for (Lead lead : Trigger.new) {
  leadMap.put(lead.DUNS_NEW__c, lead);
 }

 Let me explain the requirement a little more..

I want to use the map as a resultset (or a recordset). Because of the governing rules in salesforce, I am trying to replace my repetitive soql statements align to maps and sets. Actual requirement is as follows.

There will be a huge load of leads from several vendors into our sfdc org. These leads will have DUNS numbers. The trigger on lead will have to look for the duns number on account (which was already populated from a different process) object and attach the lead to that account.

my earlier code was working perfect but because of the soql governing limits on trigger , I have to change that code to work.
Here is the actual code :
Code:
trigger dunsOnLeads on Lead (before insert, before update) {

 for (Lead ld : Trigger.new) {
        
        String str = ld.DUNS_NEW__c;
        String mstrSfdcId = '';
        Id sfdcId;
        // for customer identification
        String custmstrSfdcId = '';
        Id custsfdcId;
        // for prospect identification
        String prosmstrSfdcId = '';
        Id prossfdcId;
        
        System.debug('Duns on Lead ' + str);
        Integer custi=0;
        Integer prosi=0;
        
        Integer i=0;
        if (str != null) //find for null (or space)
        {
         // look for active customers 
         for (Account tmpAccnt : [select Id, Master_SFDC_ID__c, MODS_Account_Type__c, customer_number__c  from Account where IsDeleted = false and Duns__c = :ld.duns_new__c]) 
         {
             if ((tmpAccnt.MODS_Account_Type__c == 'Customer') && (tmpAccnt.customer_number__c != ''))
             {
              custmstrSfdcId = tmpAccnt.Master_SFDC_ID__c;
              custsfdcId = tmpAccnt.Id;
              custi++;
             }
             else
             {
              prosmstrSfdcId = tmpAccnt.Master_SFDC_ID__c;
              prossfdcId = tmpAccnt.Id;
              prosi++;
             } 
         }
         if (custi > 0) // there are no customers found with the same duns number
         {
          mstrSfdcId = custmstrSfdcId;
          sfdcId = custsfdcId;
          i = custi;
         }
         else if (prosi > 0)
         {
          mstrSfdcId = prosmstrSfdcId;
          sfdcId = prossfdcId;
          i = prosi;
         }
         // if no customers found with the same match, look for prospects
         /*if (i==0) 
         {
          for (Account tmpAccnt : [select Id, Master_SFDC_ID__c from Account where 
           IsDeleted = false and MODS_Account_Type__c = 'Prospect'
           and Duns__c = :ld.duns_new__c]) {
              mstrSfdcId = tmpAccnt.Master_SFDC_ID__c;
              sfdcId = tmpAccnt.Id;
              i++;
          }
         }*/
         // if the account is identified as slave, master sfdc id is the unique id of the master. 
         // in that case, lead will be attached to that master account.
         //System.debug('Master SFDC: ' + mstrSfdcId);
         //System.debug('Integer i: ' + i);
         //System.debug('SFDC Id: ' + sfdcId);
         if (i > 1 && mstrSfdcId == null)
         {
           ld.account__c = sfdcId;
           // Attach this lead to the last account from search and also, show this lead on the view
           ld.Dup_DUNS__c = True;
         }
         else if (i > 1 && mstrSfdcId != null)
         {
          ld.account__c = mstrSfdcId; 
         }
         else if (i == 1 && mstrSfdcId != null)
         {
          ld.account__c = mstrSfdcId;  
         }
         else if (i == 1 && mstrSfdcId == null && sfdcId != null)
         {
          ld.account__c = sfdcId;  
         }
         else if (i==0)
         {
          ld.account__c = null;
          ld.Dup_DUNS__c = False;
         }
        }
        else
        {
          ld.account__c = null;
          ld.Dup_DUNS__c = False;
        }
 
    }
}

 

Here is the idea how to replace that code align to maps and sets .. pls advice if the approach is wrong

1. Get all the lead duns # and the Ids associated to those leads into a map
Code:
 Map<String, Lead> leadMap = new Map<String, Lead>();
 for (Lead lead : Trigger.new) {
  leadMap.put(lead.DUNS_NEW__c, lead.Id);
 }

 

2. Query the account with the keys (duns) from the above map
Code:
for (Account newAccnt = new [select Id, Master_SFDC_ID__c, MODS_Account_Type__c, customer_number__c  from Account where IsDeleted = false and Duns__c IN : leadMap.keyset()])

3. The above query can result in bulk records as there are duplicate duns numbers in accounts.
4. Now, I have to loop  through the leadmap to identify the account associated to that lead (as the duns on lead and duns on account matches)
 ---- How to query or search the map object ?
 ---- How to loop through the map object  ?
5. Then populate the lead account id with the account id of the matching account record.

Please help





Thanks
Raghu

Message Edited by Raghu_dev on 09-08-2008 09:05 AM

Message Edited by Raghu_dev on 09-08-2008 09:46 AM
I'm passed an object id and want to clone it. I'm guessing I need to write a soql query to get an instance of the object then clone it but I don't want to hard code all the field names as they may change. Is there a way to do a select * or a way of getting the object that doesn't involve hard coding?
I login to salesforce.com developer, click Setup, Build, Code and then click Generate from WSDL.  I browse to our wsdl and then get an error.
 
The error I get is "Error: Failed to parse wsdl: Unknown element: import."  Does Apex support .Net 3.0 WCF services?
 
Ryan
  • January 18, 2008
  • Like
  • 0