• HaroldH
  • NEWBIE
  • 25 Points
  • Member since 2004

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 28
    Questions
  • 43
    Replies
Scenario:

"User A" creates a Lead; Lead owner is User A.
"User B" attempts to convert the Lead via the API.

User A is profile: system administrator, role: higher in the hierarchy
User B is profile: standard user, role: lower in the hierarchy

Result:

LeadConvertResult[0].success = false
LeadConvertResult[0].errors[0] = "insufficient access rights on cross-reference id"

...But the lead was actually converted!

Also, the LeadConvertResult does not return the newly created OpportunityId and ContactId, even though these records have been created.

Message Edited by HaroldH on 06-30-2005 06:29 PM

Speaking of query timeouts, when I run this SOQL query using sforce explorer or any other method that uses the sforce API, I get a timeout:

SELECT Id, Name FROM Account WHERE Name='search text' OR Name='search text' OR Name='search text' OR Name='search text' OR Name='search text' OR Name='search text' OR Name='search text' OR Name='search text' OR Name='search text'

(Assume that each 'search text' is actually a unique value which corresponds to an actual account name in the system.)

The total number of Accounts in the database is 89,514.

If I run an equivalent SOSL search, the response time is very short, as expected.

Is this a problem with something I'm doing, or a performance issue with Salesforce.com?

Thanks.

Are there plans in the road map to allow custom fields on the OpportunityLineItemSchedule object?

In my case, a client would like to add another Quantity-type (double) field onto the OpportunityLineItemSchedule object.

Thanks.
I noticed that many Account fields are available for use in a web link, with the exception of AccountParentId.

Am I missing something? This would be quite useful. If it's not planned, I'll put in a request. Any thoughts on the matter?

Thanks, as usual.
While running a fairly long series of queryMore() calls, after about 17 minutes of activity (in 2000 record chunks), I received the "INVALID_QUERY_LOCATOR: invalid query locator" error.

I was using logic borrowed from the sample code illustrating the proper use of query() and queryMore(), and this code has previously been tested to run without errors.

Is it possible that the query locator/cursor expires after a period of time, or for some other reason became invalid?

Message Edited by HaroldH on 03-15-2005 02:58 PM

When a user creates a new instance of a custom object via the Salesforce.com UI, after the record is saved, the user is presented with the detail page for the newly created record.

Is it possible to make this happen after the user creates a new Task, i.e., immediately after saving the task, presenting the user with the Task detail page for the newly created Task?  Perhaps by appropriately setting retURL or some such hidden field passed via the querystring?

(Note: This does not happen when a user creates a new Task.  In this case, the user is redirected to the page he was on prior to creating the task, e.g., the Opportunity page if the user clicked "New Task" from that page.)

Message Edited by HaroldH on 02-23-2005 05:41 PM

Does Salesforce.com have plans to allow filtering on a lookup field?  I.e., when the user clicks the lookup icon on the Account edit form, the lookup is filtered by a specified record type.

Or is this question best addressed with customer support?

Thanks.

After attempting to save an sobject that contains a field with invalid data (for example, a null value on a boolean field), I get, as expected, a save results collection that contains "success=false". I also get, as expected, an errors collection for each invalid sobject.

The error object contains a statusCode property of "INVALID_TYPE_ON_FIELD_IN_RECORD", which is lovely. It even contains a message property of "MyFieldLabel: value not of required type: null", which is great.

The error object also has a fields string array, which has one element, because there is one errant field. The problem is that this element is null, rather than "MyFieldLabel". Is this not intended to contain the name of the field containing invalid data?

This is with API 5.0.

Any clues would be much appreciated.
Does Salesforce.com have plans to support custom objects in the offline edition?

If so, any thoughts as to when this will happen?

Thanks.
I can get the count of records in an sforce object by following these steps:

1. Set QueryOptions batch size to 1
2. SOQL SELECT without a WHERE clause, to return all records
3. Check queryResult.getSize() (.size property) to find the record count
(4. Reset QueryOptions to a more reasonable size, e.g., 500 or 2000.)

Does Salesforce have an opinion on this approach, i.e., is it not recommended due to the side effect of creating a QueryLocator that will go unused?

Or is there another preferred method for getting the number of records in an sforce object?
Is there a recommended approach to dealing with the presumed 2000 record limit on the result of a getDeleted call? That is, what is to be done if more than 2000 records have been deleted (from a replicateable object, of course)?

There is no getDeletedMore method.

I seem to recall this having been discussed before, but can't find it in the archives.
Picklist fields are limited to 255 characters. Is this documented anywhere, or likely to change?

