• unikevin
  • NEWBIE
  • 0 Points
  • Member since 2005

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 17
    Replies
Hi,
 
I wrote some apex codes . It runs well in the developer environment,but when I deploy it into the production environment , the error message "Unable to perform save on all files: NumberFormatException: For input string" always shows up.
I write the codes with Force.com IDE.
 
Here is a sample:
 
Code:
public class CreateAccount {
 public static void verifyDealer(Account a){
  //if(UserInfo.getProfileId()=='00e20000000lJU1AAM') {
   a.addError('access denied');
  //}
 }
 
 static testMethod void test_verifyDealer(){
  Account a = new Account(Name='test');
  CreateAccount.verifyDealer(a);
 }
} 

 
Any help would be appreciated!
 
Thanks & Regards,
 
Kevin
hello ,

Is there any way to send an email and attachments in AJAX toolkits? The attachments may be a local file or an attachment stored in SFDC. I find the attachment is available in general API but the ajax toolkits doesn't support the attachment yet.What can I do?

Thanks & Regards,

Kevin
here are my codes in APEX
 
 
public class violation {
  public static void addEmail(Violation__c[] wans){

   }
}
 
 
It can be saved and run in developer environment,but when I put it into the product environment ,SFDC only generates
 
public class violation {
 
}
 
 
and removes "public static void..." without any warning in Eclipse IDE..(I'm using Force.com IDE 11.1 based on Eclipse 3.3.1)
 
why?
 
any one can help?
 
thanks,
 
Uni
we have a case with a workflow to trigger taskA, and another workflow rule saying that upon the creation of taskA, it will trigger an outbound massage.

the current result is this outbound massage is not triggered.
 
In other words, what we need to do is when closing a case there need to be a task(this part is ok) and at same time send this task to another system(say, call center) via outbound message. this does not work.
 
seems like if a task is created by workflow trigger, this very task can not trigger workflow(upon creation trigger rule) to send outbound message.
 
any idea of this situation?
 
Thanks & Regards
 
Hi ,
 
I monitor the ajax toolkits' soap data in my S-Control :
 
<se:Header xmlns:sfns="urn:partner.soap.sforce.com">
<sfns:SessionHeader>
<sessionId>WvLpEofU4BNRHwInYctpjx5OXhi9LLHWoDt7HrgFFT1YHnpvXnFwx.__xhFEmSoz.ByHtgAcUspGg3YgLWd.l.M5Yn1._1Hp1r_cVphWHeu3fM5vZFImbnTruOHNFS6Ldp4QxgCU</sessionId>
</sfns:SessionHeader></se:Header>
<se:Body>
<create xmlns="urn:partner.soap.sforce.com" xmlns:ns1="sobject.partner.soap.sforce.com">
<ns1:sObjects>
<type>CallRecord__c</type>
<MonthlyPlanDetail__c>a0S20000000FvLSEA0</MonthlyPlanDetail__c>
<Account__c>00120000004Mqp6AAC</Account__c>
<Contact__c>00320000006WrhKAAS</Contact__c>
<MonthlyPlan__c>a0R200000004Uk4EAE</MonthlyPlan__c>
<fieldsToNull>ContactInfoByUser__c</fieldsToNull>
<StartTime__c>2007-09-06T07:49:00-16:00</StartTime__c>
<EndTime__c>2007-09-06T08:49:00+08:00</EndTime__c>
</ns1:sObjects></create>
</se:Body>
</se:Envelope>
 
Please notice the red words above: "2007-09-06T07:49:00-16:00", the timezone becomes -16:00! but actually the value is "2007-09-06T07:49:00+08:00".
 
In the "https://emea.salesforce.com/soap/ajax/9.0/connection.js"  or "/10.0/connection.js"  file, I find a function "sforce.internal.dateTimeToString()" , it changed my timezone from +08:00 to -16:00 when the hour is less than 8:00 , I think there is a bug .
 
here are some sample codes:
 
new Date(2007,8,10,7,30,0) //  Mon Sep 10 07:30:00 UTC+0800 2007 . it's right 
 
sforce.internal.dateTimeToString( new Date(2007,8,10,7,30,0) ) // it becomes 2007-09-10T07:30:00-16:00 . it's wrong.
 
 
anyone can help?
 
thanks!
 
hello,
 
I got a problem: when insert/update a datetime field if the value is less than "8:00 AM GMT+8" through AJAX Toolkits,salesforce changes it into the next day.
 
for example, if the original datetime value is "08/29/2007 7:30AM GMT+8",then  the value in salesforce becomes "08/30/2007 7:30AM GMT+8".
 
This error occurs after summer release, and I didn't change my location and timezone in Salesforce's user profile.((GMT+08:00) China Standard Time (Asia/Shanghai))
 
anyone can help?
 
thanks!
hi
 
How can I find the duplicated records just like duplicated email recrods in Contact Object ?
 
thanks!
 
Hi,
 
I'm trying to send email throw Ajaxtools, but I get the error code beolw:
 
faultcode: soapenv:Client 
faultstring: Element type "this.length" must be followed by either attribute specifications, ">" or "/>".
 
 
here are some code: ( form ajax toolkit guide) 
 
var singleRequest = new sforce.SingleEmailMessage();
singleRequest.replyTo = "jsmith@acme.com";
singleRequest.subject = "sent through ajax test driver";
singleRequest.plainTextBody = "this test went through ajax";
singleRequest.toAddresses = [uni@protime.com.cn];

var sendMailRes = sforce.connection.sendEmail([singleRequest]);
 
Anyone can help me?
thanks!
 
I try to query like "select Id,IsActive,LocaleSidKey from SelfServiceUser",and catch a Exception:" INVALID_TYPE: sObject type 'SelfServiceUser' is not supported" , is there any other way I can access the SelfServiceUser object ?
 
thanks!
I am using Java toolkits for  API6 .  I try to get about 5,000 records via Sforce and it returns many duplicate records,but these records in the system are unique. it means the same record is returned several times..
 
anyone can help me? thanks.
 
the code below:
 
Code:
   boolean keepLooping = true;
   while (keepLooping) {
    for (int i = 0; i < qr.getRecords().length; i++) {
     MessageElement[] records = qr.getRecords(i).get_any();
     HashMap fields = new HashMap();
     if (qr.getRecords(i).getId() != null)
      fields.put("Id", qr.getRecords(i).getId().getValue());
     for (int j = 0; j < records.length; j++) {
      MessageElement record = records[j];
      if (!fields.containsKey(record.getName()))
       fields.put(record.getName(), record.getValue());
     }
     returnVal.add(fields);
    }
    if (qr.isDone())
     keepLooping = false;
    else
     try {
      System.out.println("************QUERYMORE*********");
      qr = binding.queryMore(qr.getQueryLocator());
     } catch (UnexpectedErrorFault e) {
      e.printStackTrace();
     } catch (InvalidQueryLocatorFault e) {
      e.printStackTrace();
     } catch (RemoteException e) {
      e.printStackTrace();
     }
   }

hi,
I am using get_any() to get the field's value,but I find when the field's value is empty, it will not in the SObject.get_any().

Is there any other way that I can get all the fields' value even though they are empty, so I can get the value like "Sobject.get('FieldName')" ?
I think it's too complex for me to generate a form manually on my website when these fields are updated in salesforce.
Can I get the object's layout and fields dynamicly in SForce?

hi,

I'm using ajax beta1 and find it works well in S-control.

But when I put it on my server and using the address eg "http://localhost:8080/test.html" , A "no permission error" occurred.

The code I using:

sforceClient.init("{!API_Session_ID}", "{!API_Partner_Server_URL_60}");

if (sforceClient.getSessionId().indexOf("!API_Session_ID") != -1)
{    
   var lr = sforceClient.Login("admin@xxx.com", "xxxx"); // error occurred here , no permission.
}
else {
...
}

The strange thing is : if I use "file:///c:/tomcat/.../test.html" to access the file, it works properly well!

so, why can't I use my own hard code account infomation to login salesforce when using "http://" prefix?

Hi,
 
I wrote some apex codes . It runs well in the developer environment,but when I deploy it into the production environment , the error message "Unable to perform save on all files: NumberFormatException: For input string" always shows up.
I write the codes with Force.com IDE.
 
Here is a sample:
 
Code:
public class CreateAccount {
 public static void verifyDealer(Account a){
  //if(UserInfo.getProfileId()=='00e20000000lJU1AAM') {
   a.addError('access denied');
  //}
 }
 
 static testMethod void test_verifyDealer(){
  Account a = new Account(Name='test');
  CreateAccount.verifyDealer(a);
 }
} 

 
Any help would be appreciated!
 
Thanks & Regards,
 
Kevin
 
Hi ,
 
I monitor the ajax toolkits' soap data in my S-Control :
 
<se:Header xmlns:sfns="urn:partner.soap.sforce.com">
<sfns:SessionHeader>
<sessionId>WvLpEofU4BNRHwInYctpjx5OXhi9LLHWoDt7HrgFFT1YHnpvXnFwx.__xhFEmSoz.ByHtgAcUspGg3YgLWd.l.M5Yn1._1Hp1r_cVphWHeu3fM5vZFImbnTruOHNFS6Ldp4QxgCU</sessionId>
</sfns:SessionHeader></se:Header>
<se:Body>
<create xmlns="urn:partner.soap.sforce.com" xmlns:ns1="sobject.partner.soap.sforce.com">
<ns1:sObjects>
<type>CallRecord__c</type>
<MonthlyPlanDetail__c>a0S20000000FvLSEA0</MonthlyPlanDetail__c>
<Account__c>00120000004Mqp6AAC</Account__c>
<Contact__c>00320000006WrhKAAS</Contact__c>
<MonthlyPlan__c>a0R200000004Uk4EAE</MonthlyPlan__c>
<fieldsToNull>ContactInfoByUser__c</fieldsToNull>
<StartTime__c>2007-09-06T07:49:00-16:00</StartTime__c>
<EndTime__c>2007-09-06T08:49:00+08:00</EndTime__c>
</ns1:sObjects></create>
</se:Body>
</se:Envelope>
 
Please notice the red words above: "2007-09-06T07:49:00-16:00", the timezone becomes -16:00! but actually the value is "2007-09-06T07:49:00+08:00".
 
In the "https://emea.salesforce.com/soap/ajax/9.0/connection.js"  or "/10.0/connection.js"  file, I find a function "sforce.internal.dateTimeToString()" , it changed my timezone from +08:00 to -16:00 when the hour is less than 8:00 , I think there is a bug .
 
here are some sample codes:
 
new Date(2007,8,10,7,30,0) //  Mon Sep 10 07:30:00 UTC+0800 2007 . it's right 
 
sforce.internal.dateTimeToString( new Date(2007,8,10,7,30,0) ) // it becomes 2007-09-10T07:30:00-16:00 . it's wrong.
 
 
anyone can help?
 
thanks!
 
hello,
 
I got a problem: when insert/update a datetime field if the value is less than "8:00 AM GMT+8" through AJAX Toolkits,salesforce changes it into the next day.
 
for example, if the original datetime value is "08/29/2007 7:30AM GMT+8",then  the value in salesforce becomes "08/30/2007 7:30AM GMT+8".
 
This error occurs after summer release, and I didn't change my location and timezone in Salesforce's user profile.((GMT+08:00) China Standard Time (Asia/Shanghai))
 
anyone can help?
 
thanks!
hi
 
How can I find the duplicated records just like duplicated email recrods in Contact Object ?
 
thanks!
 
Hello.  I'm fairly new to Salesforce and am struggling with a few things. 
 
I am trying to automatically populate a field from the Account record on the Opportunity.  Ideally it would be great if this field is updated on the Opportunity should it be changed on the Account, but that is not necessary.  I created a lookup field, but this just gives the search option, it does not auto-populate the details.  My guess is that I need to create an S-Control to accomplish my goal, but I could be wrong.  I've been searching success.salesforce and have reviewed several of the sites & tools on S-Controls, but being a novice to programming, it's not very intuitive (to me).  Is there an easier way to accomplish this?  If not, does anyone else have a similar field reference configuration?
 
Any help would be appreciated.
Thanks,
 - Mark
Hello,
 
I have a problem with embedding javascript. I want to populate a few fields when the country on an account (or lead, ...) is entered. Along with that I want to enforce a specific format for the country.
 
I have the Javascript for that, my only problem is that it is not possible to override the save button.
Does anyone of you know a workaround to that problem? Is it possible to set an onChange Eventhandler for the country text field?
 
Thanks for your help!
Hi,
 
I'm trying to send email throw Ajaxtools, but I get the error code beolw:
 
faultcode: soapenv:Client 
faultstring: Element type "this.length" must be followed by either attribute specifications, ">" or "/>".
 
 
here are some code: ( form ajax toolkit guide) 
 
var singleRequest = new sforce.SingleEmailMessage();
singleRequest.replyTo = "jsmith@acme.com";
singleRequest.subject = "sent through ajax test driver";
singleRequest.plainTextBody = "this test went through ajax";
singleRequest.toAddresses = [uni@protime.com.cn];

var sendMailRes = sforce.connection.sendEmail([singleRequest]);
 
Anyone can help me?
thanks!
Hi, I've just installed Eclipse 3.2.1 & the App Exchange Toolkit.
 
Now, when I try to create an Apex Project I get the following error message
 
"The Selected wizard could not be started."
 
Reason:
Plug-in com.appexchange.toolkit was unable to load class
com.appexchange.plugin.wizards.AppExchangeProjectWizard
 
Any help greatly appreciated!
 
Don
  • January 11, 2007
  • Like
  • 0
 
I try to query like "select Id,IsActive,LocaleSidKey from SelfServiceUser",and catch a Exception:" INVALID_TYPE: sObject type 'SelfServiceUser' is not supported" , is there any other way I can access the SelfServiceUser object ?
 
thanks!
I'm using PHP 5.1.2 with the php5-1.0.3 salesforce package and trying to update a field on a custom object that is a reference to a contact object:-

<?

require_once('soapclient/SforcePartnerClient.php');
require_once('soapclient/SforceHeaderOptions.php');

$sfcon = new SforcePartnerClient();

$soap = $sfcon->createConnection("partner.wsdl.xml");

$login = $sfcon->login("user@domain.com", "password");

$card_id = "x099000000099xxYYY";
$contact_id = "00990000009Yx9YYYY";

$fields = array
(
  "Id"=>$card_id,
  "Contact__c"=>$contact_id,
  "Status__c"=>"Active",
  "Pass_to_CA_System__c"=>true
);

$sobj = new SObject();

$sobj->fields = $fields;

$sobj->type = "CA_Card__c";

$card = $sfcon->update(array ($sobj));

?>

and I get the following error:-

Fatal error: Uncaught SoapFault exception: [soapenv:Server] org.xml.sax.SAXException: Could not find deserializer for field: Contact__c of type {urn:enterprise.soap.sforce.com}ID in /www/dev/salesforce/soapclient/SforceBaseClient.php:554 Stack trace: #0 [internal function]: SoapClient->__call('update', Array) #1 /www/dev/salesforce/soapclient/SforceBaseClient.php(554): SoapClient->update(Object(stdClass)) #2 /www/dev/salesforce/test005.php(29): SforceBaseClient->update(Array) #3 {main} thrown in /www/dev/salesforce/soapclient/SforceBaseClient.php on line 554

Contact__c is a reference to a contact record. (details from describe is at bottom of post)

If I comment out the "Contact__c"=>$contact_id, line, the record is updated...

what am I doing wrong?

Does the absence of a value for the "updateable" field indicate I don't have permission to update this field? and if yes, should this not return a different error?

info from describe:-

            [12] => stdClass Object
(
[autoNumber] =>
[byteLength] => 18
[calculated] =>
[createable] =>
[custom] => 1
[defaultedOnCreate] =>
[digits] => 0
[filterable] => 1
[label] => Contact
[length] => 18
[name] => Contact__c
[nameField] =>
[nillable] => 1
[picklistValues] =>
[precision] => 0
[referenceTo] => Contact
[restrictedPicklist] =>
[scale] => 0
[soapType] => tns:ID
[type] => reference
[updateable] =>
)

hi,
I am using get_any() to get the field's value,but I find when the field's value is empty, it will not in the SObject.get_any().

Is there any other way that I can get all the fields' value even though they are empty, so I can get the value like "Sobject.get('FieldName')" ?
I think it's too complex for me to generate a form manually on my website when these fields are updated in salesforce.
Can I get the object's layout and fields dynamicly in SForce?

hi,

I'm using ajax beta1 and find it works well in S-control.

But when I put it on my server and using the address eg "http://localhost:8080/test.html" , A "no permission error" occurred.

The code I using:

sforceClient.init("{!API_Session_ID}", "{!API_Partner_Server_URL_60}");

if (sforceClient.getSessionId().indexOf("!API_Session_ID") != -1)
{    
   var lr = sforceClient.Login("admin@xxx.com", "xxxx"); // error occurred here , no permission.
}
else {
...
}

The strange thing is : if I use "file:///c:/tomcat/.../test.html" to access the file, it works properly well!

so, why can't I use my own hard code account infomation to login salesforce when using "http://" prefix?