• Peter Kemp
  • NEWBIE
  • 25 Points
  • Member since 2008

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 16
    Replies

 

Hi all,

          Is it possible to insert the fields from salesforce to mysql.if so can anyone guide me with the possibilities.

 

 

 

Regards,

Nalini.s

Message Edited by Nalini on 03-09-2009 12:31 AM
  • March 09, 2009
  • Like
  • 0

Hi,

We have a custom object that records the time that an event starts.  On creating this event it fires a SOAP packet to an external webservice.  This webservice treats the date as a string and doesn't perform any logic on it.  However, when the date reaches the external webservice the date is an hour out, the date was put into Salesforce as a BST date and appears to be exported as a GMT date.  I have checked the settings in our salesforce and it is set to BST Europe/London.  On exporting the users from our salesforce account their details match the accounts timezone. TIMEZONESIDKEY = 'Europe/London'.  there is no logic firing on the custom object side.  Any ideas what is going on here and how to fix it?


Thanks

Pete

Hi,

We are working with a developer who has set up an external webservice that is called by work flow.  When we fired the workflow on another sandbox it worked fine, but now when we fire it, it is failing.  We would like to look at the SOAP error returned but the Outbound Messaging Delivery Status screen truncates the error to:

ActionOutbound Message IDObject# AttemptsCreated DateNext AttemptDelivery Failure Reason
Retry | Del04kS00000004Ce8a0lS00000008YFU112/06/2009 12:4612/06/2009 12:47System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.IO.FileLoadException: Could not l

 I've added a log to the account that fires the workflow but it doesn't pick up on the returned message.  Any ideas how I can find out what the "Could no l....." actually means?

 

I can't seem to find Setup | Monitoring | Outbound Message Notifications. when following the help guide here:

https://cs1.salesforce.com/help/doc/user_ed.jsp?section=help&target=workflow_outbound_messages_notifications.htm&loc=help&hash=topic-title

 

Thanks

 

Pete

I've written and tested a salesforce to MySQL backup tool in php (https://sourceforge.net/projects/unforced/).  I did all the testing in the sandbox and would now like to switch over to our live org.  I've changed the username and password and even refreshed the partner wsdl though it won't connect to the live org with security token or without.  Any idea what I'm doing wrong?  I get the following error:

 

 

SoapFault Object
(
[message:protected] => INVALID_LOGIN: Invalid username or password or locked out.
[string:private] =>
[code:protected] => 0
[file:protected] => C:\xampp\htdocs\test\salesforcebu\includes\soapclient\SforceBaseClient.php
[line:protected] => 155
[trace:private] => Array

 EDIT:

 

I notice that the WSDL I am getting from the live org says api version 15.0whilst the toolkit is only 13.0.  Also I have changed line

 

 

<soap:address location="https://www.salesforce.com/services/Soap/u/15.0"/>

 

 To point to the cs2 or live depnding on which login I use.  for the test accounts it doesn't matter, but for the live account, neither works.
I have checked my user rights on the live server and I am a System Administrator with API enabled == True.  Is there a setting on the live org that I am missing?

 

Thanks

 

Pete

 

Message Edited by Peter Kemp on 04-27-2009 04:14 AM
Message Edited by Peter Kemp on 04-27-2009 07:31 AM

Hi,

 

It seems that SF to mySQL replicators are the flavour of the month.  Having used Mike's code to build my own and back up our entire Salesforce instance, I was wondering if there was a way to extract the relationships between objects?  Getting secondary keys and enforcing the relationships when you build the mysql tables would allow for a proper copy of salesforce.  I was hoping there would be a neat way to do this with the partner wsdl.  Also it would be good to get the the optional values for fields such as salutation = Mr. Mrs. Ms. Miss. Dr. ... directly from the database so when you are editing your mysql you are under the same restrictions as you would be on salesforce.

 

I suppose what I'm asking for is access to the Salesforce database schema using php.

 

I can kind of  see how this could be achieved through the enterprise wsdl, but haven't played with that yet.

 

Any help would be great.

 

Thanks

 

Pete

 

Message Edited by Peter Kemp on 03-10-2009 03:38 AM

 Hi,

 

I'm trying to replicate data from Salesforce to a local MySQL database, I can pull the salesforce objects successfully and they each look like this:

 

[0]=> object(SObject)#11 (3) { ["type"]=> string(7) "Account" ["fields"]=> object(stdClass)#213 (4) { ["IsDeleted"]=> string(5) "false" ["MasterRecordId"]=> string(0) "" ["Name"]=> string(4) "Acme" ["Type"]=> string(8) "Prospect" }

["Id"]=> string(18) "0012000000162QEAAY" }