Thanks.
I'm trying to re-implement the following C# code in Java, and it is not working for reasons that are almost obvious.

Using WebSphere 5.12 and the IBM WebSphere V5 Web service runtime (SOAP stack).

First, the C# code, followed by the nearly equivalent (but not quite working) Java code.

C#:
private SforceService loginWithSession(string sessionId, string serverUrl) {

SforceService sfdc = new SforceService();
sfdc.SessionHeaderValue = new SessionHeader();
sfdc.SessionHeaderValue.sessionId = sessionId;
sfdc.Url = serverUrl;
return sfdc;

}

Java:
private SoapBindingStub loginWithSession(String sessionId, String serverUrl) throws ServiceException, MalformedURLException {

SoapBindingStub soapBindingStub = (SoapBindingStub) new SforceServiceLocator().getSoap(new java.net.URL(serverUrl));

SessionHeader sessionHeader = new SessionHeader();
sessionHeader.setSessionId(sessionId);

soapBindingStub._setProperty("SessionHeader", sessionHeader);
return soapBindingStub;
}


Question 1: The "INVALID_SESSION_ID" exception is raised by the sforce service.

Question 2: I see no way to reset the endpoint URL. No Url property, and no setUrl() method in the SoapBindingStub class. Is this a problem?

I'm certain that I'm using a valid sessionId string. I am, however, running through a proxy.

I would appreciate any suggestions.

This may not be the appropriate forum for a question regarding the "sforce Explorer" application, but since we're using its "Save Schema" function--which is extremely handy, by the way--here goes. 

On the "Data Editor" tab, if you attempt to select the Product2 object, it throws the following exception: 

"Error getting data.'dataType' argument cannot be null. Parameter name: datatype"

I only see this error on an org where the Product2 object contains custom fields.  Here's a list of the custom field types.  Could the large multipicklist fields be causing the problem?

string(10) (3 of these)
textarea(255)
picklist(255)
multipicklist(4099)  (2 of these)

If we could extract the schema some other simple way, that would be great.  sforce Explorer makes it easy to do this without writing any code.  We can get similar information via the Enterprise WSDL, but it's not as detailed as the schema xml created by sforce Explorer.

Clues, suggestions?  Thanks.

Message Edited by HaroldH on 01-05-2005 01:53 PM

I'm trying to understand a bit about how objects (eg, Account, custom, etc) are allocated storage space.

For example, each time I create a new, mostly empty Account record, an additional 2KB is used, as reported in the Current Storage Usage report in Setup/Data Management/Storage Usage.

However, if I add 32KB of text into one of the Long Text Area fields on an Account record, no additional storage is indicated used in the Current Storage Usage report.

I'm working on an implementation that contains two very different "Account" types, and trying to decide whether to use the Account object with many custom fields and two record types (which would mean half of the fields in each type of Account would go unused), or whether to create a custom object for one of the account types. Data storage usage is just one consideration, but it's raised this question.

Any informed thoughts would be much appreciated.
We have a web application which works inside the Salesforce frameset. When our application needs to store data in text fields larger than the 255 character limit provided by Sforce custom fields, it uses a Document object.

Unfortunately, upon create/update by our application via the Sforce API, a link to the Document object appears in the Recent Items list when the user visits any other pages in Salesforce.com.

Is there any way to prevent this behavior? We're concerned that users will notice the items appearing in their Recent Items list, and then inadvertently go and change or delete those Documents, not realizing their intended use "behind the scenes" by our application.

Thanks.

Message Edited by HaroldH on 07-20-2004 02:54 PM

Code that previously worked is now causing an error.

When creating a Case record with API 3.0, "bad field names on insert/update call: SuppliedEmail" occurs if any SuppliedEmail is provided, even if it is a valid email address.

Update: Got the same result on API 4.0 (EAP), also on SuppliedName field. This code worked without problem as of yesterday or before.

Is it just me?

Message Edited by HaroldH on 07-09-2004 09:57 AM

This next question seems security/permission related, too.

The scenario:

1. We have a custom object, MyObject__c, which contains a Master/Detail relationship to Opportunity.

2. A user is logged in via the API, and cannot query any records from this object, even records the user created previously.

3. Changing the permissions profile for this user to Administrative Permissions/View All Data checked On will result in the query returning records, as expected.

When the Opportunity is actually created by a different user, but the OwnerId field is set to the specified user, no records are returned. When the Opportunity is actually created by the specified user, no records are returned.

