• odie
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 16
    Replies

Hi,

 

I am developing code using salesforce ws and I'm retrieving the endpoint url for purposes for redirecton in my webapp. However the SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY has a -api in it - 

 

https://na6.salesforce.com/  

 

shows up as

 

https://na6-api.salesforce.com

 

Is this always consistent. If I write code to strip out the "-api" in Java, can I bank on Salesforce to maintain that format consistent.

 

thanks,

Odie 

  • May 26, 2009
  • Like
  • 0

Hi,

 

I am querying custom objects in SF using webservices. Is there a way I can fetch only the nth batch of records from a select statement.

 

For example -there are 100 results for "select id from account order by created date". I want only results numbering 21-30.  Is there any way I can achieve this?

 

There is a limit command I can use with the select statement, but that only gives me the first n records.

 

Thanks,

Odie

  • April 22, 2009
  • Like
  • 0

Hi,

 

What is the best way of using DescribeSObjectResult to determine if a  user has access to a custom object ?

Is it that the DescribeSObject call will fail or will I get some kind of  DescribeSObjectResult which I have to play around with to determine if the user has access?

 

thanks,

Odie

  • April 21, 2009
  • Like
  • 0

Hi,

 

What is the best way of using DescribeSObjectResult to determine if a  user has access to a custom object ?

Is it that the DescribeSObject call will fail or will I get some kind of  DescribeSObjectResult which I have to play around with to determine if the user has access?

 

thanks,

Odie

  • April 21, 2009
  • Like
  • 0

Hi,

 

I am paginating on a jsp with select results from SF. Is there a way I can fetch only the nth batch of records from a select statement.

 

For example -there are 100 results for "select id from account order by created date". I want only results numbering 21-30.  Is there any way I can achieve this?

 

There is a limit command I can use with the select statement, but that only gives me the first n records.

 

Thanks,

Odie

Message Edited by odie on 04-22-2009 02:42 PM
  • March 25, 2009
  • Like
  • 0

Hi,

 

I am using WebServices to query SF and am using the SearchResult Object. I am having trouble manipulating the result Object. My search statement is as follows. Please note that I want the child object account name.

sr = binding.search("find {4083068888 OR 4083069999 OR 4083067777} in phone fields returning "+

" contact(id, phone, firstname, lastname, account.name), "+

" lead(id, phone, firstname, lastname),"+

" account(id, phone, name)");

I am using the code below to access the result values but I am unable to get the child object.

 

SearchRecord[] records = sr.getSearchRecords();

Vector contacts = new Vector();

Vector leads = new Vector();

Vector accounts = new Vector();

if (records != null && records.length > 0) {

for (int i=0;i<records.length;i++){

SObject record = records[i].getRecord();

if (record.getType().toLowerCase().equals("contact")) { contacts.add(record);

} else if (record.getType().toLowerCase().equals("lead")){ leads.add(record);

} else if (record.getType().toLowerCase().equals("account")) { accounts.add(record);

}

}

if (contacts.size() > 0) {

System.out.println("Found " + new Integer(contacts.size()).toString() + " contacts:"); for (int i=0;i<contacts.size();i++){

SObject c = (SObject)contacts.get(i);

System.out.println(c.getId() + // Id, works c.get_any()[1].getValue() + //Last Name, works

c.get_any()[2].getValue() + //First name, works c.get_any()[3].getValue()); //Account name, does NOT work. not sure how i should get the value for the Name tag out.

}

}


 Any pointers would be appreciated. How do you get a hold of child nodes in the SObject?

 

thanks,

Odie 

 

 

 

Message Edited by odie on 03-02-2009 01:35 PM
  • March 02, 2009
  • Like
  • 0

Hi,

I am using the SF Webservices API to query SF objects. I want to query Leads and Contacts by phone number and I want to return matched records. Currently, I am using 2 seperate web service queries to achieve this, but is there anyway I can achieve this in only one query?

Thanks, Odie 

  • February 27, 2009
  • Like
  • 0

Hi,

 

I am using the SF Webservices API to query SF objects. I want to query Leads and Contacts by phone number and I want to return matched records. Currently, I am using 2 seperate web service queries to achieve this, but is there anyway I can achieve this in only one query?

 

Thanks,

Odie 

  • February 27, 2009
  • Like
  • 0

Hi,

 

Can I use the AJAX Toolkit 14 outside of salesforce to make calls to retrieve Salesforce data?

 

I have a JSP page which I am hosting in our company website. I have a link to this page in an S-Control. This page uses connection.js, but I am unable to make AJAX calls to retrieve data. The same code works perfectly when placed in an S-Control directly.

 

Summarizing, my questions -

1) Can I use the AJAX Toolkit 14 outside of salesforce to make calls to retrieve Salesforce data?

2) If not, is there a work around thatwould allow me to make these calls from outside SF.

 

