• THuston
  • NEWBIE
  • 82 Points
  • Member since 2009

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 20
    Replies

Hi All,

I want to do "select * from Account"

 

But as it is not possible to use * sign in query, please let me know How can I get all the field values of Account.

 

Thanks and Regards

--

Chirag Manocha

Has anyone come up with a logical way to take an aggregate SOQL like SELECT Name, MAX(Amount), MIN(Amount) FROM Opportunity GROUP BY Name and get 2001-4000... names?

 

Seems like I'd have to parse the text for the Group By * and add an Order By * to each query() and for the next batch add a Where * > [value from last row read]

However, SOQL Query text parsing is incredibly difficult and gauranteed to fail after upgrade (like the huge changes from v17 to v18).  So I need a real solution to return all the data.

Salesforce.com Partner Web Services API Version 18.0
Generated on 2010-04-07 13:35:56 +0000.

 

There is no AggregateResult in the Partner.wsdl I just generated.

 

I built it anyway and can run aggregate SOQL into a QueryResult, however the Field names are all "Double".

I'm hoping the AggregateResult class exists and has more info about the source function (MAX, MIN, AVG, ect) and Field (Ammount, ect) it was used on.

 

Any idea how to get it?  or how to get the source Field info?

How do I update the QueryResult in an SObject when I need to queryMore()?

I need to store the main SObject as my app queries and if the subSelect ! isDone then update the main SObject _any with the updated QueryResult.

 

essentially:

( (QueryResult)currentSObject.get_any()[loc].getObjectValue()).setRecords(qryR.getRecords());

 

I can't justoverwrite the ObjectValue as this throws a SOAPException

newME = existingME;
newME.setObjectValue(qryR);
newAny[loc] = newME;

 

 

Below seems to work to update the children, but then the values cannot be read back out.

The any element loses all the other settings.

 

currentSObject = getMainQueryRow(index);

MessageElement mel = sOB.get_any()[QRLocation];

if ( mel.getObjectValue().getClass().getSimpleName().equalsIgnoreCase( "QueryResult" ) ){

QueryResult qryR = (QueryResult) mel.getObjectValue();

if ( needMore ) {

//steps above are simplified to show how I got to the problem area

 

qryR = getQueryMoreQueryResult( qryR.getQueryLocator() );
MessageElement [] newAny = currentSObject.get_any();
MessageElement newME;
newME = new MessageElement("", mel.getName());
newME.setObjectValue( qryR );                                        
Element e = newME.getAsDOM();
e.removeAttribute("xsi:type");
e.removeAttribute("xmlns:ns1");
e.removeAttribute("xmlns:xsd");
e.removeAttribute("xmlns:xsi");
newME = new MessageElement(e);

                                       
newAny[QRLocation] = newME;

} }

I'm writing a parser that will extract Fields and Sobjects from a SOQL query.

 

I have a question about the syntax.

 

The BNF lists:

'FROM' UNQUALIFIEDNAME ('AS' ? UNQUALIFIEDNAME)? ('USING' UNQUALIFIEDNAME)? (PARENT_ALIAS_EXPR)*

What does the optional USING do, and look like in a query?

I can't find it in any SQL or SOQL docs and I need to be able to resolve any alias names back to the true SObject so I can get the Field's Type.

 

 

AccountQR = binding.query("select name, (select lastname from Contacts) from Account where name = 'State Street'");

 

If 'State Street' has more than batchsize-1 (199 - 1999) Contacts, then Account's QueryResult.isDone() will show FALSE.

It should be TRUE since the one and only Account SObject record has been returned.

 

Only the Contacts' QueryResult should show as incomplete.

AccountQR.getRecords()[0].get_any()[1].getObjectValue().isDone()==false

I'm working on an ODA plugin for the BIRT project.

 

The nature of the ODA requires a prepare() of the query to collect a list of fields and the field's data type before rows are read in.

 

Does there exist any Partner API that would return a sample QueryResult (metadata QR) that has no null objects?

I can't just run the query and traverse the first row.

   select name, (select status from Account.Cases) from Account

   If the first Account has no Cases, then I will never know that there is a status Field returned.

 

My only options appear to be

1) read all of the rows until there are no null SObjects then start over for the execute()

2) do a massively complex bit of String parsing to find all the Fields in the SelectClauses and then parse and match those to the intended SObject and get the dataType binding.describeSObject("SObject").getFields()[1-n].getType()

 

The first is too inefficient to consider.

The second is proving too complex.  Every time I find a query that does not work, I realize a major assumption about the syntax is invalid and must rework my whole algorithm. 

 

BTW: The BNF is incomplete.

