• vb13
  • NEWBIE
  • 25 Points
  • Member since 2008

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 8
    Replies
I need to create a task and link it to an Account based on the account external id.

I use the example from the manual - upsert() call, the section on upset and foreign keys.



I generate the following XML request:
<Subject>User vb16Save and Send Password</Subject><Description>User vb16 sent password and welcome email by tremor_sa</Description><ActivityDate>2008-11-19+15:58</ActivityDate><Status>Completed</Status><Publisher__c>PD00013</Publisher__c><Account><type>Account</type><Publisher_NUM__c>PD00013</Publisher_NUM__c></Account>

where Publisher__c is the Task externalid and Publisher_NUM__cis the account external id

Wraped in SOAP it becomes:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:partner.soap.sforce.com" xmlns:ns2="urn:sobject.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Header><ns1:SessionHeader><ns1:sessionId>511500D80000000LY4g!ARYAQG_TG0xCEstjK2Kou1cnpI3.HAUkxEwZOGtaQ6a2hBngygs0_SPOu0cvZMwvlmgTiihBuX9mJKFgc8z4pejdC0m9oRCR</ns1:sessionId></ns1:SessionHeader></SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:upsert><ns1:externalIDFieldName>Publisher__c</ns1:externalIDFieldName><ns1:sObjects>
<ns2:type>Task</ns2:type><ns2:Id xsi:nil="true"/><Subject>User vb16Save and Send Password</Subject><Description>User vb16 sent password and welcome email by tremor_sa</Description><ActivityDate>2008-11-19+15:58</ActivityDate><Status>Completed</Status><Publisher__c>PD00013</Publisher__c><Account><Publisher_NUM__c>PD00013</Publisher_NUM__c></Account></ns1:sObjects></ns1:upsert></SOAP-ENV:Body></SOAP-ENV:Envelope>


However I get a SF error:

Unable to create/update fields: AccountId. Please check the security settings of this field and verify that it is read/write for your profile.

Can someone help?

Again, this is specifically for a task.
  • November 19, 2008
  • Like
  • 0
Hi, Does anyone has php sample code for http://www.pocketsoap.com/weblog/2008/09/1824.html (also see the example upsert() - Foreign Keys section in the manual).
  • November 19, 2008
  • Like
  • 0
Is it possible to create a custom field for a Task or Activity of a type 'lookup'? I do not see this option in SF
  • November 19, 2008
  • Like
  • 0
I have an external id for an account. I want to make it a custom reference field for a task (or activity). The reason being is that I create tasks via Force.com SOAP API and I have the account external id. I am trying to avoid making 2 SOAP calls  -first to get the account id and second to create the task with the account id.
  • November 13, 2008
  • Like
  • 0
I need to create a task and link it to an Account based on the account external id.

I use the example from the manual - upsert() call, the section on upset and foreign keys.



I generate the following XML request:
<Subject>User vb16Save and Send Password</Subject><Description>User vb16 sent password and welcome email by tremor_sa</Description><ActivityDate>2008-11-19+15:58</ActivityDate><Status>Completed</Status><Publisher__c>PD00013</Publisher__c><Account><type>Account</type><Publisher_NUM__c>PD00013</Publisher_NUM__c></Account>

where Publisher__c is the Task externalid and Publisher_NUM__cis the account external id

Wraped in SOAP it becomes:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:partner.soap.sforce.com" xmlns:ns2="urn:sobject.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Header><ns1:SessionHeader><ns1:sessionId>511500D80000000LY4g!ARYAQG_TG0xCEstjK2Kou1cnpI3.HAUkxEwZOGtaQ6a2hBngygs0_SPOu0cvZMwvlmgTiihBuX9mJKFgc8z4pejdC0m9oRCR</ns1:sessionId></ns1:SessionHeader></SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:upsert><ns1:externalIDFieldName>Publisher__c</ns1:externalIDFieldName><ns1:sObjects>
<ns2:type>Task</ns2:type><ns2:Id xsi:nil="true"/><Subject>User vb16Save and Send Password</Subject><Description>User vb16 sent password and welcome email by tremor_sa</Description><ActivityDate>2008-11-19+15:58</ActivityDate><Status>Completed</Status><Publisher__c>PD00013</Publisher__c><Account><Publisher_NUM__c>PD00013</Publisher_NUM__c></Account></ns1:sObjects></ns1:upsert></SOAP-ENV:Body></SOAP-ENV:Envelope>


However I get a SF error:

Unable to create/update fields: AccountId. Please check the security settings of this field and verify that it is read/write for your profile.

Can someone help?

Again, this is specifically for a task.
  • November 19, 2008
  • Like
  • 0
Hi, Does anyone has php sample code for http://www.pocketsoap.com/weblog/2008/09/1824.html (also see the example upsert() - Foreign Keys section in the manual).
  • November 19, 2008
  • Like
  • 0
Is it possible to create a custom field for a Task or Activity of a type 'lookup'? I do not see this option in SF
  • November 19, 2008
  • Like
  • 0
I have an external id for an account. I want to make it a custom reference field for a task (or activity). The reason being is that I create tasks via Force.com SOAP API and I have the account external id. I am trying to avoid making 2 SOAP calls  -first to get the account id and second to create the task with the account id.
  • November 13, 2008
  • Like
  • 0