thanks a bunch,

Odie

  • February 04, 2009
  • Like
  • 0

Hello,
 
I am relatively new to SF. Is it possible to modify the behavior of the "Change My Password" page (Popup with message on Save button click).

  

Will Visualforce help in this regard?
 
thanks,
Odie. 

  • January 24, 2009
  • Like
  • 0

Hi,

 

Is there a way to detect a user's password change? Obviously, I do not need any sort of access to the password itself. I just need access to a flag that tells me if a person's password has been changed.

 

All help appreciated!

Thanks

Odie. 

  • January 23, 2009
  • Like
  • 0
Hi,

I am relatively new to SFDC. I have experience developing SaaS solutions that consume webservices.

I was surprised to find that SoapBindingStub does not have a logout method. The doc mentions a logout method but my stub does not have it.

Can anybody shed some light on logout and graceful session handling in SFDC web services?

Thank you very much!
Odie.
  • January 12, 2009
  • Like
  • 0

Hi,

 

What is the best way of using DescribeSObjectResult to determine if a  user has access to a custom object ?

Is it that the DescribeSObject call will fail or will I get some kind of  DescribeSObjectResult which I have to play around with to determine if the user has access?

 

thanks,

Odie

  • April 21, 2009
  • Like
  • 0

Hi,

 

I am paginating on a jsp with select results from SF. Is there a way I can fetch only the nth batch of records from a select statement.

 

For example -there are 100 results for "select id from account order by created date". I want only results numbering 21-30.  Is there any way I can achieve this?

 

There is a limit command I can use with the select statement, but that only gives me the first n records.

 

Thanks,

Odie

Message Edited by odie on 04-22-2009 02:42 PM
  • March 25, 2009
  • Like
  • 0

Hi,

 

I am using WebServices to query SF and am using the SearchResult Object. I am having trouble manipulating the result Object. My search statement is as follows. Please note that I want the child object account name.

sr = binding.search("find {4083068888 OR 4083069999 OR 4083067777} in phone fields returning "+

" contact(id, phone, firstname, lastname, account.name), "+

" lead(id, phone, firstname, lastname),"+

" account(id, phone, name)");

I am using the code below to access the result values but I am unable to get the child object.

 

SearchRecord[] records = sr.getSearchRecords();

Vector contacts = new Vector();

Vector leads = new Vector();

Vector accounts = new Vector();

if (records != null && records.length > 0) {

for (int i=0;i<records.length;i++){

SObject record = records[i].getRecord();

if (record.getType().toLowerCase().equals("contact")) { contacts.add(record);

} else if (record.getType().toLowerCase().equals("lead")){ leads.add(record);

} else if (record.getType().toLowerCase().equals("account")) { accounts.add(record);

}

}

if (contacts.size() > 0) {

System.out.println("Found " + new Integer(contacts.size()).toString() + " contacts:"); for (int i=0;i<contacts.size();i++){

SObject c = (SObject)contacts.get(i);

System.out.println(c.getId() + // Id, works c.get_any()[1].getValue() + //Last Name, works

c.get_any()[2].getValue() + //First name, works c.get_any()[3].getValue()); //Account name, does NOT work. not sure how i should get the value for the Name tag out.

}

}


 Any pointers would be appreciated. How do you get a hold of child nodes in the SObject?

 

thanks,

Odie 

 

 

 

Message Edited by odie on 03-02-2009 01:35 PM
  • March 02, 2009
  • Like
  • 0

Hi,

 

Can I use the AJAX Toolkit 14 outside of salesforce to make calls to retrieve Salesforce data?

 

I have a JSP page which I am hosting in our company website. I have a link to this page in an S-Control. This page uses connection.js, but I am unable to make AJAX calls to retrieve data. The same code works perfectly when placed in an S-Control directly.

 

Summarizing, my questions -

1) Can I use the AJAX Toolkit 14 outside of salesforce to make calls to retrieve Salesforce data?

2) If not, is there a work around thatwould allow me to make these calls from outside SF.

 

