• Chitra
  • NEWBIE
  • 0 Points
  • Member since 2004

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 18
    Questions
  • 56
    Replies
I am having issues creating customer portal user using the API. Following is the sample code snippet.

Contact cc = new Contact();
    cc.FirstName = ' test';
    cc.LastName='dd';
    List <Contact> insertCon = new List<Contact> ();
    insertCon.add(cc);
    insert insertCon;
    
    User insertUser = new User();
    insertUser.Username='dddd@test.com';
    insertUser.LastName='Name';
    insertUser.Email='ddd@test.com';
    insertUser.Alias='dddd';
    insertUser.TimeZoneSidKey='America/Los_Angeles';
    insertUser.LocaleSidKey='en_US';
    insertUser.EmailEncodingKey='UTF-8';
    insertUser.ProfileId='00eT0000000e5yN';
    insertUser.LanguageLocaleKey='en_US';
    insertUser.UserRoleId='00ET0000000muU0';
    insertUser.ContactId=cc.Id;
    insertUser.isActive=true;
    List <User> insertUsers = new List<User> ();
    
    insertUsers.add(insertUser);
    
    insert insertUsers;


I am getting the following error:

System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, Invalid role assignment.


The values for profile and role IDs are from an existing customer portal user. This being the case, I am not sure why the error log indicates that there is an issue with the role assignment. If it is an issue, I don't know how to determine the correct profile and role when creating the user. Should I be looking for a specific type of role or profile?

Any help is appreciated.

Thanks,
Chitra



All,

I am trying to update Event based on certain conditions. The query result contains individual Events, Events in a Series( for eg: 00U30000003WWEbEAO) and also the Series object(for eg: 00U30000003WWEaEAO) qualified by the same conditions. They are like 2 event objects with different IDs but one is individual event in the series and other is the series object itself..!!!

So when I update them, the entire series gets updated and hence future events get updated too..

My Question is : Via the API is there a way to identify Series Event Object vs Event Object.

thanks,
Chitra
  • February 28, 2006
  • Like
  • 0
Hello All,

We have an application that parses SOAP message to extract the data. From Last week, we have been having problems with Salesforce sending random characters in the Response . It is intermitten and our application crashes for about 2 - 3 hours and starts working again. So I am guessing it is not the problem with our application as it works when the response is right.

Have any one of you have seen anything like this before? I m not sure if this is the problem with the winter release.

Thanks,
Chitra
  • January 31, 2006
  • Like
  • 0

I m trying to use the Workflow as an work around to send email of the contact which was recently modified.

I figured I could use the workflow to send an email to the Contact Owner if modified or created . Is there any way to send it to the email associated to the contact??

Thanks,
Chitra

 

 

  • August 11, 2005
  • Like
  • 0

We are trying to query for huge set of data with SOSL. As the data set is huge , it times out even before the entire set is retrieved . Org session timeout is max at 8hrs. Is there any way to kinda QueryMore into this set.

We tried the SOQL , but this is quering more than one table and the performance is bad.. So is there a way to do SOSL and retreive some small subset of data and not the entire set and still not timeout??

Thanks,

Chitra

 

  • August 09, 2005
  • Like
  • 0
Hey ..

I m trying to create a subcase migrating all the related list from the Parent Case. EmailMessage is one of those .. I m able to do it through the Java API. But I m not able to do it thru Scontrol..

What am I missing.. ??? Any Documentation on this particular obj??

Thanks,
Chitra
Hey ..

I m trying to create a subcase migrating all the related list from the Parent Case. EmailMessage is one of those .. I m able to do it through the Java API. But I m not able to do it thru Scontrol..

What am I missing.. ??? Any Documentation on this particular obj??

Thanks,
Chitra

Hey..

For the problem I had with long query string, I tried to send the data as POST instead of Get. I m trying to create a Subcase and Associate it with the parent case by creating one more SObject.

I can successfully create the Object , but I m not able to get the new ID that is created.  Does anyone know how to parse the SOAP response and extract the ID that is sent back ??

Thanks,

Chitra

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body>

<script language="javascript">
<!--
var msxml = new ActiveXObject("Msxml2.XMLHTTP.3.0");
var sessionid = "{!API_Session_ID}";
var apiServer = "{!API_Enterprise_Server_URL_50}";