You can clearly see that there is a 'fields' object inside the sObject.  However, when I create an sObject variable to deal with thisI can no longer access the fields

 

for ($i = 0; $i < $record_count; $i++) //foreach ($records as $r) { $r = new SObject($records[$i]); $pass_this['id'] = $r->Id; foreach ($r->fields as $key => $value) { $pass_this[$key] = addslashes($r->fields->$key); }

 You can see that the fields obecjt is now empty?! It cannot parse the foreach statement and it gives the following error

 

 

object(SObject)#211 (3) { ["type"]=> string(7) "Account" ["fields"]=> NULL ["Id"]=> string(1) "0" } Warning: Invalid argument supplied for foreach()

 I am using version 13 of the php toolkit.  Any idea where I am going wrong?

 

Thanks

 

Pete

 

 

I have been following the cookbook and would like to add fields to edit objects on my visual force page.  I have used the following code:

 

 

<apex:pageBlockSectionItem > <apex:outputLabel value="Name"/> <apex:inputField value="{!account.name}"/> </apex:pageBlockSectionItem>

 and the apex:

 

public Account getaccount() { return [select id, salutation, name from Account where id = :System.currentPageReference().getParameters().get('id')]; }

 

 it brings up the error:

When referencing account.name with inputField, you must select isPersonAccount in your SOQL query

 I have tried using SOQL that selects isPersonAccount = true but this doesn't seem to fix the proble, what is the error asking for?

 

Thanks

 

Pete


 

 

 

 

 

I have been following the cookbook and want to display a list using visualforce of all the accounts that are applying and awaiting 2 screenings. I have tested the code using apex explorer and this apex returns a list of sobjects. But when I try to move through them using visual force I get the following error. How can I rewrite this code to display all the names?

 

<apex:pageBlock title="Select a Candidate">
<apex:dataTable value="{!account}" var="u" cellPadding="4" border="1">
<apex:column >{!u.name}</apex:column>
<apex:column >{!u.id}</apex:column>
</apex:dataTable>
</apex:pageBlock>

public Account getaccount() {
return [select id, name from Account where Recruitment_status__pc = 'Applying' AND Application_sub_stage__pc = 'Awaiting 2 screenings'];
}

 

 

I'm building a web app that pulls and pushes data from and to Salesforce.  I am using the WSDL to make the connection and everything is going swimmingly.  However, some of the fields are drop down lists with preset values from salesforce, at the moment these are hard coded which isn't good news if we choose to update it at some point.  Is there any way to feed these lists directly from salesforce instead of having to keep two separate versions of it?  I also realise this may be hideously slow.


Hi,

I'm still working on this old code base that I've inherited and when it comes to commiting an application the following routine fails to execute.  Again, there was no error handling code but I managed to extract the error from the trace.  Code is as follows:

