• Darla.ax69
  • NEWBIE
  • 5 Points
  • Member since 2004

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 8
    Replies
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
I use a custom tab to show a URL in an iframe. The URL points to my app, which includes pages of varying heights.

When the custom tab is defined, I'm forced to enter a specific height. But that height isn't the best height for each page of my app.

What I'd like to do is have the iframe height automatically set itself based on the height of my page. Unfortunately when I try to access the iframe object to modify it with JavaScript, I get a permission denied error.

Viewing the source of the salesforce.com page that contains my iframe, I see a doResize() method that appears it would set the height of the iframe to fit my content. Unfortunately I can't call that method from my page; it also gives me a permission denied error.

If I specify a height of 600 (for example) when I define my custom tab, the iframe has scrollbars. I could possibly be ok with that, except that if the browser window isn't tall enough, the main window also has scrollbars. So I've got double scrollbars which is very unpleasant to use. You have to scroll the main window down in order to be able to scroll the iframe all the way down.

My solution for now has been to specify an iframe height that's taller than I expect my pages to be (5000) to make sure the iframe won't have scrollbars, only the main window. The problem with that is that the user isn't taken to the top when a new page is clicked on. So if a user is at the bottom of a long page and clicks a link to go to a short page, the window doesn't automatically scroll to the top, so the user doesn't see anything on the short page, just empty space.

If I could control the main window scrollbar, I could fix that problem. But I don't have permission for that either.

At this point I'm out of ideas for what to do, so any suggestions are greatly appreciated.

For a future release, could salesforce make specifying the iframe height optional? And if you didn't specify a pixel height, the doResize() method would be called to automatically set the height?

Thanks for any advice,

=> Darla
Hello,

Our application uses the API (partner WSDL) to load an account and allow the user to update fields. I'm trying to handle all the permissions properly, to be sure I don't let a user attempt to update an account that they don't have permission for. What I'm looking for here is a comprehensive list of what I need to do, via the API, to ensure the user has permission to update the account.

The first step, as far as I can tell, is to check the updateable field in the DescribeSObject result. Then I can check the account owner and see if it's the current user. If its owned by the user and is updateable, I know the user can update the account.

But if the account isn't owned by the user, then what? What if sharing is setup as public read only? First, how can I tell if it is? And then, how do I see what group owns the account and if the user is in it? I see the AccounShare object. Does that include the user or group that owns the account? Or only those that have been granted access, other than the owner?

At least I know that with the sharing models other than public read only, if the user can view the account they can edit it. So that shouldn't cause me any trouble.

Thanks,

=> Darla
Hello,

I'm trying to use the API to set the revenue of a lead to $13000000.00, but when I load the updated lead via the UI (or query it after the update), the revenue has been set to $1.506 instead.

Here's the XML I'm sending:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sf="urn:partner.soap.sforce.com"
xmlns:sfobj="urn:sobject.partner.soap.sforce.com">
<soap:Header>
<sf:SessionHeader>
<sf:sessionId>***</sf:sessionId>
</sf:SessionHeader>
<sf:CallOptions>
<sf:client>InsideScoopCustConn/1.0</sf:client>
</sf:CallOptions>
</soap:Header>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<sf:update>
<sObjects>
<sfobj:type>lead</sfobj:type>
<sfobj:Id>00Q30000004P5IZ</sfobj:Id>
<AnnualRevenue>13000000.00</AnnualRevenue>
</sObjects>
</sf:update>
</soap:Body>
</soap:Envelope>

The problem also occurs when I create a new lead with that revenue setting. This worked fine before, and I haven't changed my code recently, so I don't know what's going on... Any ideas?

Thanks,

=> Darla
I just ran the new DescribeLayout call and was disappointed to find that web links aren't included in the results... Is this intentional or a bug? Or (hopefully) am I just missing something?

Thanks,

=> Darla
Hello,

I'm trying to count how many accounts haven't been modified since they were created. My plan was to run a query with a batch size of 1 and look at the response XML to see how many results are found. (I only need the number of accounts, not the account details).

I tried to run this query:

select Id from Account where CreatedDate = LastModifiedDate

And I get a malformed query exception. (I kind of expected that, but was hoping...)

Is there any way to accomplish this without retrieving the created date and modified date for all accounts and comparing it myself?

Thanks,

=> Darla
Hello,

I need to query for all accounts without a parent ID. I tried this query:

select Id from Account where ParentId = null

And there are no results. I'm guessing maybe I have to do something different since the type of ParentId is a reference?

Any help is appreciated,

=> Darla
I used the API to create a new web link for the account detail page. It shows up in the setup area (under Studio -> Customize -> Accounts -> Web Links), but isn't showing up on the account detail page. I know when I've created web links manually, I've had to add them to the page layout. So I'm guessing maybe I have to do that when I create them programmatically as well? How can I automate that?