var createCommand = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
createCommand += "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">";
createCommand += "<soapenv:Header>";
createCommand += "<ns1:SessionHeader soapenv:mustUnderstand=\"0\" xmlns:ns1=\"urn:enterprise.soap.sforce.com\">";
createCommand += "<ns2:sessionId xmlns:ns2=\"urn:enterprise.soap.sforce.com\">" + sessionid + "</ns2:sessionId>";
createCommand += "</ns1:SessionHeader>";
createCommand += "</soapenv:Header>";
createCommand += "<soapenv:Body>";
createCommand += "<create xmlns=\"urn:enterprise.soap.sforce.com\">";
createCommand += "<sObjects xsi:type=\"ns3:Account\" xmlns:ns3=\"urn:sobject.enterprise.soap.sforce.com\">";
createCommand += "<ns3:Name>Testing MM</ns3:Name>";
createCommand += "</sObjects>";
createCommand += "</create>";
createCommand += "</soapenv:Body>";
createCommand += "</soapenv:Envelope>";

msxml.open("POST", apiServer, false);
msxml.setRequestHeader("Content-Type","text/xml");
msxml.setRequestHeader("SOAPaction","create");
msxml.send(createCommand);
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
xmlDoc.loadXML(msxml.responseText);
xmlDoc.setProperty("SelectionNamespaces", "xmlns:sf='urn:sobject.enterprise.soap.sforce.com'");
xmlDoc.setProperty("SelectionLanguage", "XPath");
var objNodeList = xmlDoc.documentElement.selectNodes("//result/Id");
if(objNodeList!=null)
{
   var urll= objNodeList.text;
}

var returll="https://na1.salesforce.com"+urll;
window.parent.parent.location.href = returll;
//-->

</script>
</body>
</html>

Hey...

We have a scontrol which creates a sub-case. We transfer some of the fields from the parent case to the child case , one of which is the field " Description". Some of the descriptions are too long and so the Query string becomes larger than 255 and it fails.

parent.frames.location.replace("/500/e?refURL=%2F500%2Fo&cas11={!Case_Origin}&cas3={!Contact_FullName}&cas7={!Case_Status}&00N30000000le4L={!Case_Contact_Type}&cas8={!Case_Priority}&00N30000000lbE4={!Case_Event_Detail}&00N30000000j8E2={!Case_Product_Type}&cas14={!Case_Subject}&cas15={!Case_Description}&00N30000000le8n={!Case_Number}&save=x&RecordType={!Case_RecordType_ID}")

Any thoughts  on how to get this to work ???.

We need the description field completely incorporated as this is one of the most important field...

Thanks,

Chitra

 

We are having duplicate entries for the pricebook. ( this was implemented about an year back - So it still uses pricebook object and not pricebook2). We have 5 pricebooks listed where 3 are duplicates with difference Salesforce ID but same name.

When we try to change the name of pricebook based on the id, strangely it changes all the three pricebook. Somehow they seemed to be associated and they carry the same data except different salesforce ID.

Will porting it to Pricebook2 help? Or is there any way to fix this problem.

Any help is appreciated!

Thanks,

Chitra

  • February 16, 2005
  • Like
  • 0

Hello.

I m trying to reset the parent field for the Account.! I tried setting the ParentID to null. It doesnt seem to work. Is there any other way to do this?

How should I reset the Parent ID and make it point to null.

Chitra

 

  • October 06, 2004
  • Like
  • 0
Hello...
 
When I try to do a batch update ( Say I put the objects in a list and then update then together)  and if throws an exception( for what ever the reason may be). How does the update actually work.!
 
Is there a way to atleast revoke the partial update made and or returns only the IDS of the Object updated.
 
How can I find out what objects are updated???
 
I have seen this happen , when I did the batch updates. However small the batch size may be, I always got the exception and ended up in duplicates ( If I try updating the same batch again).
 
Is there any other alternate solution to push in huge amount of data.!!!
 
Thanks,
 
Chitra
 
  • September 30, 2004
  • Like
  • 0

Hello..

I m trying to get the complete list of feilds ( member variables) associated with an Object in Salesforce.

com.sforce.soap.enterprise.Field[] fields = dsor.getFields();

where dsor is of type com.sforce.soap.enterprise.DescribeSObjectResult          

This call does not return every field associated with the object. (It returned only 140 /155) . The objects that were not returned were a mix of both the custom and default fields and not even bounded by the datatype ( mix of picklist and Integer .. etc) or ownership.

Am I missing something. Do we have any other API call to return all the fields...

Thank you,

Chitra

 

We are getting a certificate error when we run the quickstart . Can anyone help?

 

Enter a menu option: 1
User name: hhh
Password: hh
; nested exception is:
        javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateExcep
tion: Could not find trusted certificate

  • April 01, 2004
  • Like
  • 0