thanks a bunch,

Odie

  • February 04, 2009
  • Like
  • 0
Hi,

I am relatively new to SFDC. I have experience developing SaaS solutions that consume webservices.

I was surprised to find that SoapBindingStub does not have a logout method. The doc mentions a logout method but my stub does not have it.

Can anybody shed some light on logout and graceful session handling in SFDC web services?

Thank you very much!
Odie.
  • January 12, 2009
  • Like
  • 0
I have the following Trigger, which I want to use to update ownership of 2 custom objects (Business_Unit__c & Sub_Unit__c) when a user role changes. The role and it's corresponding BU / Sub BU are fetched and should be updated with this new UserId as the owner.
 
Code:
trigger RoleUpdateBuOwner on User (after update) {
 
 Map<ID,User> trUsersNew = Trigger.newMap;
 Map<ID,User> trUsersOld = Trigger.oldMap;
 
 Set<String> allUpdatedRoles = new Set<String>(); 
 
 Map<Id,Business_Unit__c> allBu = new Map<Id,Business_Unit__c>([SELECT Id,Name,OwnerId FROM Business_Unit__c]);
 Map<Id,Sub_Unit__c> allSubBu = new Map<Id,Sub_Unit__c>([SELECT Id,Name,OwnerId FROM Sub_Unit__c]);
 
 Integer numBuUpdated = 0;
 List<Business_Unit__c> buToUpdate = new List<Business_Unit__c>();
 for(Business_Unit__c aBu : allBu.values()) {
  for(User userWithNewRole : trUsersNew.values()) {
   if(userWithNewRole.Id != aBu.OwnerId) {
    if(userWithNewRole.Role_Name__c.contains(aBu.Name)  && userWithNewRole.Role_Name__c.contains('Plant Manager')) {
     aBu.OwnerId = userWithNewRole.Id; 
     buToUpdate.add(aBu);
     numBuUpdated++;
    }
   }  
  }
 }
  
 Integer numSubBuUpdated = 0;
 List<Sub_Unit__c> subBuToUpdate = new List<Sub_Unit__c>();
 for(Sub_Unit__c aSubBu : allSubBu.values()) {
  for(User userWithNewRole : trUsersNew.values()) {
   if(userWithNewRole.UserRoleId == null) continue;
   if(userWithNewRole.Id != aSubBu.OwnerId) {
    if(userWithNewRole.Role_Name__c.contains(aSubBu.Name) && userWithNewRole.Role_Name__c.contains('Plant Manager')) {
     aSubBu.OwnerId = userWithNewRole.Id; 
     subBuToUpdate.add(aSubBu);
     numSubBuUpdated++;
    }
   }  
  }
 }
 update subBuToUpdate;
 update buToUpdate;
 
 /*
 // For testing
 for(User thisUser : Trigger.new) {
  thisUser.addError('Updating '+numBuUpdated+' BU and '+numSubBuUpdated+' Sub BU');
 }
 */
 
}

 
Now, when I update a user role, the following error appears:
 
Code:
Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger RoleUpdateBuOwner caused an unexpected exception, contact your administrator: RoleUpdateBuOwner: execution of AfterUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a0FR00000007OWzMAM; first error: MIXED_DML_OPERATION, DML operation on setup object is not permitted after you have updated a non-setup object: DML operation on non-setup object is not supported after you have updated a setup object: Business_Unit__c: [Id]: Trigger.RoleUpdateBuOwner: line 40, column 5

 
What is wrong with my trigger (that causes this error:))?


Message Edited by Harmpie on 12-12-2008 05:35 AM
It doesn't seem to me that an "after update" trigger will fire on the User object when a user logs in even though salesforce.com must update the field LastLoginDate on this object.
 
Am I missing something?  It would seem to me that if salesforce.com is updating this field on the User record everytime a user logs in then it would also fire the "after update" trigger.
 
thanx for any clarity you can add.
 
Is there a way in Salesforce to have the ability to Search a Text Area (Long) field type?  We have a string that comes in from our website that contains 3 letter codes that are seperated a ; and ranges from 4 to 2000 charectors.  Only solution we can come up with is to either seperate the field into 8 - 10 Text Area fields or create around 500 check boxes 1 for each code.
 
Thanks in advance.

I find the solutionNote field (text area 32000) not filterable through APIs, but I would like to use this field in my WHERE clause. This is very important for me, can someone help me, please ?

Thanks,

R