function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Darla.ax69Darla.ax69 

Problem updating weblink

Hi,

I'm trying to update the LinkType of a WebLink. According to the results of a DescribeSObject call for WebLink, LinkType is an updateable field. I'm trying to change the type from url to sControl. Here's the XML request that's being sent:

<soapenv:Body>
  <update xmlns="urn:partner.soap.sforce.com">
    <sObjects>
      <ns5:type xmlns:ns5="urn:sobject.partner.soap.sforce.com">WebLink</ns5:type>
      <ns6:fieldsToNull xmlns:ns6="urn:sobject.partner.soap.sforce.com">Url</ns6:fieldsToNull>
      <ns7:Id xmlns:ns7="urn:sobject.partner.soap.sforce.com">00b30000000j3FFAAY</ns7:Id>
      <LinkType xmlns="">sControl</LinkType>
      <ScontrolId xmlns="">01N300000000H1yEAE</ScontrolId>
    </sObjects>
  </update>
</soapenv:Body>


The response shows no errors:

<soapenv:Body>
  <updateResponse xmlns="urn:partner.soap.sforce.com">
    <result>
      <errors xsi:nil="true" />
      <id>00b30000000j3FFAAY</id>
      <success>true</success>
    </result>
  </updateResponse>
</soapenv:Body>


But when I query the WebLink, I see that the LinkType wasn't updated. The s-control ID was set properly and the URL was cleared, but the LinkType is still url.

<records xmlns:sf="urn:sobject.partner.soap.sforce.com" xsi:type="sf:sObject">
  <sf:type>WebLink</sf:type>
  <sf:Id>00b30000000j3FFAAY</sf:Id>
  <sf:PageOrSobjectType>Lead</sf:PageOrSobjectType>
  <sf:Height>600</sf:Height>
  <sf:ScontrolId>01N300000000H1yEAE</sf:ScontrolId>
  <sf:EncodingKey>UTF-8</sf:EncodingKey>
  <sf:OpenType>sidebar</sf:OpenType>
  <sf:LinkType>url</sf:LinkType>
  <sf:Url xsi:nil="true" />
  <sf:Name>Customer Connection Leads Console (dev)</sf:Name>
  <sf:Id>00b30000000j3FFAAY</sf:Id>
</records>


What am I doing wrong here? Why isn't the LinkType updating properly? And since it isn't updating, why don't I get an error message?

I considered deleting the weblink and adding a new one with the same name and correct link type, but that would remove the link from users' page layouts, which isn't good.

Thanks,

=> Darla