Thanks,

=> Darla
My setup uses some custom fields for both leads and accounts. Most were created by another user, but I created one for leads and one for accounts. When I use the describe call, not all of the custom fields are returned. Specifically, the field I created isn't being returned, but all the others are. Any ideas why this is happening or what I can do about it?

Thanks,

=> Darla
I use a custom tab to show a URL in an iframe. The URL points to my app, which includes pages of varying heights.

When the custom tab is defined, I'm forced to enter a specific height. But that height isn't the best height for each page of my app.

What I'd like to do is have the iframe height automatically set itself based on the height of my page. Unfortunately when I try to access the iframe object to modify it with JavaScript, I get a permission denied error.

Viewing the source of the salesforce.com page that contains my iframe, I see a doResize() method that appears it would set the height of the iframe to fit my content. Unfortunately I can't call that method from my page; it also gives me a permission denied error.

If I specify a height of 600 (for example) when I define my custom tab, the iframe has scrollbars. I could possibly be ok with that, except that if the browser window isn't tall enough, the main window also has scrollbars. So I've got double scrollbars which is very unpleasant to use. You have to scroll the main window down in order to be able to scroll the iframe all the way down.

My solution for now has been to specify an iframe height that's taller than I expect my pages to be (5000) to make sure the iframe won't have scrollbars, only the main window. The problem with that is that the user isn't taken to the top when a new page is clicked on. So if a user is at the bottom of a long page and clicks a link to go to a short page, the window doesn't automatically scroll to the top, so the user doesn't see anything on the short page, just empty space.

If I could control the main window scrollbar, I could fix that problem. But I don't have permission for that either.

At this point I'm out of ideas for what to do, so any suggestions are greatly appreciated.

For a future release, could salesforce make specifying the iframe height optional? And if you didn't specify a pixel height, the doResize() method would be called to automatically set the height?

Thanks for any advice,

=> Darla
Hello,

Our application uses the API (partner WSDL) to load an account and allow the user to update fields. I'm trying to handle all the permissions properly, to be sure I don't let a user attempt to update an account that they don't have permission for. What I'm looking for here is a comprehensive list of what I need to do, via the API, to ensure the user has permission to update the account.

The first step, as far as I can tell, is to check the updateable field in the DescribeSObject result. Then I can check the account owner and see if it's the current user. If its owned by the user and is updateable, I know the user can update the account.

But if the account isn't owned by the user, then what? What if sharing is setup as public read only? First, how can I tell if it is? And then, how do I see what group owns the account and if the user is in it? I see the AccounShare object. Does that include the user or group that owns the account? Or only those that have been granted access, other than the owner?

At least I know that with the sharing models other than public read only, if the user can view the account they can edit it. So that shouldn't cause me any trouble.

Thanks,

=> Darla
Hello,

I'm trying to use the API to set the revenue of a lead to $13000000.00, but when I load the updated lead via the UI (or query it after the update), the revenue has been set to $1.506 instead.

Here's the XML I'm sending:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sf="urn:partner.soap.sforce.com"
xmlns:sfobj="urn:sobject.partner.soap.sforce.com">
<soap:Header>
<sf:SessionHeader>
<sf:sessionId>***</sf:sessionId>
</sf:SessionHeader>
<sf:CallOptions>
<sf:client>InsideScoopCustConn/1.0</sf:client>
</sf:CallOptions>
</soap:Header>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<sf:update>
<sObjects>
<sfobj:type>lead</sfobj:type>
<sfobj:Id>00Q30000004P5IZ</sfobj:Id>
<AnnualRevenue>13000000.00</AnnualRevenue>
</sObjects>
</sf:update>
</soap:Body>
</soap:Envelope>

The problem also occurs when I create a new lead with that revenue setting. This worked fine before, and I haven't changed my code recently, so I don't know what's going on... Any ideas?

Thanks,

=> Darla
I just ran the new DescribeLayout call and was disappointed to find that web links aren't included in the results... Is this intentional or a bug? Or (hopefully) am I just missing something?

Thanks,

=> Darla
Hello,

I'm trying to count how many accounts haven't been modified since they were created. My plan was to run a query with a batch size of 1 and look at the response XML to see how many results are found. (I only need the number of accounts, not the account details).

I tried to run this query:

select Id from Account where CreatedDate = LastModifiedDate

And I get a malformed query exception. (I kind of expected that, but was hoping...)

Is there any way to accomplish this without retrieving the created date and modified date for all accounts and comparing it myself?

Thanks,

=> Darla
My setup uses some custom fields for both leads and accounts. Most were created by another user, but I created one for leads and one for accounts. When I use the describe call, not all of the custom fields are returned. Specifically, the field I created isn't being returned, but all the others are. Any ideas why this is happening or what I can do about it?

Thanks,

=> Darla