If the relationship field is a Lookup type, rather than Master/Detail type, the query returns records even if "View All Data" is not checked On.

So: A user with a profile that does not have Administrative Permissions/View All Data checked On may not view records in a custom object containing a Master/Detail field. Am I missing something here?

Message Edited by HaroldH on 06-28-2004 11:29 AM

This looks like a security-related issue. I can create a Document, in a public folder, when logged into the Salesforce.com UI as a user with "Standard User" permissions. However, using the Sforce 3.0 API, I get this error message: "insufficient access rights on cross-reference id".

Now, when logged in as a user with "System Administrator" permissions, I can create a Document just as well with the API as the UI. (More precisely, as long as Profile/Administrative Permissions/Modify All Data is checked On, this user can create a new document via the API. Otherwise, the access rights error occurs.)

Note that the fields I'm including in the initial create() call are:

- FolderId
- Name
- Body
- AuthorId

Any clues?

Message Edited by HaroldH on 06-28-2004 03:16 PM

I'm running a query against a custom object, MyObject__c, which contains a custom reference field: OpportunityId__c. The intent of the query is to return the set of MyObjects which do not have null or blank OpportunityId fields.

I've tried these two queries, and neither of them work. Both queries return MyObjects containing null or blank OpportunityId reference fields.

Select Id, OpportunityId__c from MyObject__c where OpportunityId__c != ''
Select Id, OpportunityId__c from MyObject__c where OpportunityId__c != null

Is there query syntax to determine whether an ID field is empty?

Message Edited by HaroldH on 06-23-2004 12:32 PM

Scenario:

"User A" creates a Lead; Lead owner is User A.
"User B" attempts to convert the Lead via the API.

User A is profile: system administrator, role: higher in the hierarchy
User B is profile: standard user, role: lower in the hierarchy

Result:

LeadConvertResult[0].success = false
LeadConvertResult[0].errors[0] = "insufficient access rights on cross-reference id"

...But the lead was actually converted!

Also, the LeadConvertResult does not return the newly created OpportunityId and ContactId, even though these records have been created.

Message Edited by HaroldH on 06-30-2005 06:29 PM

It is possible to send email notification vai API for a newly created task.

M. Uppal

  • June 17, 2005
  • Like
  • 0

Hi folks,

Has anyone tried to build the sForce 5 SOAP messages on the fly from an XSLT using XML data from another operation?

I have tried several things but it seems that SOAP does not like xsl:value-of statements inside the type tags...

I want avoid using a programmatic method to do this if possible, although if it has to be this way I am using the JAVA platform for development.

Any thoughts or ideas would be welcome...

igs1964

Hey Guys,

I'm setting my web site up so that people who setup trial accounts through or trial page are saved as accounts in sales force. There just aren't very many examples so let me just bluntly ask the questions I've come across so far:

1) How to I create and save accounts in asp.net/vb.net ( I have succesfully attached the sforce api)

2) How do I get an existing ID programmaticaly?

Any help would be greatly appreciated.

  • May 23, 2005
  • Like
  • 0

Speaking of query timeouts, when I run this SOQL query using sforce explorer or any other method that uses the sforce API, I get a timeout:

SELECT Id, Name FROM Account WHERE Name='search text' OR Name='search text' OR Name='search text' OR Name='search text' OR Name='search text' OR Name='search text' OR Name='search text' OR Name='search text' OR Name='search text'

(Assume that each 'search text' is actually a unique value which corresponds to an actual account name in the system.)

The total number of Accounts in the database is 89,514.

If I run an equivalent SOSL search, the response time is very short, as expected.

Is this a problem with something I'm doing, or a performance issue with Salesforce.com?

Thanks.

Can we add a button next to the My Tasks "New" button to launch an external application?
I have noticed that when I do the following query:
 Select Id, Name from Account

I get some bizarre differences in the amount of time it takes for the soap call to return. More often than not, this query takes 30 seconds to a minute to return. Sometimes, though, it returns rather quickly. If I change the query to something else:
 Select Id, Name from Opportunity

I see the same quick return everytime.

Is there something different about the Account table that is slower than the rest or is there a qualification I need to add to the Account query that would help speed up the results? The Account table I am querying from has no more than 150 rows in it so I don't think it is a size issue. Any help is appreciated.

Thanks,
Corey
  • May 04, 2005
  • Like
  • 0
Are there plans in the road map to allow custom fields on the OpportunityLineItemSchedule object?

In my case, a client would like to add another Quantity-type (double) field onto the OpportunityLineItemSchedule object.

