• soa
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 44
    Questions
  • 24
    Replies

Hi,

 

I have a problem in creating a validation rule.

 

I have a object called 'Defect'. Defect object has a field called Defect Status.

I want to apply a validation rule stating that whenever I enter a new defect(ie i press the save button) this Defect Status field should be auto generated and the value should be 'New'.

 

After this whenver I edit this Defect page. I shall get a drop down having the values - 'Closed, Fixed, Assigned'.

the drop down has a default value as New and has a drop with the above three values.

 

Please tell me how shall I accomplish this.

 

Regards

Diti

  • June 12, 2009
  • Like
  • 0

Hi,

I am trying to make an application in Force called Defect Tracking system.

In this application I have 3 user roles namely QA, Developer and Project Manager.

 

If any defect occurs in a project , the QA logs in the defect. The project manager can assign the defect to any of the developers to solve it. The developers solve the defect and send it to the QA to review it.

 

Now in my application in Force, I have 4 main tabs.. namely, Team(which has a Designation field and is a drop down),

Projects , Defects and Reports.

 

I want to apply a Validation rule which will generate a new field called Defect Number as soon as a new defect is added. 

 

as soon as i click the save button in the defect detail page , a new field should be added in the page  called defect number..

Please tell me how shall I accomplish this.

 

 

Regards,

Diti

  • June 10, 2009
  • Like
  • 0

Hi,

 

I am creating an Application called Defect Tracking System. I need to add validation rules in it.

 

My first rule is :

1. I need to get the Defect number as soon as a new Defect is added.that is the defect number should be system generated.

this I shall do with the help of Before Insert Trigger.

Can you please suggest how shall I do it.

 

I have a defect object which has defect ID, ProjectID(which it takes from the Project object)

As soon as the user will press the save button in the defect form a Defect Number Field should be added automatically to this form.

 

Please tell me how to accomplish this..I am stuck.

 

Regards

Diti

  • May 27, 2009
  • Like
  • 0

Hi,

 

I have a use case which has 3 tables namely Transaction Table, Customer Table and Merchant table.

 

Based on the no of transactions of a particular Customer in the transaction Table i need to insert the total no of transaction of that Customer in the Customer table.

This i could accomplish through Before Insert Trigger.How can I do this through UI.??

ie through a button.

 

Pleas reply as soon as possible.

 

Regards

Diti

 

  • April 01, 2009
  • Like
  • 0

Hi,

 

Here is the Force.com blog for Group, Sum and Order data in Apex.

 

http://blog.sforce.com/sforce/2008/10/group-sum-and-o.html

 

Can you please look at the code for SUM and tell me what is the difference between Opportunity and Opportunities.

 

Can this type of thing be used in a similar type of Custom Class.

Like I have a custom object called Customer__c then can I use Customers as they have used opportunities..

Please help..

I am realyy confused..

 

Waiting for your prompt response.

 

Regards,

Diti 

  • March 30, 2009
  • Like
  • 0

Hi,

 

I came accross a Force.com Blog where it says that Force.com does not support Group by and Sum.

You can see the blog at the following link:

 

http://blog.sforce.com/sforce/2008/10/group-sum-and-o.html Is there any way where I can perform Group By and Sum at the Database level? Please suggest a solution for it. regards,Diti
  • March 26, 2009
  • Like
  • 0

Hi,

I am trying to invoke Google-Contacts.

Implemented it in two manners:

1. Made used of Contact Service, Google Service and Google Data classes, as given in the salesforce framework.

 

