• ColoradoMike
  • NEWBIE
  • 30 Points
  • Member since 2006

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 30
    Questions
  • 48
    Replies

Let's say you're using this bit of dynamic Apex:

 

SObject s = [SELECT accountNumber FROM account LIMIT 1];
Object o = s.get('AccountNumber');

 

I'd like to be able to determine the datatype of the generic Object o. ("String" in this case).

 

The assumption here is that the list of fields in the SOQL could vary, so I won't know at design time exactly which fields are being pulled.  It's also possible that the object from which I'm pulling may not always be Account, so I'm hoping to find a dynamic way to know the datatype of the field.

 

I suppose I could do some kind of Describe Fields on the object and then match the name listed with a Map of the DescribeFieldResults, but I'm lazy and would prefer an easier route if possible.

 

Thanks for your suggestions.

 

Mike

SObject s = [SELECT accountNumber FROM account LIMIT 1];
Object o = s.get('AccountNumber');
s.put('AccountNumber', 'abc');


I currently have the Force.com IDE version 20.0.  When I use the "Check for Updates" link, it tells me "No features found on the selected site".

 

Is there a version 21.0?  If so, how can I upgrade Eclipse to use it?

 

Thanks!

 

~~ Mike

I noticed in the Spring '10 Release Notes that the new Rich Text fields are available from the web services API.

 

My questions are:

(1) When I retrieve the contents of the field, will I get back the raw HTML or will the HTML tags be stripped out?

 

(2) What will I get in place of images that are stored in the field?  Will the API just skip the images?

 

Thanks!

Mike

A person at Salesforce suggested that I start using version 18 of the Web Services API, but from what I can tell, version 17 is the highest version I can access when I attempt to access the Partner WSDL under "Setup | Develop".

 

Is that right?  Is there any way to access version 18 even though version 17 was released with Winter '10?

I have an easy question (I hope).

 

I've created a custom controller for a VF page and another (completely separate) class.  In my controller I want to use the separate class just to instantiate an instance of that kind of object.

 

How can I refer to the other class?  Is it necessary to specify the other class in the "extensions=" parameter of my VF page?

 

For example, I just want to have this, from my custom controller:

MyClass c = new MyClass();

c.doSomething();

I can't seem to get the controller to "recognize" MyClass unless it's an extension.

I'm pretty sure the answer to my question is "yes", but let me throw it out there to see if anyone has a better recommendation.

 

I'm working on an application that will be available on the AppExchange that integrates with various Amazon Web Services.

 

Within the Apex code, I need to include my Amazon access key and encryption key into the code so it can access some resources.

 

Since the Apex code will be in a managed package, I know that the source code is not accessible by a customer, so it should be okay that I leave my access key and encryption key within the code, right?  Does anyone have a better suggestion?

 

Essentially, can I trust that the source code isn't accessible by anyone but me?

 

Mike

If I use the Translation Workbench to translate the choices from a picklist, does Salesforce save the translated value into the record?

I ask because I want to use the Data Loader to pull down a copy of my data and it looks like the values retrieved are still in English, even though in the user interface, I can see the translated value.

Any suggestions on retrieving the translated value for each record?

Mike
I'm using the API to create a record in a custom object.  The record has a dependent picklist that has a controlling field that is a checkbox field.

The dependent picklist has two choices, one of which is marked as "Default".  If the checkbox field is not checked, neither of the choices is available.

The problem is that when I create a new record, even if I don't specify a value for the picklist field, it always is set to the default value, even though the controlling field (the checkbox field) isn't checked.

