• Cthulhu4242
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 5
    Replies
I would like to redirect to a Visualforce page I've created when a user saves an Opportunity, and the Opportunity is closed/won. I've written a trigger to test the logic and the new VIsualforce page, but I'm stumped on how to accomplish the redirect because apparently according to this thread: http://community.salesforce.com/sforce/board/message?board.id=apex&message.id=3321 you can't redirect from a trigger.

Does anyone have any ideas on how to accomplish this?

Thanks in advance...
Using the 1.1 PHP Toolkit (thanks, guys!), I have a lovely query which now gives me all the info I want at once. The trouble is how to access it. Here is my query and code to access it:

  Code:
$query = "SELECT Entitlement__r.Name, Id, Contact__c, Entitlement__c FROM Contact_Entitlement_Link__c where Contact__r.email = '$email'";
  $queryOptions = new QueryOptions(200);
  $response = $mySforceConnection->query(($query), $queryOptions);
  $entitlement = $response->records;

if ($entitlement) {
      foreach ($entitlement as $r) {
        $r = new SObject($r);
        .....

 

but here's where I get hazy... How do I display the info in the info in the related object?

$r->Id works great for the Id of the Contact_Entitlement_Link__c
$r->fields->Entitlement__c works great for the Id of the Entitlement__c

How do I get Entitlement__r.Name?

Thanks in advance.


Message Edited by Kingsley on 04-05-2007 04:38 PM

Ok, this one is driving me a little nutty.

I have a custom object one field of which is a lookup to a Contact. I need to be able to insert an Id into this custom field.

Unfortunately, when I get the result from my query:
$query = "SELECT ContactId FROM SelfServiceUser WHERE Id = '$sfid'";
...
return $r->fields->ContactId;

what is returned is of data type Object when what I really want is data type String. When I echo the returned value to the screen, it's the correct id, but the data type is wrong. How do I get the Id as a string?

Any clues would be appreciated.
Hi All,

I'm having difficulty figuring out how to test my trigger so that I can put it in my production environment. My trigger is simple and checks to see if a field has been changed and if so it updates another field with the current date and time like so:

trigger PIFDateUpdate on Account bulk (before update) {
for (Account an : Trigger.new) {for (Account ao : Trigger.old) {
if (an.PIF_Available_Balance__c ao.PIF_Available_Balance__c) {
an.As_of_2__c = System.Now();
}
}
}
}

However, I can't figure out how to get 75% test coverage for this. Any thoughts?
Using the 1.1 PHP Toolkit (thanks, guys!), I have a lovely query which now gives me all the info I want at once. The trouble is how to access it. Here is my query and code to access it:

  Code:
$query = "SELECT Entitlement__r.Name, Id, Contact__c, Entitlement__c FROM Contact_Entitlement_Link__c where Contact__r.email = '$email'";
  $queryOptions = new QueryOptions(200);
  $response = $mySforceConnection->query(($query), $queryOptions);
  $entitlement = $response->records;

if ($entitlement) {
      foreach ($entitlement as $r) {
        $r = new SObject($r);
        .....

 

but here's where I get hazy... How do I display the info in the info in the related object?

$r->Id works great for the Id of the Contact_Entitlement_Link__c
$r->fields->Entitlement__c works great for the Id of the Entitlement__c

How do I get Entitlement__r.Name?

Thanks in advance.


Message Edited by Kingsley on 04-05-2007 04:38 PM

Ok, this one is driving me a little nutty.

I have a custom object one field of which is a lookup to a Contact. I need to be able to insert an Id into this custom field.

Unfortunately, when I get the result from my query:
$query = "SELECT ContactId FROM SelfServiceUser WHERE Id = '$sfid'";
...
return $r->fields->ContactId;

what is returned is of data type Object when what I really want is data type String. When I echo the returned value to the screen, it's the correct id, but the data type is wrong. How do I get the Id as a string?

Any clues would be appreciated.
Just wondering about support for the new v8 API in PHP...  Is there a pre-release of the new PHP toolkit, or indeed, is Salesforce even writing one? Any timeline on it's release?

Currently we're using Person Accounts to co-ordinate our B2I records. All of our support scripts are written in PHP and I'm not overly keen on having to create a sub-set of these in JSP (or whatever).

-
Vaughan Crole


  • January 19, 2007
  • Like
  • 0