Code:
public sforce.SaveResult[] updateUserRecruimentDetails(String recStatus, String recStage, String unsubSubstage, String appSubstage, string userId, sforce.SforceService binding)
{
 // NB if you change the names of the recruitment status, stage or sub-stage fields 
 // then you will have to export a new wsdl file then change the code below
 sforce.QueryResult qr = binding.query("Select Id from Contact where Id='" + userId + "'");
 sforce.sObject[] results = qr.records;
 sforce.Contact contact = (sforce.Contact)results[0];
 contact.Recruitment_Status__c = recStatus;
 contact.Recruitment_Stage__c = recStage;

 if(!unsubSubstage.Equals(""))
 {
  contact.Unsubmitted_sub_stage__c = unsubSubstage;
 }

 if( recStage.Equals("Unsubmitted") )
 {
  contact.Unsubmitted_sub_stage__c = appSubstage;
 }
 else if( recStage.Equals("Application") )
 {
  contact.Application_sub_stage__c = appSubstage;
 }
 else if( recStage.Equals("Assessment Centre") )
 {
  contact.Assessment_Centre_sub_stage__c = appSubstage;
 }
 else if( recStage.Equals("Offer") )
 {
  contact.Offer_sub_stage__c = appSubstage;
 }
 sforce.sObject[] records = {contact};
 sforce.SaveResult[] saveResults = binding.update(records);
 return saveResults;
}

called from:

Code:
contact.updateUserRecruimentDetails("Applying", "Application", "Submitted application", "Awaiting 2 screenings", userId, binding);

Brings up the error:

message = "WebApplicationSubmission: execution of BeforeUpdate\n\ncaused by: System.SObjectException: DML statment cannot operate on trigger.new or trigger.old\n\nClass.ApplicantConversion.BaseConverter.associateWithAccount: line 53, column 13\nClass.ApplicantConvers...

i presume this is a system error, event though it does have a spelling mistake in it. The datatypes for the
Assessment_Centre_sub_stage__c etc are all pick lists and they used to work fine. Any ideas?

Thanks

Pete
I have inherited a Salesforce C# project which was using an old wsdl written in 2005, and SOAP v7.0

In my attempt to bring it up to date I have used the new wsdl (SOAP v14.0) and rebuilt the references.cs output by wsdl.exe  However, I can't get past the following error:
Code:
public QueryResult query(string queryString)
{
object[] results = this.Invoke("query", new object[] {
queryString});
return ((QueryResult)(results[0]));
}

It says: System.Web.Services.Protocols.SoapException: UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from
login must be set in the SforceService


The system logs in correctly but it doesn't seem to get past this line. I've looked through the traces and everything seems in order. I'm really not quite sure what it is asking...

Help!

Hi,

I'm trying perform a search on Salesforce using the PHP SOAP search function.  I have the ID of an object and would like to check that the user owns that object before allowing them access to it.  I'm read the documentation on SOSL and have come up with this.  Where they find all the careers matching the one chosen, then check that the Contact is the owner of that career