Have I missed something obvious? Shouldn't there be a way to create a record with the API that conforms to the rules that are applied by the user interface?
I have a ASP.NET web application that currently uses the Partner WSDL 8.0 (ie, my Web Reference was generated from the 8.0 Partner WSDL and my users have buttons that set their server URL like this:

"serverURL={!API.Partner_Server_URL_80}"

I'm considering upgrading Web Reference in my application to the 12.0 version of the Partner WSDL, but before I do so, I wanted to get an opinion about what will happen to users that have buttons that still refer to the 8.0 WSDL.

Will their URLs still work, even though my application would have the 12.0 version? Aside from upgrading their buttons to refer to the latest version, can I programmatically alter the ServerURL to use the API.Partner_Server_URL_120?


I'm calling the Retrieve statement in which I'm grabbing quite a few fields, many of which are formula fields and lookup fields to other objects.

Lately I've been getting this error (QUERY_TOO_COMPLICATED) but the API documentation doesn't say exactly what makes the query too complicated.

Is there a hard number of calculated fields (or relationship queries) that can be included in a single Retrieve call?  Does it depend on the complexity of the formulas within the calculated fields?

If anyone can shed more details about what contributes to this error, I would be really grateful.

Mike
I've built an application that logs in to a couple of different instances of Salesforce.  For each instance, it does the typical login and setting of the SessionId into my binding object.

My trouble is that suddenly with one of my instances (a Professional Edition instance), every once in a while I'm getting:
Invalid Session ID found in SessionHeader: Session timed out

It doesn't happen every time, so I'm having a devil of a time tracking this down.

Anyone know have a suggestion as to why one might see that error sporadically?

Naturally I've triple-checked the credentials used by the application.  "Lock IP Addresses" is off and the default session timeout is set to 8 hours.

I noticed that since Spring '08 went into effect, you could edit the URL in a Custom Button and break the URL into multiple lines.  It made the appearance of the URL much easier to read.

I'm guessing that the servlet that retrieves the URL of a custom button would strip the carriage returns.

I didn't see that it was really a known "feature" of Spring '08, but hey, it was a huge improvement.

Well, it stopped working last night, and I'm wondering if Salesforce changed something about the servlet that retrieves the URLs from buttons.

If anyone at Salesforce is reading, please bring back the ability to break URLs into separate lines.
Can anyone suggest a way to access the new Personal Tags programmatically?  I'd like to access the Tags my users have set against their Contacts, for example.  I don't see anything in the API about this... thanks!
I can see that the Task Status values are accessible through the API, but I can't seem to find any way to programmatically get the Task Subject choices. 

Does anyone know whether those are available?
Anyone tried creating a new Dev instance from http://www.salesforce.com/developer ?  Last week, if I used my real email address and a new login address, it definitely didn't work, but at least with the username the same as the login name it worked.

Now, regardless of the settings, I never receive the Welcome email from Salesforce with the temporary password.

Anyone else having trouble?
Hello,

I'm trying to do a SOQL SELECT statement where I search for a number of contacts whose Accounts contain one of several search terms.  Say I want contacts from Accounts that contain "Apple" and "Pear".

What I would like to do is this, but it doesn't work:
SELECT Firstname, Lastname from Contact WHERE Contact.Account.Name LIKE '%Apple%' , '%Pear%'

I suppose I could do this (which works, but is a lot longer):
SELECT Firstname, Lastname from Contact WHERE (Contact.Account.Name LIKE '%Apple%' ) OR (C ontact.Account.Name LIKE '%Pear%').

Does anyone have any better way to use LIKE with multiple search parameters?
Thanks!
Hello,

I have a .NET based application that seems to be having performance problems and I think it may have to do with .NET's handling of threads for calling web services.

Has anyone else had .NET performance problems (in a heavily used application) or any tips regarding .NET?  Should we be using the GZip compression wrapper (found elsewhere on this site) even with .NET 2.0?

Thanks for your tips!

Mike
I have some fields placed on a page layout because I need them to be accessible to Professional Edition customers (via the API), but I really don't want the fields to be visible.

Has anyone figured out some way to hide fields from a page layout (without actually removing the fields from the page layout)?

Perhaps one idea might be to use DHTML to set the visibility of an entire section to "hidden"? Or perhaps some other idea to hide fields from the user interface?

Mike
I'm trying to do something simple... clear the value in a DateTime field.  I'm using C# and the Partner WSDL and the error I'm getting is:
"" is not a valid value for the type xsd:dateTime

Anyone have a suggestion as to how to set a DateTime field to null / empty string?

element[0] = doc.CreateElement("Invoice_Date__c");
element[0].InnerText = "";  // This causes the problem


According to the API documentation, attachments can be added to the following objects:

However, when I try to create an attachment against a Task, I get an "invalid parent" error.  Anyone have a suggestion as to how I can attach a file to a Task?

Let's say you're using this bit of dynamic Apex:

 

SObject s = [SELECT accountNumber FROM account LIMIT 1];
Object o = s.get('AccountNumber');

 

I'd like to be able to determine the datatype of the generic Object o. ("String" in this case).

 

The assumption here is that the list of fields in the SOQL could vary, so I won't know at design time exactly which fields are being pulled.  It's also possible that the object from which I'm pulling may not always be Account, so I'm hoping to find a dynamic way to know the datatype of the field.

 

I suppose I could do some kind of Describe Fields on the object and then match the name listed with a Map of the DescribeFieldResults, but I'm lazy and would prefer an easier route if possible.

 

Thanks for your suggestions.

 

Mike

SObject s = [SELECT accountNumber FROM account LIMIT 1];
Object o = s.get('AccountNumber');
s.put('AccountNumber', 'abc');


I currently have the Force.com IDE version 20.0.  When I use the "Check for Updates" link, it tells me "No features found on the selected site".

 

Is there a version 21.0?  If so, how can I upgrade Eclipse to use it?

 

Thanks!

 

~~ Mike

Hi,

 

I'm trying to create a Silverlight application to access the Salesforce API. I managed to authenticate through oAuth, but now I don't know where to go from there as I didn't find any answer in your API documentation. 

 

Thanks,

Stefan Filip

  • August 11, 2010
  • Like
  • 0

A person at Salesforce suggested that I start using version 18 of the Web Services API, but from what I can tell, version 17 is the highest version I can access when I attempt to access the Partner WSDL under "Setup | Develop".

 

Is that right?  Is there any way to access version 18 even though version 17 was released with Winter '10?

I have an easy question (I hope).

 

I've created a custom controller for a VF page and another (completely separate) class.  In my controller I want to use the separate class just to instantiate an instance of that kind of object.

 

How can I refer to the other class?  Is it necessary to specify the other class in the "extensions=" parameter of my VF page?

 

For example, I just want to have this, from my custom controller:

MyClass c = new MyClass();

c.doSomething();

I can't seem to get the controller to "recognize" MyClass unless it's an extension.


I need to acces Partner server url global variable from apex code in order to pass it into web service.

In visualforce i can write the followin statement in page layout  {!$Api.Partner_Server_URL_120} which renderes something like that https://na5.salesforce.com/services/Soap/u/12.0/461200D70000000IfeF

How can i access {!$Api.Partner_Server_URL_120}  variable from apex code?

Thanks in advance


I have a ASP.NET web application that currently uses the Partner WSDL 8.0 (ie, my Web Reference was generated from the 8.0 Partner WSDL and my users have buttons that set their server URL like this:

"serverURL={!API.Partner_Server_URL_80}"

I'm considering upgrading Web Reference in my application to the 12.0 version of the Partner WSDL, but before I do so, I wanted to get an opinion about what will happen to users that have buttons that still refer to the 8.0 WSDL.

Will their URLs still work, even though my application would have the 12.0 version? Aside from upgrading their buttons to refer to the latest version, can I programmatically alter the ServerURL to use the API.Partner_Server_URL_120?


I've built an application that logs in to a couple of different instances of Salesforce.  For each instance, it does the typical login and setting of the SessionId into my binding object.

My trouble is that suddenly with one of my instances (a Professional Edition instance), every once in a while I'm getting:
Invalid Session ID found in SessionHeader: Session timed out

It doesn't happen every time, so I'm having a devil of a time tracking this down.

Anyone know have a suggestion as to why one might see that error sporadically?

Naturally I've triple-checked the credentials used by the application.  "Lock IP Addresses" is off and the default session timeout is set to 8 hours.

I noticed that since Spring '08 went into effect, you could edit the URL in a Custom Button and break the URL into multiple lines.  It made the appearance of the URL much easier to read.

I'm guessing that the servlet that retrieves the URL of a custom button would strip the carriage returns.

I didn't see that it was really a known "feature" of Spring '08, but hey, it was a huge improvement.

Well, it stopped working last night, and I'm wondering if Salesforce changed something about the servlet that retrieves the URLs from buttons.

If anyone at Salesforce is reading, please bring back the ability to break URLs into separate lines.
Can anyone suggest a way to access the new Personal Tags programmatically?  I'd like to access the Tags my users have set against their Contacts, for example.  I don't see anything in the API about this... thanks!
I can see that the Task Status values are accessible through the API, but I can't seem to find any way to programmatically get the Task Subject choices. 

Does anyone know whether those are available?
Anyone tried creating a new Dev instance from http://www.salesforce.com/developer ?  Last week, if I used my real email address and a new login address, it definitely didn't work, but at least with the username the same as the login name it worked.

Now, regardless of the settings, I never receive the Welcome email from Salesforce with the temporary password.

Anyone else having trouble?