Invoked method : public static final string defaultFeed = 'http://www.google.com/m8/feeds/contacts/default/full'; static final string sessionAuthToken = 'CJ3pqczuBBCk0tSrBQ'; public static testMethod void getOneContact() { ContactService service = new ContactService(); service.setAuthSubToken(sessionAuthToken); // to get a single contact you must have stored the self // link for that contact GoogleData oneCon = service.getFeed( ContactService.defaultFeed); oneCon.dump(); }

 

 

But got this errior:As far as I could make out , we are getting null pointer exception may be becausse response is null , and later xmldom object is created , passing this response as parameter. So then I read with my login account details:  GoogleData oneCon = service.getFeed( myGmailId);  service.setAuthSubToken(myGmailPasswd); 

but still I got the same error.

 

  {faultcode:'soapenv:Client', faultstring:'System.NullPointerException: Attempt to de-refference a Null Object

 

Class.GoogleService:line 141, column 58

Class.GoogleData:line 471, column15

Class.ContactService.getFeed : line5 , column 49

Class.ContactService.getContact : line 133, column23',}

 

2.

Http http = new Http(); HttpResponse response = null; HttpResponse response2=null; req.setEndpoint('https://www.google.com/accounts/Login'); req.setMethod('GET') ; req.setHeader('Authorization','Email=GmailMailId&Passwd=myGmailpasswd); HttpResponse res=http.send(req); resBody=res.getBody(); status=res.getStatus(); headerKey=res.getHeaderKeys(); code=res.getStatusCode(); responseG=res.toString();

 

 

It succedd for Login authentication, but then how to access the contact :what does this 'Authorization' denotes.  Can u plz help me into this.. regards Diti

 

  • January 29, 2009
  • Like
  • 0
Hi ,
 
I am trying to Concat strings using Apex.
While concatinating a string with Special character '&' .. it is not taking '&'..
 
For eg..
String concat = ('http://webservices.amazon.com/onca/xml?Service=AWSECommerceService' + '&');
 
How do I cancat an & to a string..
Please help..
 
Regards
Diti
  • December 26, 2008
  • Like
  • 0
Hi,
 
I am trying to install and use Amazon Toolkit.
 
The link to view it is :
 
 
 
 
After installing the application , I can see the application on Salesforce site ..
But on Force.com IDE I am unable to view it.
 
I am able to view all other applications of Salesforce on Force.com IDE other than Amazon Toolkit..
 
Please help me.
 
Regards ,
Diti


Message Edited by soa on 12-01-2008 02:43 AM
  • December 01, 2008
  • Like
  • 0
Hi..
I am trying to install and use the Amazon Toolkit .
 
the link to view it is :
 
 
I have created an account with Amazon.
In the AWS Credentials I have given the Credential name, the access key and the Secret.
 
When I click on the S3 Samples tab I am getting the following error:
 

Error:

 Web service callout failed: WebService returned a SOAP Fault: Your account is not signed up for the S3 service. You must sign up before you can use S3. faultcode=soapenv:Client.NotSignedUp faultactor=
 
 
When I click on the EC2 Console tab I am getting the following error:
 

Error:

 Error when querying the AWSKey__c custom object. Did not find any record with name of [force_demo_ag]. Please make sure the name is correct or create a record with the proper AWS credentials and retry.
 
Please guide me how to fix these errors.
 
Regards,
Diti

 
 
  • December 01, 2008
  • Like
  • 0
Hi,
 
I am trying to create a visualforce page as given in the following link..
 
 
Without the Controller code I am able to see the Calender page.
 
As I write the Controller code I am not able to see the page.Does it require Any external token?
 
Am I missing something..?Is something missing in the controller code?
 
Please help...
  • November 25, 2008
  • Like
  • 0
Hi,
I have created a visualforce page as the following link.
 
 
The page is created . You can view the page at :
 
 
I need to call this visual force page on click of a  custom button as I used to do for Apex class.
 
How do I do it..
 
Please help..
 
regards,
Diti
 
 
  • November 25, 2008
  • Like
  • 0
Hi ,
I am trying to execute the REST  example of Google data API given in the wiki. The link to view the Example is :
 
The problem is they have not given the link to access the Contacts API.
I have found one link but I am getting the error :"Authorization Required"
 
The link is :
 
Am I using the wrong link ?
 
Can you please give the correct link for this?
 
 
Regards ,
 
Diti
 
  • November 21, 2008
  • Like
  • 0
Hi ,
I am trying to execute the REST  example of Google data API given in the wiki. The link to view the Example is :
 
 
The entire Toolkit code is given..
 
I am trying to execute the Contact API of the Google Toolkit.
 
I am not able to execute the 'AuthSubUtil.cls'.
 
The error says 'twiceEncodedNext' is undefined.
 
I am able to run all other classes related to Contact API.
 
Do I need to Include this Class..
 
Where am I going wrong..
Please help...
  • November 18, 2008
  • Like
  • 0
Hi ,
I am trying to execute the REST  example of Google data API given in the wiki. The link to view the Example is :
 
 
I have to install the Eclipse plug-in that adds support for Subversion revision control system, also known as SVN.
While installing the subclipse, in the new Remote Site .... i have specifeid the path for the subclipse as given in the document..
 
I have eclipse 3.1 installed in my machine.
 
For that i have installed Subclipse 1.0 as stated in the document.
 
I am geeting the following error:
 
Current configuration contains errors that are not corrected by the requested operation and more errors would be introduced..
 
There are some configuration problems stated..
 
please help
 
regards
Diti
 
  • November 17, 2008
  • Like
  • 0
Hi ,

I am trying to invoke a REST  web service through Force.com (Visual Force) as mentioned in the example provided in :

http://wiki.apexdevnet.com/index.php/Force.com_Zillow_Mashup

The code for the page editor is as follows:

Code:
<apex:page standardController="Lead" extensions="ZillowLeadExtension">
    <apex:form >  
    <!-- Insert new Lead -->
    <apex:pageBlock title="New Lead" >        
        <apex:pageBlockButtons location="top">                                  
           <apex:commandButton action="{!save}" value="Save" id="saveLead" />       
        </apex:pageBlockButtons>
       <apex:pageBlockSection title="Lead Data" columns="1"> 
          <apex:inputField value="{!aLead.LastName}" />
          <apex:inputField value="{!aLead.FirstName}" />
          <apex:inputField value="{!aLead.Company}" />                                       
          <apex:inputField value="{!aLead.Phone}" />
          <apex:inputField value="{!aLead.Email}" />
          <apex:inputField value="{!aLead.Street}" />
          <apex:inputField value="{!aLead.City}" />
          <apex:inputField value="{!aLead.State}" />
          <apex:inputField value="{!aLead.PostalCode}" />
      </apex:pageBlockSection>
   </apex:pageBlock>
  </apex:form>
 </apex:page>


 
the code for the class ZillowLeadExtension is :

Code:
public class ZillowLeadExtension {
 public Lead aLead ;
 public ZillowLeadExtension(ApexPages.StandardController controller) {
  aLead = new Lead() ;      
 }

public PageReference save() {        
 PageReference pr ;
 try{
  ZillowService p = new ZillowService() ;
  // make the web service call out
  ZillowTypes.PropertySearchResponse r = p.searchZillow( aLead.Street, aLead.City, aLead.State) ;
  // store in custom field
  aLead.Home_Value__c = r.getZEstimateAmount() ;
  // insert new record into DB
  insert aLead ;
  // redirect to the newly inserted lead
  pr = new PageReference( '/' + aLead.id );
 }
  catch( ZillowTypes.ZillowException e){
  System.debug( '**** Caught Exception' +e ) ;
}
 return pr ;
}
}


 
I have included all the other classes on which ZillowLeadExtension depends.When I try to save the Code written in the page editor , I am getting the following error:

 

ErrorError: Unknown property 'LeadStandardController.aLead'
 
Why is it not taking the ZillowLeadExtension class?
is there any other way to include the class??
 
Please Help..
 
 
Regards,
Diti
<SCRIPT type=text/javascript>// var tabId = getCookie('dmTab'); var closeButtonId = 'thePage:theForm:closeButton'; if (tabId && getBottomPanelHeight() > 28) { showCloseButton(closeButtonId, true); } else { showCloseButton(closeButtonId, false); } document.getElementById('thePage:theForm:showControllerLink').style.display = (false) ? 'inline' : 'none'; // </SCRIPT>
  • November 13, 2008
  • Like
  • 0

Hi.

I am trying to invoke a REST  web service through Force.com as mentioned in the example provided in

http://wiki.apexdevnet.com/index.php/Force.com_Zillow_Mashup

I had used the following code for  parsing the XML document ( please see the code below )

Code:
public class PropertySearchResponse {   
xmldom.element searchResult ;
 public Double getZEstimateAmount(){
        Double.valueOf( searchResult.getElementByTagName( 'amount').nodeValue ) ;
     return d ; 
  } 
}

While compiling the code I am getting the following error

ErrorError: Compile Error: Invalid type: xmldom.element at line 2 column 1

Would you please guide me how to use XMLDOM ? I think it is not able to recognise XMLDOM. However I tried the XMLReader document and it run fine.

Alternatively is there any way to convert the Httpresponse sent by the REST Service into an XMLReader, which we can parse thereafter.

regards,

Diti

  • November 11, 2008
  • Like
  • 0
Hi.
 
I have created a web service which is adding two numbers.I generated a WSDL for the web service.
 
the code for the WSDL is :
 
Code:
<—xml version="1.0" encoding="UTF-8" standalone="yes"–>
<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.3.1-hudson-417-SNAPSHOT. -->
<definitions targetNamespace="http://PackAdd/" name="AddWSService" xmlns:tns="http://PackAdd/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns="http://schemas.xmlsoap.org/wsdl/">
  <types>
    <xs:schema version="1.0" targetNamespace="http://PackAdd/" xmlns:tns="http://PackAdd/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:element name="AddNumbers" type="tns:AddNumbers"/>

  <xs:element name="AddNumbersResponse" type="tns:AddNumbersResponse"/>

  <xs:complexType name="AddNumbers">
    <xs:sequence>
      <xs:element name="a" type="xs:int"/>
      <xs:element name="b" type="xs:int"/>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="AddNumbersResponse">
    <xs:sequence>
      <xs:element name="return" type="xs:int"/>
    </xs:sequence>
  </xs:complexType>
    </xs:schema>
  </types>
  <message name="AddNumbers">
    <part name="parameters" element="tns:AddNumbers"/>
  </message>
  <message name="AddNumbersResponse">
    <part name="parameters" element="tns:AddNumbersResponse"/>
  </message>
  <portType name="AddWS">
    <operation name="AddNumbers">
      <input message="tns:AddNumbers"/>
      <output message="tns:AddNumbersResponse"/>
    </operation>
  </portType>
  <binding name="AddWSPortBinding" type="tns:AddWS">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <operation name="AddNumbers">
      <soap:operation soapAction=""/>
      <input>
        <soap:body use="literal"/>
      </input>
      <output>
        <soap:body use="literal"/>
      </output>
    </operation>
  </binding>
  <service name="AddWSService">
    <port name="AddWSPort" binding="tns:AddWSPortBinding">
      <soap:address location="http://pc-p46799:8081/AddNumbers/AddWSService"/>
    </port>
  </service>
</definitions>


 
it created a client :
Code:
//Generated by wsdl2apex

public class packadd1 {
    public class AddWSPort {
        public String endpoint_x = 'http://pc-p46799:8081/AddNumbers/AddWSService';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        private String[] ns_map_type_info = new String[]{'http://PackAdd/', 'packadd1'};
        public Integer AddNumbers(Integer a,Integer b) {
            packadd1.AddNumbers request_x = new packadd1.AddNumbers();
            packadd1.AddNumbersResponse response_x;
            request_x.a = a;
            request_x.b = b;
            Map<String, packadd1.AddNumbersResponse> response_map_x = new Map<String, packadd1.AddNumbersResponse>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://PackAdd/',
              'AddNumbers',
              'http://PackAdd/',
              'AddNumbersResponse',
              'packadd1.AddNumbersResponse'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.return_x;
        }
    }
    public class AddNumbers {
        public Integer a;
        public Integer b;
        private String[] a_type_info = new String[]{'a','http://www.w3.org/2001/XMLSchema','int','1','1','false'};
        private String[] b_type_info = new String[]{'b','http://www.w3.org/2001/XMLSchema','int','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://PackAdd/','false'};
        private String[] field_order_type_info = new String[]{'a','b'};
    }
    public class AddNumbersResponse {
        public Integer return_x;
        private String[] return_x_type_info = new String[]{'return','http://www.w3.org/2001/XMLSchema','int','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://PackAdd/','false'};
        private String[] field_order_type_info = new String[]{'return_x'};
    }
}

 
i created a wrapper class which is calling the client :
the code is :
Code:
global class WSAddition {
WebService static Integer AddNumbers()
{
   Integer a = 44;
    Integer b = 54;
   

   packadd1.AddWSPort stub = new  packadd1.AddWSPort();
   Integer result = stub.AddNumbers(a, b);
   return(result);
}

}

 
i invoked this from a button . i am getting the folllowing error.
 
Web service Callout Failed : Unexpected Element:.Parser was expecting element
'http://schemas.xmlsoap.org/soap/envelop/:Envelop' but found' :html'
 
 
please help me...
where am i going wrong??
 
 
 
  • October 24, 2008
  • Like
  • 0
Hi,
 
If I have multiple js Files , How should I include them ?
 
In refrence to Salesforce-Apex-Language-Refrence , page no -21, they have written a S-control for the Apex Code:
 
Apex Code:
Code:
global class HelloWorld2 {
// The WebService keyword makes this a public WebService method
WebService static String sayHelloWorld(String arg) {
// This method returns a simple message
return 'Hello '+arg;
}
}

 
Code for S-control:
Code:
<html>
<head>

<script type="text/javascript" src="/js/functions.js"></script>
<script src="/soap/ajax/11.0/connection.js"></script>
<script src="/soap/ajax/11.0/apex.js"></script>
<script>
function demo() {
var result = sforce.apex.execute('HelloWorld2' , 'sayHelloWorld',
{arg:"new Apex user!"});
document.getElementById('userNameArea').innerHTML = 'Congratulations!'
+ ' ' + result;
}
</script>
</head>
<body onload=demo()>
<div id=userNameArea>
</div>
</body>
</html>

 
Where in Force.com have they included Functions.js?
 
How should I include multiple js Files?
 
Please help.
 
Regards
Diti
  • October 20, 2008
  • Like
  • 0
Hi,
 
If I have multiple js Files , How should I include them ?
 
In refrence to Salesforce-Apex-Language-Refrence , page no -21, they have written a S-control for the Apex Code:
 
Apex Code:
Code:
global class HelloWorld2 {
// The WebService keyword makes this a public WebService method
WebService static String sayHelloWorld(String arg) {
// This method returns a simple message
return 'Hello '+arg;
}
}

 
Code for S-control:
Code:
<html>
<head>

<script type="text/javascript" src="/js/functions.js"></script>
<script src="/soap/ajax/11.0/connection.js"></script>
<script src="/soap/ajax/11.0/apex.js"></script>
<script>
function demo() {
var result = sforce.apex.execute('HelloWorld2' , 'sayHelloWorld',
{arg:"new Apex user!"});
document.getElementById('userNameArea').innerHTML = 'Congratulations!'
+ ' ' + result;
}
</script>
</head>
<body onload=demo()>
<div id=userNameArea>
</div>
</body>
</html>

 
Where in Force.com have they included Functions.js?
 
How should I include multiple js Files?
 
Please help.
 
Regards
Diti
  • October 20, 2008
  • Like
  • 0

Hi,

 

I have a problem in creating a validation rule.

 

I have a object called 'Defect'. Defect object has a field called Defect Status.

I want to apply a validation rule stating that whenever I enter a new defect(ie i press the save button) this Defect Status field should be auto generated and the value should be 'New'.

 

After this whenver I edit this Defect page. I shall get a drop down having the values - 'Closed, Fixed, Assigned'.

the drop down has a default value as New and has a drop with the above three values.

 

Please tell me how shall I accomplish this.

 

Regards

Diti

  • June 12, 2009
  • Like
  • 0

Hi,

 

I have a use case which has 3 tables namely Transaction Table, Customer Table and Merchant table.

 

Based on the no of transactions of a particular Customer in the transaction Table i need to insert the total no of transaction of that Customer in the Customer table.

This i could accomplish through Before Insert Trigger.How can I do this through UI.??

ie through a button.

 

Pleas reply as soon as possible.

 

Regards

Diti

 

  • April 01, 2009
  • Like
  • 0
Hi..
I am trying to install and use the Amazon Toolkit .
 
the link to view it is :
 
 
I have created an account with Amazon.
In the AWS Credentials I have given the Credential name, the access key and the Secret.
 
When I click on the S3 Samples tab I am getting the following error:
 

Error:

 Web service callout failed: WebService returned a SOAP Fault: Your account is not signed up for the S3 service. You must sign up before you can use S3. faultcode=soapenv:Client.NotSignedUp faultactor=
 
 
When I click on the EC2 Console tab I am getting the following error:
 

Error:

 Error when querying the AWSKey__c custom object. Did not find any record with name of [force_demo_ag]. Please make sure the name is correct or create a record with the proper AWS credentials and retry.
 
Please guide me how to fix these errors.
 
Regards,
Diti

 
 
  • December 01, 2008
  • Like
  • 0
Hi ,
I am trying to execute the REST  example of Google data API given in the wiki. The link to view the Example is :
 
The problem is they have not given the link to access the Contacts API.
I have found one link but I am getting the error :"Authorization Required"
 
The link is :
 
Am I using the wrong link ?
 
Can you please give the correct link for this?
 
 
Regards ,
 
Diti
 
  • November 21, 2008
  • Like
  • 0

Hi.

I am trying to invoke a REST  web service through Force.com as mentioned in the example provided in

http://wiki.apexdevnet.com/index.php/Force.com_Zillow_Mashup

I had used the following code for  parsing the XML document ( please see the code below )

Code:
public class PropertySearchResponse {   
xmldom.element searchResult ;
 public Double getZEstimateAmount(){
        Double.valueOf( searchResult.getElementByTagName( 'amount').nodeValue ) ;
     return d ; 
  } 
}

While compiling the code I am getting the following error

ErrorError: Compile Error: Invalid type: xmldom.element at line 2 column 1

Would you please guide me how to use XMLDOM ? I think it is not able to recognise XMLDOM. However I tried the XMLReader document and it run fine.

Alternatively is there any way to convert the Httpresponse sent by the REST Service into an XMLReader, which we can parse thereafter.

regards,

Diti

  • November 11, 2008
  • Like
  • 0
Hi,
 
If I have multiple js Files , How should I include them ?
 
In refrence to Salesforce-Apex-Language-Refrence , page no -21, they have written a S-control for the Apex Code:
 
Apex Code:
Code:
global class HelloWorld2 {
// The WebService keyword makes this a public WebService method
WebService static String sayHelloWorld(String arg) {
// This method returns a simple message
return 'Hello '+arg;
}
}

 
Code for S-control:
Code:
<html>
<head>

<script type="text/javascript" src="/js/functions.js"></script>
<script src="/soap/ajax/11.0/connection.js"></script>
<script src="/soap/ajax/11.0/apex.js"></script>
<script>
function demo() {
var result = sforce.apex.execute('HelloWorld2' , 'sayHelloWorld',
{arg:"new Apex user!"});
document.getElementById('userNameArea').innerHTML = 'Congratulations!'
+ ' ' + result;
}
</script>
</head>
<body onload=demo()>
<div id=userNameArea>
</div>
</body>
</html>

 
Where in Force.com have they included Functions.js?
 
How should I include multiple js Files?
 
Please help.
 
Regards
Diti
  • October 20, 2008
  • Like
  • 0
Hi,
 
Given a XML schema, is there a way to create Data Model Consisting of Custom Objects?
 
Following is the Schema:
 
<TXLifeRequest>
 <OLifE>
  <Holding>
   <CurrencyTypeCode>840</CurrencyTypeCode>
   <Policy>
    <PolNumber>FLA_1000073998</PolNumber>
    <PolicyStatus>21</PolicyStatus>
    <RequirementInfo>
     <ReqCode>348</ReqCode>
     <ReqOrderMode>1</ReqOrderMode>
     <RequirementInfoSysKey>1000073999</RequirementInfoSysKey>
    </RequirementInfo>
   </Policy>
  </Holding>
  <Oid>1000073992</Oid>
  <Party>
   <Address>
    <AddressStateTC>17</AddressStateTC>
    <Zip>60601</Zip>
   </Address>
   <FullName>Robert Jones</FullName>
   <GovtId>640640604</GovtId>
   <PartySysKey>1000073996</PartySysKey>
   <Person>
    <BirthCountry>1</BirthCountry>
    <BirthJurisdictionTC>17</BirthJurisdictionTC>
    <FirstName>Robert</FirstName>
    <Gender>1</Gender>
    <LastName>Jones</LastName>
   </Person>
  </Party>
  <Party>
  </Party>
 </OLifE>
 <TransRefGUID>1000073991</TransRefGUID>
 <TransType>9002</TransType>
</TXLifeRequest>

 

 

please help..


 


Message Edited by soa on 09-12-2008 01:48 AM
  • September 12, 2008
  • Like
  • 0
Hello ,
 
I was trying to call a method from the apex class generated from an external wsdl
 
The schema of the request object has a complex type with the following structure :
 
Schema of the party :
- <complexType name="party">
- <sequence>
  <element name="FullName" nillable="true" type="xsd:string" />
  <element name="PartySysKey" nillable="true" type="xsd:string" />
  <element name="Person" nillable="true" type="impl:person" /> 
 
.................
..................
  <element name="Employment" nillable="true" type="impl:employment" />
  <element name="ResidenceCountry" nillable="true" type="xsd:int" />
  <element maxOccurs="unbounded" name="Address" nillable="true" type="impl:Address" />
  <element maxOccurs="unbounded" name="Phone" nillable="true" type="impl:phone" />
  </sequence>
  <attribute name="id" type="xsd:string" />
  </complexType>
 
Schema of the Address
 
- <complexType name="Address">
- <sequence>
  <element name="Line1" nillable="true" type="xsd:string" />
  <element name="Line2" nillable="true" type="xsd:string" />
  <element name="City" nillable="true" type="xsd:string" />
  <element name="Zip" nillable="true" type="xsd:int" />
  </sequence>
  <attribute name="id" type="xsd:string" />
  </complexType>
 
While populating the request object, to populate ID I had written a statement like
request_x.TXLifeRequest.OLifE.Party.Id = 1000073628;
 
Then I am getting the compilation error =
Error: Compile Error: Variable does not exist: Id at line 26 column 5

On further exploration I found that the Generated Apex Client is not does not have the ID field on the structure.
Adding the generated code for your ready reference
 
Code:
    public class party {
        public String FullName;
        public String PartySysKey;
        public flaMericaUsNetCorebaseobjects.person Person;
        public Integer PartyTypeCode;
        public String GovtId;
        public Integer GovtIDStatus;
        public Integer GovtIdType;
        public Integer ResidenceState;
        public Integer ResidenceZip;
        public flaMericaUsNetCorebaseobjects.employment Employment;
        public Integer ResidenceCountry;
        public flaMericaUsNetCorebaseobjects.Address[] Address;
        public flaMericaUsNetCorebaseobjects.phone[] Phone;
< ID is Missing here ... >

 
Also  for populating Zip element in the Address we had written a statement like
   request_x.TXLifeRequest.OLifE.Party.Address.Zip = 60601;
 
Error: Compile Error: Initial term of field expression must be a concrete SObject: LIST:flaMericaUsNetCorebaseobjects.party at line 35 column 5
 
Would you please let us know how we can populate this two fields.
 
Thanks & Regards.
Sanghamitra


Message Edited by soa on 09-11-2008 05:23 AM
  • September 11, 2008
  • Like
  • 0
Hello,
 
Trying to generate an Apex class from the following WSDL :
 
WSDL :
<—xml version="1.0"–>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
 name="FLAMericaService"
 targetNamespace="http://fla.merica-us.net/coreBaseObjects"
 xmlns="http://schemas.xmlsoap.org/wsdl/"
 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:tns="http://fla.merica-us.net" 
 xmlns:s="http://fla.merica-us.net/coreBaseObjects"
 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
 xmlns:xml-soap="http://xml.apache.org/xml-soap">
 
 <wsdl:types>
  
  
  <xsd:schema elementFormDefault="qualified"
   targetNamespace="http://fla.merica-us.net/coreBaseObjects">
   <xsd:element name="GetHealthProfile">
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element minOccurs="1" maxOccurs="1" name="name" type="s:TXLifeRequest"/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   
   <xsd:element name="GetHealthProfileResponse">
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element minOccurs="1" maxOccurs="1"
       name="GetHealthProfileResult" type="xsd:string"/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   
   <!-- GetPrescriptionHistory starts here-->
   <xsd:element name="GetPrescriptionHistory">
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element minOccurs="1" maxOccurs="1" name="TXLifeRequest" type="s:TXLifeRequest"/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   <xsd:element name="GetPrescriptionHistoryResponse">
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element minOccurs="1" maxOccurs="1"
       name="GetPrescriptionHistoryResult" type="s:TXLifeResponse"/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   <!-- GetPrescriptionHistory ends here-->
   
  </xsd:schema>
  
  
  <s:schema xmlns="http://www.w3.org/2001/XMLSchema"
   xmlns:typens="urn:XXXXXAddressFetcher2"
   targetNamespace="http://fla.merica-us.net/coreBaseObjects">
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   
   <complexType name="TXLifeRequest">
    <all>
     <element name="OLifE" type="s:oLifE" nillable="true"/>
     <element name="TransRefGUID" type="string" nillable="true"/>
     <element name="TransType" type="int" nillable="true"/>
     <element name="TransExeDate" type="string" nillable="true"/>
     <element name="TransExeTime" type="string" nillable="true"/>
     <element name="TransMode" type="string" nillable="true"/>
     <element name="TestIndicator" type="int" nillable="true"/>
    </all>
   </complexType>
   
   <complexType name="TXLifeResponse">
    <all>
     <element name="TransResult" type="s:transResult"
      nillable="true"/>
     <element name="OLifE" type="s:oLifE" nillable="true"/>
     <element name="TransRefGUID" type="string" nillable="true"/>
     <element name="TransType" type="int" nillable="true"/>
     <element name="TransExeDate" type="string" nillable="true"/>
     <element name="TransExeTime" type="string" nillable="true"/>
     <element name="TransMode" type="string" nillable="true"/>
     <element name="TestIndicator" type="int" nillable="true"/>
     <element name="TXLifeResponseOLifEExtension"
      type="s:TXLifeResponseOLifEExtension" nillable="true"/>
    </all>
   </complexType>
   
..............  
... Deleted the detailed echma detail because of the limitation of size..
 <!-- GetHelloMsg messages starts here-->
 <wsdl:message name="GetHealthProfileSoapIn">
  <wsdl:part name="parameters" element="s:GetHealthProfile"/>
 </wsdl:message>
 <wsdl:message name="GetHealthProfileSoapOut">
  <wsdl:part name="parameters" element="s:GetHealthProfileResponse"/>
 </wsdl:message>
 
 <!-- GetHelloMsg messages ends here-->
 
 <!-- GetPrescriptionHistory messages starts here-->
 <wsdl:message name="GetPrescriptionHistorySoapIn">
  <wsdl:part name="parameters" element="s:GetPrescriptionHistory"/>
 </wsdl:message>
 <wsdl:message name="GetPrescriptionHistorySoapOut">
  <wsdl:part name="parameters" element="s:GetPrescriptionHistoryResponse"/>
 </wsdl:message>
 <!-- GetPrescriptionHistory messages ends here-->
 
 
 
 <!--  porttype starts here-->
 <wsdl:portType name="FlaMericaServiceSoap">
  
  <wsdl:operation name="GetHealthProfile">
   <wsdl:input message="s:GetHealthProfileSoapIn"/>
   <wsdl:output message="s:GetHealthProfileSoapOut"/>
  </wsdl:operation>
  
  <wsdl:operation name="GetPrescriptionHistory">
   <wsdl:input message="s:GetPrescriptionHistorySoapIn"/>
   <wsdl:output message="s:GetPrescriptionHistorySoapOut"/>
  </wsdl:operation>
  
  
 </wsdl:portType>
 <!-- porttype ends here-->
 
 
 <wsdl:binding name="FlaMericaServiceSoap" type="s:FlaMericaServiceSoap">
  <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
   style="document"/>
  <!-- GetHelloMsg operation starts here-->
  <wsdl:operation name="GetHealthProfile">
   <soap:operation
    soapAction="http://localhost:8080/doclit/sample/services/FLAWebService/GetHelloMsg"
    style="document"/>
   <wsdl:input>
    <soap:body use="literal"/>
   </wsdl:input>
   <wsdl:output>
    <soap:body use="literal"/>
   </wsdl:output>
  </wsdl:operation>
  <!-- GetHelloMsg operation ends here-->
  
  <!-- GetPrescriptionHistory operation starts here-->
  
  <wsdl:operation name="GetPrescriptionHistory">
   <soap:operation
    soapAction="http://localhost:8080/hannover/merica-us/services/FLAWebService/GetPrescriptionHistoryReport"
    style="document"/>
   <wsdl:input>
    <soap:body use="literal"/>
   </wsdl:input>
   <wsdl:output>
    <soap:body use="literal"/>
   </wsdl:output>
  </wsdl:operation>
  
  <!-- GetPrescriptionHistory operation ends here-->
  
 </wsdl:binding> 
 
 
 <wsdl:service name="FlaMericaService">
  <wsdl:port name="FLAWebService" binding="s:FlaMericaServiceSoap">
   <soap:address
    location="http://localhost:8080/hannover/merica-us/services/FLAWebService"/>
  </wsdl:port>
 </wsdl:service>
 
</wsdl:definitions>

 
The WSDL is stored on my local hard disk ..
 
Force.come could parse the WSDL but while generating the code I got the following error :
Error: Unable to find complexType for {http://fla.merica-us.net/coreBaseObjects}TXLifeRequest
 
Am I missing some thing.
 
Thanks & Regrds
Sanghamitra
 
  • September 10, 2008
  • Like
  • 0
Hi,
 
I am Facing problem in invoking a Apex class from a Button. From one of our login I am able to invoke the class, but from the other I am not able to invoke the same class.
 
Is there any setting required for the same?
Please help me.
 
 
 
 
Regards
 
Diti
  • September 04, 2008
  • Like
  • 0
Hi,
 
I could parse the WSDL to generate a client for the following link:
 
 
but could not parse for the following:
 
Please solve my problem.Am I missing something in the Second one?
 
 
Regards,
 
Diti
  • August 25, 2008
  • Like
  • 0
Hi,
 
I have generated the folllowing class:
 
public class wwwWebservicexNet {
    public class ConvertTemperatureSoap {
        public String endpoint_x = 'http://www.webservicex.net/ConvertTemperature.asmx';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        private String[] ns_map_type_info = new String[]{'http://www.webserviceX.NET/', 'wwwWebservicexNet'};
        public Double ConvertTemp(Double Temperature,String FromUnit,String ToUnit) {
            wwwWebservicexNet.ConvertTemp_element request_x = new wwwWebservicexNet.ConvertTemp_element();
            wwwWebservicexNet.ConvertTempResponse_element response_x;
            request_x.Temperature = Temperature;
            request_x.FromUnit = FromUnit;
            request_x.ToUnit = ToUnit;
            Map<String, wwwWebservicexNet.ConvertTempResponse_element> response_map_x = new Map<String, wwwWebservicexNet.ConvertTempResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://www.webserviceX.NET/ConvertTemp',
              'http://www.webserviceX.NET/',
              'ConvertTemp',
              'http://www.webserviceX.NET/',
              'ConvertTempResponse',
              'wwwWebservicexNet.ConvertTempResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.ConvertTempResult;
        }
    }
    public class ConvertTempResponse_element {
        public Double ConvertTempResult;
        private String[] ConvertTempResult_type_info = new String[]{'ConvertTempResult','http://www.w3.org/2001/XMLSchema','double','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.webserviceX.NET/','true'};
        private String[] field_order_type_info = new String[]{'ConvertTempResult'};
    }
    public class ConvertTemp_element {
        public Double Temperature;
        public String FromUnit;
        public String ToUnit;
        private String[] Temperature_type_info = new String[]{'Temperature','http://www.w3.org/2001/XMLSchema','double','1','1','false'};
        private String[] FromUnit_type_info = new String[]{'FromUnit','http://www.webserviceX.NET/','TemperatureUnit','1','1','false'};
        private String[] ToUnit_type_info = new String[]{'ToUnit','http://www.webserviceX.NET/','TemperatureUnit','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.webserviceX.NET/','true'};
        private String[] field_order_type_info = new String[]{'Temperature','FromUnit','ToUnit'};
    }
}
 
I tried to invoke the methods of the code (as given on page 141 of salesforce_platform_cookbook.pdf) The code is :

global class MassNoteInsert{

WebService static Integer insertNotes(String iTitle,

String iBody,

Id[] iParentIds) {

Note[] notes = new Note[0];

for (Id iParentId : iParentIds) {

notes.add(new Note(parentId = iParentId,

title = iTitle, body = iBody));

}

insert notes; //Bulk Insert

return notes.size();

}

}

But for the previous code I am getting an error as I prees the button on the Accounts page. The error is:
 
" A problem with OnClick Javascript for this button or link was encountered:
{faultcode:'soapenv:Client', faultString:'No service available for class"www.webServicexNet.ConvertTemperatureSoap",}"
 
 
Please help me out for the same.
 
Regards,
 
Diti


Message Edited by soa on 08-19-2008 02:09 AM
  • August 19, 2008
  • Like
  • 0
3 days old (new) to salesforce!
i need to invoke a webservice from a tab like contacts when a button is clicked.
i understand i can add a custom button, but how do i write the code behind it, which will be triggered upon clicking.
the code behind the buttons needs to invoke this webservice, passing some details from the screen such as customer name and postcode, and the response that is received should be displayed on the screen.

please help people !