This is not accounted for (among, I'm sure several others):

SELECT Id, Name FROM Account WHERE Id IN (SELECT AccountId FROM Opportunity )

 

 

Message Edited by THuston on 03-24-2010 07:02 AM

anyone know how to find out what edition of salesforce an org has i.e. unlimited, enterprise, professional etc..

I'm messing around with some tutorials using a developer account, and the screenshots and descriptions refer to a "plural" field.  Strangely, I do not seem to have this field.  It really doesn't seem to be a big deal, as far as the tutorials go, but I'm just curious as to why I don't have this field/where I can enable it.  I know this is a stupid and trivial question...sorry.

 

Thanks!

 

My screen looks exactly like this, except the "Plural Label" is completely non-existent, skipping straight from "Label" to "Object Name," even though the "The singular and plural labels are used in tabs, page layouts, and reports" description is there, obviously refering to a "Plural Label," I just simply don't have one.

 

Custom Object Creation

 

 

  • April 29, 2010
  • Like
  • 0

Hi All,

 

Greetings!

 

Does anybody know how to upload and validate a excel file over salesforce,

I am new in salesforce technical,  please give me some hints or directions to implement it.

 

Thank you so much!!

Eric

 

Dear Boardmembers,

 

I want to write an application that is able to make a connection with a SalesForce database.

 

I am reading the SF Api Developer docs and I am going through the walkthrough. The walkthrough tells me to create a developer account and download a WSDL from it.

 

I've created a Developer account and I've found Setup -> Developer -> API.

 

Then, when I click "Generate Enterprise WSDL", it gives me the following output:

 

Login to the Salesforce.com SOAP Api Describe an sObject Describe a number sObjects Describe the Global state Describe all the data category groups available for a given set of types Describe the data category group structures for a given set of pair of types and data category group name Describe the layout of an sObject Describe the layout of the SoftPhone Describe the tabs that appear on a users page Create a set of new sObjects Update a set of sObjects Update or insert a set of sObjects based on object id Merge and update a set of sObjects based on object id Delete a set of sObjects Undelete a set of sObjects Empty a set of sObjects from the recycle bin Get a set of sObjects Submit an entity to a workflow process or process a workitem convert a set of leads Logout the current user, invalidating the current session. Logs out and invalidates session ids Get the IDs for deleted sObjects Get the IDs for updated sObjects Create a Query Cursor Create a Query Cursor, including deleted sObjects Gets the next batch of sObjects from a query Search for sObjects Gets server timestamp Set a user's password Reset a user's password Returns standard information relevant to the current user Send outbound email Sforce SOAP API

 

Not sure what to do now. Can anybody give me some pointers so I can get started building apps for SF?

 

Thanks in advance.

 

Jay

  • April 26, 2010
  • Like
  • 0

I have a rather complicated situation and i'm not sure if this can be done in a single SOQL query and was hoping a guru here might have some insight. I need to

 

** Query All contacts that are owned by a specific user and the contact's account has at least 1 opportunity in the specified stage

 

Currently I'm

1. Querying all the contacts that are owned by a specific user 

2. Gathering all the account id's into a set

3. Querying all opportunities with the desired stage

4. Filtering out contacts where their account doesn't have any opportunities returned

 

Issue with above

A user may have many 1000's of contacts. So you cannot querying all the contacts and opportunites as you will go above 10k records returned. So you query 2000 contacts (perhaps of 9000) and all 2000 are filtered out as none are associated with an account with an opportunity in the desired stage. So you end up w/ no contacts even though there may some in the remaining 7000 un-queried contacts.

 

Is it possible to run this in a single query?

  • April 25, 2010
  • Like
  • 0

I am not sure if this is the right location to ask this question, if it isn't let me know.

 

I have a report that I generate based on location. It's a small report that probably has 5 lines in it. We have approximately 55 locations. The desire is to have the report generate via location and then email to a general mailbox (from this mailbox we will sort and deliver to the 55 locations but that's not a responsibility for SalesForce to handle, that can be done with Outlook rules). The problem is, the information can't be grouped together, because person at location 1 should not be able to see information pertaining to location 44. The limitation that I am running into is that I can only schedule 3 reports a day at my account level, but even if I were to upgrade, I would still only be able to generate 24 scheduled reports a day. I am currently looking for a work around or something to accomplish my goal. Does anyone have any suggestions?

I know how to write SQL but and having trouble with creating a join with SOQL.  I am trying to connect the Opportunitiy table with the Campaign table.  I keep getting and error about creating a custom relationship.  It says 'If youa re attempting to use a custom relationshipbe sure to append the '_r' after the custom relationship name.  The Query I am using is

 

Select o.CampaignId, o.Name (Select c.Id from Campaigns) from Opportunity o

Salesforce.com Partner Web Services API Version 18.0
Generated on 2010-04-07 13:35:56 +0000.

 

There is no AggregateResult in the Partner.wsdl I just generated.

 

I built it anyway and can run aggregate SOQL into a QueryResult, however the Field names are all "Double".