I am trying to create opportunityLineItemSchedule..

I created the OpportunityLineItem and then used the returning ID to create the Opp Line schedule.

Though the associated product has schedule type set to "Divide" and the number of installments = 12 , when adding new opp line item schedue, I just get a single schedule with the complete value and not divided among 12 months time period.

I tried to set the OpportunityLineItem's HasRevenueSchedule Field to true. It throws up error.

How can I add Opp Line Item Schedule so that it is divided among 12 months? Should I add 12 individual schedules????

Thank you,

Chitra

 

 

  • March 25, 2004
  • Like
  • 0

Hello..

I need some help with the Scontrols - Especially with java applets

I am not sure if I am doing it right.. This is my java file

import java.applet.Applet;
import java.awt.Graphics;

public class Scontrol extends Applet
{
 public void paint(Graphics g)
 {
   g.drawString("Scontrol Sample",100,100);
 }
}

And this is my HTML file...

<HTML>
<HEAD>
<TITLE> A Simple Program </TITLE>
</HEAD>
<BODY>
<APPLET CODE="Scontrol.class" WIDTH=150 HEIGHT=100 >
</APPLET>
</BODY>
</HTML>

I uploaded the class file when I created the Scontrol.. I created the reference to this SCtrl in the Page layout too.. What am I missing...???

Where does the applet get loaded from...???

Could it be problem with the applet attributes..??? So .. I am not sure about the applet attributes that needs to be set .. Archives... Java Code Base .. etc..!! I am not sure where I am making mistake..!! ..

Thank you...

Chitra

  • March 16, 2004
  • Like
  • 0

I am totally new to Scontrols..  I am looking for any documentation on S controls. I am interested especially in using Java Applets..!!!

Thanks a lot..

Chitra

  • March 12, 2004
  • Like
  • 0

I am trying to create a new OpportunityLineItem.. I am not sure how to map the productId with the listings in the Pricebook??...

I understand from earier post that the productId gets added automatically when creating the OpportunityLineItem.. But how does it know the correct productId ..?

If not.. how to get the productId( from the pricebook????)

And what are the required fields for OpportunityLineItem..

Thanks a lot..

Chitra

  • March 10, 2004
  • Like
  • 0
I am having issues creating customer portal user using the API. Following is the sample code snippet.

Contact cc = new Contact();
    cc.FirstName = ' test';
    cc.LastName='dd';
    List <Contact> insertCon = new List<Contact> ();
    insertCon.add(cc);
    insert insertCon;
    
    User insertUser = new User();
    insertUser.Username='dddd@test.com';
    insertUser.LastName='Name';
    insertUser.Email='ddd@test.com';
    insertUser.Alias='dddd';
    insertUser.TimeZoneSidKey='America/Los_Angeles';
    insertUser.LocaleSidKey='en_US';
    insertUser.EmailEncodingKey='UTF-8';
    insertUser.ProfileId='00eT0000000e5yN';
    insertUser.LanguageLocaleKey='en_US';
    insertUser.UserRoleId='00ET0000000muU0';
    insertUser.ContactId=cc.Id;
    insertUser.isActive=true;
    List <User> insertUsers = new List<User> ();
    
    insertUsers.add(insertUser);
    
    insert insertUsers;


I am getting the following error:

System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, Invalid role assignment.


The values for profile and role IDs are from an existing customer portal user. This being the case, I am not sure why the error log indicates that there is an issue with the role assignment. If it is an issue, I don't know how to determine the correct profile and role when creating the user. Should I be looking for a specific type of role or profile?

Any help is appreciated.

Thanks,
Chitra



We currently send leads from one org to another using a custom link-  web-to-lead call (see below).
This, however only pushes the data out, leaving the custom link exposed to be pushed again on the same lead (read "duplicates").
To control we restrict use to admin(s) who, after each call, manually changes the record type to hide the link.
Can  it be set-up to both send the leads info out and then change the record type automatically.
Then the reps can send their own leads but only once.
 
Any assistance/direction would be greatly appreciated:
 
 
Hi, I am new with de partner API.
I have this basic problem, with the Enterprise API, I am used to do for example, Boolean b = mysobject.getMyBooleanField__c();
or
Double d = mysobject.getAmount();

but in the partner API, how do I get de Deserialized Values?

Thanks
Hopefully this is an easy one.  In the code below, I create a custom object (Dept) that has a one to many relationship with the contact (one Dept to many contacts).  The s-control starts from the contact and creates the new Dept with the account_id and the address information from the contact.  I use the create function on the Dynabean to create the Dept, and then retrieve the Id of the new object so I can open the record in the modal window.
 