Thanks.
While running a fairly long series of queryMore() calls, after about 17 minutes of activity (in 2000 record chunks), I received the "INVALID_QUERY_LOCATOR: invalid query locator" error.

I was using logic borrowed from the sample code illustrating the proper use of query() and queryMore(), and this code has previously been tested to run without errors.

Is it possible that the query locator/cursor expires after a period of time, or for some other reason became invalid?

Message Edited by HaroldH on 03-15-2005 02:58 PM

I am trying to write a SOQL query that returns all Contacts associated with Accounts that meet a certain criteria (Type = 'Prospect')

 

Select * from Contact where AccountID = ???? where Account.Type = 'Prospect'

I'm stuck on the  part with the ???? and also not sure if I'm referencing the "type" field on Account correctly.

Any ideas?

  • February 26, 2005
  • Like
  • 0
I can get the count of records in an sforce object by following these steps:

1. Set QueryOptions batch size to 1
2. SOQL SELECT without a WHERE clause, to return all records
3. Check queryResult.getSize() (.size property) to find the record count
(4. Reset QueryOptions to a more reasonable size, e.g., 500 or 2000.)

Does Salesforce have an opinion on this approach, i.e., is it not recommended due to the side effect of creating a QueryLocator that will go unused?

Or is there another preferred method for getting the number of records in an sforce object?

Hi,

Does anyone know how to dynamically reference the field names in an Object?

I'm populating a dataset from a queryresult. The list of fields and the object it queries is built dynamically so explicity identying each field is not feasible.

For i As Integer = 0 To qResult.records.GetUpperBound(i)

con = CType(qResult.records(i), sforceDEV.Contact)

dsR("FirstName") = con.FirstName

dsT.Rows.Add(dsR)

Next

The Fieldnames in the dataset I'm constructing from a picklist, but for the example here, I've changed it to read:

 dsR("FirstName") for simplicity reasons. The area I need to populate is for each field name in "con".

 

Thanks,

RJ

 

  • February 01, 2005
  • Like
  • 0
Is there a recommended approach to dealing with the presumed 2000 record limit on the result of a getDeleted call? That is, what is to be done if more than 2000 records have been deleted (from a replicateable object, of course)?

There is no getDeletedMore method.

I seem to recall this having been discussed before, but can't find it in the archives.
Is there a way to pull records that have been moved to the Recycle Bin through the API?

We're trying to create a local copy of our Salesforce data.  We did a quick-and-dirty CSV import to get started, but everything is a varchar and we don't have any referential integrity.

How are people doing this on their local RDBMS systems?  I think I could build some "CREATE TABLE ..." strings in Java using describeSObject, but is there an easier way?  Or has someone already invented this wheel?

I'm already having problems using the 'field.getReferenceTo()' method.  It tells me that Contact.AccountId is a reference to the "Account" object, but I don't know to which field it is referring.  Of course, Contact.AccountId is a reference to Account.Id, but I don't see how to make that connection using the API.

How are you folks creating your local schema?  Is there a tool to read the enterprise.wsdl file and create ANSI SQL schema or something?

Thanks,

Adam

 

  • January 20, 2005
  • Like
  • 0
The code below runs fine and prints the ID of the newly created object, but when I look in the app, AnnualRevenue is blank!

sforce.Account newAcc = new sforce.Account();
newAcc.Name = "Test Account";
newAcc.AnnualRevenue = 10000;
sforce.SaveResult [] sr = svc.create ( new sforce.sObject[] { newAcc } );
if(sr[0].success)
{
Console.WriteLine("new id of account is {0}", sr[0].id); } else {
Console.WriteLine("error creating account {0}", sr[0].errors[0].message);
}


What's happening is that for field type's that do not support being null in .NET, the generated .NET code includes an additional property that indicates if it should send the value. Unfortuanly even if you explicitly set a value, the property that says to send the value doesn't get set. You need to also set that property as well. These properties have "Specified" appended to the property name they apply to, so the above example should be

sforce.Account newAcc = new sforce.Account();
newAcc.Name = "Test Account";
newAcc.AnnualRevenue = 10000;
newAcc.AnnualRevenueSpecified = true;
sforce.SaveResult [] sr = svc.create ( new sforce.sObject[] { newAcc } );
if(sr[0].success)
{
Console.WriteLine("new id of account is {0}", sr[0].id); } else {
Console.WriteLine("error creating account {0}", sr[0].errors[0].message); }
}

If you run this revised version, you'll see the AnnualRevenue value in the application. Properties of type DateTime, bool, int and double all have these additional specified flags.