$allowed =     "FIND {\"$careerid\"}
                        IN ALL FIELDS
                        RETURNING
                        Participant_Career__c(ID, Name WHERE Contact__c = \"$contactid\")";

$allowed = $mySforceConnection->search($allowed);

However, this returns an empty object.  I know the $careerid exists in Salesforce but FINDing on the $careerid returns an empty object as well.  Any ideas where I can going wrong?

Thanks

Pete

I would like to pull a list of accounts, based on their status into a mysql database on a hosted server. Is there a PHP script or application to perform this task?
  • August 11, 2009
  • Like
  • 0

Hi,

We have a custom object that records the time that an event starts.  On creating this event it fires a SOAP packet to an external webservice.  This webservice treats the date as a string and doesn't perform any logic on it.  However, when the date reaches the external webservice the date is an hour out, the date was put into Salesforce as a BST date and appears to be exported as a GMT date.  I have checked the settings in our salesforce and it is set to BST Europe/London.  On exporting the users from our salesforce account their details match the accounts timezone. TIMEZONESIDKEY = 'Europe/London'.  there is no logic firing on the custom object side.  Any ideas what is going on here and how to fix it?


Thanks

Pete

Hi,

We are working with a developer who has set up an external webservice that is called by work flow.  When we fired the workflow on another sandbox it worked fine, but now when we fire it, it is failing.  We would like to look at the SOAP error returned but the Outbound Messaging Delivery Status screen truncates the error to:

ActionOutbound Message IDObject# AttemptsCreated DateNext AttemptDelivery Failure Reason
Retry | Del04kS00000004Ce8a0lS00000008YFU112/06/2009 12:4612/06/2009 12:47System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.IO.FileLoadException: Could not l

 I've added a log to the account that fires the workflow but it doesn't pick up on the returned message.  Any ideas how I can find out what the "Could no l....." actually means?

 

I can't seem to find Setup | Monitoring | Outbound Message Notifications. when following the help guide here:

https://cs1.salesforce.com/help/doc/user_ed.jsp?section=help&target=workflow_outbound_messages_notifications.htm&loc=help&hash=topic-title

 

Thanks

 

Pete

I've written and tested a salesforce to MySQL backup tool in php (https://sourceforge.net/projects/unforced/).  I did all the testing in the sandbox and would now like to switch over to our live org.  I've changed the username and password and even refreshed the partner wsdl though it won't connect to the live org with security token or without.  Any idea what I'm doing wrong?  I get the following error:

 

 

SoapFault Object
(
[message:protected] => INVALID_LOGIN: Invalid username or password or locked out.
[string:private] =>
[code:protected] => 0
[file:protected] => C:\xampp\htdocs\test\salesforcebu\includes\soapclient\SforceBaseClient.php
[line:protected] => 155
[trace:private] => Array

 EDIT:

 

I notice that the WSDL I am getting from the live org says api version 15.0whilst the toolkit is only 13.0.  Also I have changed line

 

 

<soap:address location="https://www.salesforce.com/services/Soap/u/15.0"/>

 

 To point to the cs2 or live depnding on which login I use.  for the test accounts it doesn't matter, but for the live account, neither works.
I have checked my user rights on the live server and I am a System Administrator with API enabled == True.  Is there a setting on the live org that I am missing?

 

Thanks

 

Pete

 

Message Edited by Peter Kemp on 04-27-2009 04:14 AM
Message Edited by Peter Kemp on 04-27-2009 07:31 AM

Hi,

 

It seems that SF to mySQL replicators are the flavour of the month.  Having used Mike's code to build my own and back up our entire Salesforce instance, I was wondering if there was a way to extract the relationships between objects?  Getting secondary keys and enforcing the relationships when you build the mysql tables would allow for a proper copy of salesforce.  I was hoping there would be a neat way to do this with the partner wsdl.  Also it would be good to get the the optional values for fields such as salutation = Mr. Mrs. Ms. Miss. Dr. ... directly from the database so when you are editing your mysql you are under the same restrictions as you would be on salesforce.

 

I suppose what I'm asking for is access to the Salesforce database schema using php.

 

I can kind of  see how this could be achieved through the enterprise wsdl, but haven't played with that yet.

 

Any help would be great.

 

Thanks

 

Pete

 

Message Edited by Peter Kemp on 03-10-2009 03:38 AM

 

Hi all,

          Is it possible to insert the fields from salesforce to mysql.if so can anyone guide me with the possibilities.

 

 

 

Regards,

Nalini.s

Message Edited by Nalini on 03-09-2009 12:31 AM
  • March 09, 2009
  • Like
  • 0

 Hi,

 

I'm trying to replicate data from Salesforce to a local MySQL database, I can pull the salesforce objects successfully and they each look like this:

 

[0]=> object(SObject)#11 (3) { ["type"]=> string(7) "Account" ["fields"]=> object(stdClass)#213 (4) { ["IsDeleted"]=> string(5) "false" ["MasterRecordId"]=> string(0) "" ["Name"]=> string(4) "Acme" ["Type"]=> string(8) "Prospect" }

["Id"]=> string(18) "0012000000162QEAAY" }

You can clearly see that there is a 'fields' object inside the sObject.  However, when I create an sObject variable to deal with thisI can no longer access the fields

 

for ($i = 0; $i < $record_count; $i++) //foreach ($records as $r) { $r = new SObject($records[$i]); $pass_this['id'] = $r->Id; foreach ($r->fields as $key => $value) { $pass_this[$key] = addslashes($r->fields->$key); }

 You can see that the fields obecjt is now empty?! It cannot parse the foreach statement and it gives the following error

 

 

object(SObject)#211 (3) { ["type"]=> string(7) "Account" ["fields"]=> NULL ["Id"]=> string(1) "0" } Warning: Invalid argument supplied for foreach()

 I am using version 13 of the php toolkit.  Any idea where I am going wrong?

 

Thanks

 

Pete

 

 

I have been following the cookbook and would like to add fields to edit objects on my visual force page.  I have used the following code:

 

 

<apex:pageBlockSectionItem > <apex:outputLabel value="Name"/> <apex:inputField value="{!account.name}"/> </apex:pageBlockSectionItem>

 and the apex:

 

public Account getaccount() { return [select id, salutation, name from Account where id = :System.currentPageReference().getParameters().get('id')]; }

 

 it brings up the error:

When referencing account.name with inputField, you must select isPersonAccount in your SOQL query

 I have tried using SOQL that selects isPersonAccount = true but this doesn't seem to fix the proble, what is the error asking for?

 

Thanks

 

Pete


 

 

 

 

 

I have been following the cookbook and want to display a list using visualforce of all the accounts that are applying and awaiting 2 screenings. I have tested the code using apex explorer and this apex returns a list of sobjects. But when I try to move through them using visual force I get the following error. How can I rewrite this code to display all the names?

 

<apex:pageBlock title="Select a Candidate">
<apex:dataTable value="{!account}" var="u" cellPadding="4" border="1">
<apex:column >{!u.name}</apex:column>
<apex:column >{!u.id}</apex:column>
</apex:dataTable>
</apex:pageBlock>

public Account getaccount() {
return [select id, name from Account where Recruitment_status__pc = 'Applying' AND Application_sub_stage__pc = 'Awaiting 2 screenings'];
}

 

 

Hi,

I'm still working on this old code base that I've inherited and when it comes to commiting an application the following routine fails to execute.  Again, there was no error handling code but I managed to extract the error from the trace.  Code is as follows:

Code:
public sforce.SaveResult[] updateUserRecruimentDetails(String recStatus, String recStage, String unsubSubstage, String appSubstage, string userId, sforce.SforceService binding)
{
 // NB if you change the names of the recruitment status, stage or sub-stage fields 
 // then you will have to export a new wsdl file then change the code below
 sforce.QueryResult qr = binding.query("Select Id from Contact where Id='" + userId + "'");
 sforce.sObject[] results = qr.records;
 sforce.Contact contact = (sforce.Contact)results[0];
 contact.Recruitment_Status__c = recStatus;
 contact.Recruitment_Stage__c = recStage;

 if(!unsubSubstage.Equals(""))
 {
  contact.Unsubmitted_sub_stage__c = unsubSubstage;
 }

 if( recStage.Equals("Unsubmitted") )
 {
  contact.Unsubmitted_sub_stage__c = appSubstage;
 }
 else if( recStage.Equals("Application") )
 {
  contact.Application_sub_stage__c = appSubstage;
 }
 else if( recStage.Equals("Assessment Centre") )
 {
  contact.Assessment_Centre_sub_stage__c = appSubstage;
 }
 else if( recStage.Equals("Offer") )
 {
  contact.Offer_sub_stage__c = appSubstage;
 }
 sforce.sObject[] records = {contact};
 sforce.SaveResult[] saveResults = binding.update(records);
 return saveResults;
}

called from:

Code:
contact.updateUserRecruimentDetails("Applying", "Application", "Submitted application", "Awaiting 2 screenings", userId, binding);

Brings up the error:

message = "WebApplicationSubmission: execution of BeforeUpdate\n\ncaused by: System.SObjectException: DML statment cannot operate on trigger.new or trigger.old\n\nClass.ApplicantConversion.BaseConverter.associateWithAccount: line 53, column 13\nClass.ApplicantConvers...

i presume this is a system error, event though it does have a spelling mistake in it. The datatypes for the
Assessment_Centre_sub_stage__c etc are all pick lists and they used to work fine. Any ideas?

Thanks

Pete
Hello,
 
I am trying to build a .net application using visual basic.   The instructions tell me I have to use visual studio.  Is Visual web developer the same thing?
I have inherited a Salesforce C# project which was using an old wsdl written in 2005, and SOAP v7.0

In my attempt to bring it up to date I have used the new wsdl (SOAP v14.0) and rebuilt the references.cs output by wsdl.exe  However, I can't get past the following error:
Code:
public QueryResult query(string queryString)
{
object[] results = this.Invoke("query", new object[] {
queryString});
return ((QueryResult)(results[0]));
}

It says: System.Web.Services.Protocols.SoapException: UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from
login must be set in the SforceService


The system logs in correctly but it doesn't seem to get past this line. I've looked through the traces and everything seems in order. I'm really not quite sure what it is asking...

Help!

I used enterprise.wsdl (13.0) to generate the Web service stub, then
call the Salesforce Web service in java using loginBySessionId(String sid, String sURL),
while both the sessionId and serviceUrl is sent by virtual force page.

It works fine before the soap service endpoint has changed to 14.0:
https://www.salesforce.com/services/Soap/c/14.0
But it doesn't work now.

I didn't change my java code and page code.
I thought it should work well using the old version soap service, but things not.
Because of the exception, I also tried to update the wsdl file to 14.0, and rebuild my application.
But it doesn't work too.

NOW, my application cannot be used because of this exception.
Do there any one faced the same headache problem?

The following is the exceptions:

AxisFault
faultCode: {urn:fault.enterprise.soap.sforce.com}INVALID_SESSION_ID
faultSubcode:
faultString: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session
faultActor:
faultNode:
faultDetail:
{urn:fault.enterprise.soap.sforce.com}UnexpectedErrorFault:<ns1:exceptionCode>INVALID_SESSION_ID</ns1:exceptionCode><ns1:exceptionMessage>Invalid Session ID found in SessionHeader: Illegal Session</ns1:exceptionMessage>

INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session

....

Kunpeng Yang - 13/Oct/08 07:45 PM AxisFault faultCode: {urn:fault.enterprise.soap.sforce.com}INVALID_SESSION_ID faultSubcode: faultString: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session faultActor: faultNode: faultDetail: {urn:fault.enterprise.soap.sforce.com}UnexpectedErrorFault:<ns1:exceptionCode>INVALID_SESSION_ID</ns1:exceptionCode><ns1:exceptionMessage>Invalid Session ID found in SessionHeader: Illegal Session</ns1:exceptionMessage> INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session
Does anyone have a sample of what the SOAP message structure looks like for making an upsert call, with the partner wsdl, where the master record's external ID is used as the foreign key (rather than the salesforce ID)?.  I saw some examples of how to do this in code, using the enterprise wsdl, but not sure how the SOAP message looks for the partner wsdl.  I am trying to test this using XMLSpy, so I need the actual SOAP structure.
 
Here is the body of the SOAP message I currently use, but it requires the salesforce ID as the foreign key "Sales_Order__c" :
 
<SOAP-ENV:Body>
  <m:upsert xmlns:m="urn:partner.soap.sforce.com">
     <m:externalIDFieldName>ShipmentExternalID__c</m:externalIDFieldName>
     <m:sObjects>
        <m0:type>Delivery__c</m0:type>
        <m0:ShipmentExternalID__c>98765-artec</m0:ShipmentExternalID__c>
        <m0:Sales_Order__c>a0030000009RPj7AAG</m0:Sales_Order__c>
     </m:sObjects>
  </m:upsert>
 </SOAP-ENV:Body>