The issue arises when I try to update the Contact record with the id of the new Dept.  I get a javascript error referencing line 3653, with the error message of "exception thrown and not caught".
 
I am pretty new to all this stuff, so I looked at the js library file for AJAX 3.3 beta and the function around line 3653 reads:
 
Sforce.Dynabean.prototype.set = function(propName, value) {
 var fldDef = this.definition.fieldMap.getItem(propName);
 var cr = this.definition.childRelationships.getItem(propName.toLowerCase());
 var rn = this.definition.parentRelationships.getItem(propName.toLowerCase());
 if (fldDef == null && cr == null && rn == null) {
  throw "The property " + propName + " is not a valid field.";
 } else {     <----- This is line 3653
  //Validate type if possible
  //TODO validate other types
  if (fldDef != null) {
   if (fldDef.type == "date" || fldDef.type == "datetime") {
    if (Sforce.Util.dltypeof(value) != "date" && Sforce.Util.dltypeof(value) != "datetime" && value != null) {
     throw "Invalid type: You passed a " + Sforce.Util.dltypeof(value) + " but the field requires a " + fldDef.type + ".";
    }
   }
  }
 
It appears that it cannot find a reference to the field I want to write back to.  The field is of type "lookup" and should reference a Dept related object.
 
Here is the section of the code where I do the update.  Thanks in advance for any help!
 
//This is where I create the new Dept
var newDeptList = new Array();

var newDept = new Sforce.Dynabean("Department__c");
newDept.set("Id","");
newDept.set("Name", name + " - " + deptPrompt );
newDept.set("Account__c", "{!Account_Id}" );
newDept.set("Legal_Entity__c", legal_entity);
newDept.set("Address__c",mailing_street);
newDept.set("City__c",mailing_city);
newDept.set("StateProvince__c",mailing_state);
newDept.set("Country__c",mailing_country);
newDept.set("Postal_Code__c",mailing_postalcode);

newDeptList[0] = newDept;

// Create new Department
results = sforceClient.Create(newDeptList);

//If the first value in the result array is null then it's a fault.

if( results[0] != null &&
results[0].success == true )
 
//Now I go to get the Id of the new dept record I created
{
// Fetch department id
newDeptId = results[0].id;


//Update the existing contact with the new Dept ID
var contactUpdateList = new Array();

var contactUpdate = new Sforce.Dynabean("contact");
contactUpdate.set("Id","{!Contact_Id}");
 
//The next line is where it fails
contactUpdate.set("NewDepartment__c",newDeptId);

contactUpdateList[0] = contactUpdate;

//Update the Contact
var resultsCon = sforceClient.update(contactUpdateList);

contactUpdateList.save();
 

Message Edited by milliskenny on 10-03-2006 01:51 AM

Hey all,
As my subject line might indicate, I am very, very inexperienced when it comes to doing any programming.  I am very comfortable with sf as a whole, but I would like to start extending myself and branching out into the world of writing s-controls and using the API's.

As an example of a project that I would like to do - setup an auto-update that would run via a batch/trigger from a local machine on a nightly basis that would truncate a contact field on a select group of contacts. 

I would also like to start learning how I can setup automated feeds - both into and out of sf.

More or less, I don't know what I don't know.  I just don't know what is possible.  And I'd like to start reading up.

Any suggestions as to where someone that is as green as I should start?

Thanks in advance,
RK
  • September 30, 2006
  • Like
  • 0
I hope this is the right forum section for this post...
 
I am trying to use Eclipse 3.2 for the development of SControls, and when I have the Update Manager fetch the toolkit from the salesforce site, I am getting the following error:
 
Requested operation cannot be performed because it would invalidate the current configuration. See details for more information.
  WST Common Core Feature (1.0.1.v200602151554) requires feature "org.eclipse.jem (1.1.0.1)", or equivalent.   org.eclipse.wst.server_core.feature (1.0.1.v200602151554) requires feature "org.eclipse.rcp (3.1.1)", or equivalent.   XML Core Feature (1.0.1.v200602151554) requires feature "org.eclipse.rcp (3.1.1)", or equivalent. ....
 
Should I uninstall Eclipse and get Version 3.1 or is there a newer toolkit coming?
 
Thx.
  • September 29, 2006
  • Like
  • 0
Hello,

Looking to have my survey results from my website pushed to Salesforce.com (similar to web-to-lead but I have created a custom object for the survey results).

Does anyone have any ideas on how to accomplish this? If its possible to develop this on my own, it would be preferred over spending money on this.

Thank you,
Michael
  • September 28, 2006
  • Like
  • 0
All,

I am trying to update Event based on certain conditions. The query result contains individual Events, Events in a Series( for eg: 00U30000003WWEbEAO) and also the Series object(for eg: 00U30000003WWEaEAO) qualified by the same conditions. They are like 2 event objects with different IDs but one is individual event in the series and other is the series object itself..!!!

So when I update them, the entire series gets updated and hence future events get updated too..

My Question is : Via the API is there a way to identify Series Event Object vs Event Object.

thanks,
Chitra
  • February 28, 2006
  • Like
  • 0
I'm new to javascript but with a little help, was able to develop an scontrol that creates a case from an asset, pre-populating some fields. I tried to include the Contact from the Asset on the new case, but I cannot find the correct id and name for the standard contact field. FYI - I used the following as an example, replacing Asset with Contact, without success: Asset_lkid={!Asset_ID}&Asset={!Asset_Name}. Here is my current script:



If anyone knows the id, or how I can get it, please let me know. Thanks in advance.
I am using partner.wsdl and am using vb.net. There is no CASE object in partner.wsdl, so how do I create a CASE.
I tried using the enterprise.wsdl, which has the CASE object, but I not to compile my code, gives me a wsdl sObject error. Please tell me how to go about creating a CASE.
Hello All,

We have an application that parses SOAP message to extract the data. From Last week, we have been having problems with Salesforce sending random characters in the Response . It is intermitten and our application crashes for about 2 - 3 hours and starts working again. So I am guessing it is not the problem with our application as it works when the response is right.

Have any one of you have seen anything like this before? I m not sure if this is the problem with the winter release.

Thanks,
Chitra
  • January 31, 2006
  • Like
  • 0
Hello,

I just generated java code from our Enterprise WSDL file using Apache Axis 1.2.1. I used the WSDL2Java utility to accomplish this.

Our program previously had no reason to access custom fields within salesforce and therefore used the SalesForce6.0.jar. Now that our program needs to work with the custom fields, I've created a jar file with the classes output from WSDL2java )run against our Enterprise WSDL), and have replaced the SalesForce6.0.jar the new one.

I'm getting some compilation errors with the new jar. The news stubs seem to have generated appropriately (I see our custom fields within the classes) however it appears that I might be missing some classes that used to be in the SalesForce6.0.jar. The missing classes are:

com.sforce.soap.enterprise._QueryOptions
com.sforce.soap.enterprise._SessionHeader
com.sforce.soap.enterprise.ID

Shouldn't these have been generated from the new WSDL? If not, any idea why?
I referred to the following post regarding clearing a date field and changed it for VB but I cannot seem to get the date field to clear.

http://forums.sforce.com/sforce/board/message?board.id=NET_development&message.id=2627&query.id=5521#M2627

Here is a subset of my test code:

'-- Create Opportunity Record
Dim objOpp As New Opportunity
objOpp.Id = sMyID
objOpp.Name = "Testing"

'-- Specify fields to null
'-- NEW CODE START
Dim aNull(1) As String
aNull(0) = "CloseDate"
aNull(1) = "Credit_Report_Date__c"

objOpp.fieldsToNull = aNull
'-- NEW CODE END

'-- Add this Opportunity to the array to send to SF
Dim aobjOpps() as sObject
aobjOpps(0) = objOpp

'-- Call Update
Dim aobjSaveResult() As SaveResult = Nothing
aobjSaveResult = myBinding.update(aobjOpps)

This is a trimmed down version of the acutal code. Everything is working just fine for updates and has been for months. I've simply attempted to add the logic to null out certain fields. Here's what happens/doesn't happen:

- The code runs without error
- The update occurs
- Save result reflects success
- The fields are not nulled

I'm sure I'm just missing something simple but I can't figure out what!

Thank you for any insight -
Lisa
While I trying to get loginId by using
sforceClient.login("{!API_Session_ID}","{!API_Partner_Server_URL_60}")

its giving error,

sforceClient is undefined.

please clear my error.

Thanks
  • November 29, 2005
  • Like
  • 0
Hi,

We are sending bulk records to salesforce using web services. The objects array is created of size 200. In this 200 records, there is a chance of having the records which is already existing in Salesforce database. Due to this duplicates occuring. Wouldn't SF check the Firstname, Lastname, address fields as key before creating new records? If not, then what is the procedure to avoid this situation. ALso most of transactions are bulk like craetign 40,000 records sometimes...
Please advice.

Thanks,