I'm hoping the AggregateResult class exists and has more info about the source function (MAX, MIN, AVG, ect) and Field (Ammount, ect) it was used on.

 

Any idea how to get it?  or how to get the source Field info?

How do I update the QueryResult in an SObject when I need to queryMore()?

I need to store the main SObject as my app queries and if the subSelect ! isDone then update the main SObject _any with the updated QueryResult.

 

essentially:

( (QueryResult)currentSObject.get_any()[loc].getObjectValue()).setRecords(qryR.getRecords());

 

I can't justoverwrite the ObjectValue as this throws a SOAPException

newME = existingME;
newME.setObjectValue(qryR);
newAny[loc] = newME;

 

 

Below seems to work to update the children, but then the values cannot be read back out.

The any element loses all the other settings.

 

currentSObject = getMainQueryRow(index);

MessageElement mel = sOB.get_any()[QRLocation];

if ( mel.getObjectValue().getClass().getSimpleName().equalsIgnoreCase( "QueryResult" ) ){

QueryResult qryR = (QueryResult) mel.getObjectValue();

if ( needMore ) {

//steps above are simplified to show how I got to the problem area

 

qryR = getQueryMoreQueryResult( qryR.getQueryLocator() );
MessageElement [] newAny = currentSObject.get_any();
MessageElement newME;
newME = new MessageElement("", mel.getName());
newME.setObjectValue( qryR );                                        
Element e = newME.getAsDOM();
e.removeAttribute("xsi:type");
e.removeAttribute("xmlns:ns1");
e.removeAttribute("xmlns:xsd");
e.removeAttribute("xmlns:xsi");
newME = new MessageElement(e);

                                       
newAny[QRLocation] = newME;

} }

I'm writing a parser that will extract Fields and Sobjects from a SOQL query.

 

I have a question about the syntax.

 

The BNF lists:

'FROM' UNQUALIFIEDNAME ('AS' ? UNQUALIFIEDNAME)? ('USING' UNQUALIFIEDNAME)? (PARENT_ALIAS_EXPR)*

What does the optional USING do, and look like in a query?

I can't find it in any SQL or SOQL docs and I need to be able to resolve any alias names back to the true SObject so I can get the Field's Type.

 

 

I am finding good salesforce developer.

 

 

Hi All,

I want to do "select * from Account"

 

But as it is not possible to use * sign in query, please let me know How can I get all the field values of Account.

 

Thanks and Regards

--

Chirag Manocha

AccountQR = binding.query("select name, (select lastname from Contacts) from Account where name = 'State Street'");

 

If 'State Street' has more than batchsize-1 (199 - 1999) Contacts, then Account's QueryResult.isDone() will show FALSE.

It should be TRUE since the one and only Account SObject record has been returned.

 

Only the Contacts' QueryResult should show as incomplete.

AccountQR.getRecords()[0].get_any()[1].getObjectValue().isDone()==false

I'm working on an ODA plugin for the BIRT project.

 

The nature of the ODA requires a prepare() of the query to collect a list of fields and the field's data type before rows are read in.

 

Does there exist any Partner API that would return a sample QueryResult (metadata QR) that has no null objects?

I can't just run the query and traverse the first row.

   select name, (select status from Account.Cases) from Account

   If the first Account has no Cases, then I will never know that there is a status Field returned.

 

My only options appear to be

1) read all of the rows until there are no null SObjects then start over for the execute()

2) do a massively complex bit of String parsing to find all the Fields in the SelectClauses and then parse and match those to the intended SObject and get the dataType binding.describeSObject("SObject").getFields()[1-n].getType()

 

The first is too inefficient to consider.

The second is proving too complex.  Every time I find a query that does not work, I realize a major assumption about the syntax is invalid and must rework my whole algorithm. 

 

BTW: The BNF is incomplete.

This is not accounted for (among, I'm sure several others):

SELECT Id, Name FROM Account WHERE Id IN (SELECT AccountId FROM Opportunity )

 

 

Message Edited by THuston on 03-24-2010 07:02 AM

I'm using the web services API to retrieve the list of the Global Objects by name using the describeGlobal() webservice call as follows:

 

DescribeGlobalResult describeGlobalResult = binding.describeGlobal();

if (!(describeGlobalResult == null)) {

types = describeGlobalResult.getTypes();

}

 

The problem is that all I get are standard objects non of the custom objects in the result.  I would very much appreciate any information that would provide an idea as to how to retrieve the list of custom objects via the web service.  Please note that I have created some custom objects in the same SalesForce instance. 

  • March 10, 2010
  • Like
  • 0
Hi there,
 
    I am new to SFDC  WebService API  integration . Can you please help  me in generating java classes  using  SFDC WSDL  file ?  I  would really appreciate if you can send  me some documentation  or some web links where I can find  some information about  generating  java classes  using WSDL
 
Thanks,
Venkat
 
  • December 05, 2006
  • Like
  • 0