• fsonnet
  • NEWBIE
  • 10 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
Hi everyone,

I can't seem to set a custom checkbox to "true" using the SOAP API with PHP.

For years we have been creating tasks through PHP using the Salesforce SOAP API (enterprise.wsdl.xml). It works fine, but now we've added a custom ckeckbox to tasks (let's call it "CustomBox__c") that I need to check under some conditions.

Problem is : I added the new field to the task sent through the SOAP API, set it to "true", but it does not work. The task is created, no error is returned and "success == true", but the checkbox is not checked.

Here's the code I'm using :
$o_Task = new stdclass();
$o_Task->WhoId = /*  */
$o_Task->WhatId = /*  */
$o_Task->OwnerId = /*  */
$o_Task->Description = /*  */
$o_Task->Type = /*  */
$o_Task->Subject = /*  */
$o_Task->Status = /*  */
$o_Task->ActivityDate = /*  */

$o_Task->CustomBox__c = true;

$o_Response = $o_SforceConnection->create(array($o_Task), 'Task');
The only difference being "$o_Task->CustomBox__c = true;"

At this point, my question would be : Why does the checkbox not update, and what should I do to achieve this ?

I made a few tests and search but nothing seems to work :
  • I found a few references (forums and blogs, few month to few years old) saying that a custom field that is not a simple Text field, but a non-text field such as Number, Checkbox or Date needs an extra step consisting in adding a field to the task object in the form of "CustomBox__cSpecified = true" in order for the CustomBox__c field to be taken into account. Unfortunately, this does not work either : I get an error "Invalid field: no such column 'CustomBox__cSpecified' on entity 'Task' [...]". Plus, I could not find any reference of this ine the Salesforce documentation.
  • For testing purpose, we also tried to create a Workflow that check the box when my user creates a task : it works fine when the task is created manually through the web interface of Salesforce, but it seems the workflow is not executed when the task is created with PHP and the SOAP API (user creating the task is the same in both cases, and owner of the task is another admin)
Have you any idea that could help me solve this ?
Hi everyone,
I'm developping an automatic email in an apex class.

I'm trying to link my email to a quote with the methode setWhatId, but it don't work with quote...

Can you help me or give me another solution plese ?

This is my code:
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
List<String> sendTo = new List<String>();
sendTo.add('XXXX@XXXX.XXX');
mail.setToAddresses(sendTo);
mail.setTargetObjectId(quote.ContactId);
mail.setReplyTo('XXXX@XXXX.XXX');
mail.setTemplateId('XXXXXXXXXXXX');
mail.setwhatid(quote.Id);
mail.setSaveAsActivity(true);
Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});

Thanks.

Hi,

I am using Custom Tab that links to pages outside of salesforce. My custom tab open in an iframe, session is lost when redirecting to another page.
Work fine in Chrome/Safari and Firefox.

 

It work like this:
Click the custome tab, that will go to an external page. This page load info from db, set session values for a user an display HTML/PHP.

After that,if the user click on a link, the session values are lost.

 

Anyone have a solution?

Hi everyone,
I'm developping an automatic email in an apex class.

I'm trying to link my email to a quote with the methode setWhatId, but it don't work with quote...

Can you help me or give me another solution plese ?

This is my code:
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
List<String> sendTo = new List<String>();
sendTo.add('XXXX@XXXX.XXX');
mail.setToAddresses(sendTo);
mail.setTargetObjectId(quote.ContactId);
mail.setReplyTo('XXXX@XXXX.XXX');
mail.setTemplateId('XXXXXXXXXXXX');
mail.setwhatid(quote.Id);
mail.setSaveAsActivity(true);
Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});

Thanks.