• Carlton Brumbelow
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 7
    Replies
My problem is very specific. I know how to make a button redirect. Here's my setup and the problem

Setup:
  • Custom visualforce page with an apex:commandButton that calls an action in my controller. 
  • Controller has the appropriate PageReference method. This works, when I have a redirect URL I can get to
  • In my custom object the 'New' button is overridden to navigate to my custom visualforce page
Problem:
  • I want the button on my visualforce page to then redirect to what would normally be the standard page for the 'New' button (when not overrideen), but I cannot find right URL for that page. When I switch the standard action back to the standard page and grabe the URL, it does not work in my code. 
I suspect the URL I'm receiving points to the page of whichever action I choose in my object. Is there a way to grab the actual ID or page reference to the standard page?
I have a custom object created for tracking bugs, but the default edit page is messy and unappealing. I have created a custom visualforce page, but when I change the "Edit" button to use the custom pages, the inline editing capability (double click a field) in the object view is turned off. Is there a way for me to have my cake and eat it too? I'd like to be able to customize my edit page AND utilize inline editing for those who don't want to transfer to an edit page.

Thanks!
HI All,

I'm running the following query in PHP
 
$query = "select Case.CaseNumber, Owner.Name from Case where Case.ID not in (select CaseComment.ParentID from CaseComment where CaseComment.CreatedDate = LAST_N_DAYS:5 OR CaseComment.LastModifiedDate = LAST_N_DAYS:7) AND Case.Status in ('Open', 'Waiting for Response', 'In Progress')";

When run in SOQLXplorer I get the results I want, but when run in PHP I can echo out Case.CaseNumber just fine, but Ower.Name gives me the following error
[Tue Feb 16 09:40:53.503974 2016] [:error] [pid 42960] [client 127.0.0.1:52997] PHP Catchable fatal error:  Object of class stdClass could not be converted to string in /Library/Server/Web/Data/Sites/Default/sf-connect/CaseComment.php on line 32
I get that Owner.Name is an object and not a string, but I've tried (string) to set the type when I echo
echo "<td>" . (string) $record->Owner.Name . "</td>";
Are there good ways to do this conversion, or would it be better if I ran an additional query to grab this name?

Here's my whole code, for context:
 
<html>
<head>
  <title>Support Engineer Case Comments</title>
</head>

<body>

<?php
define("USERNAME", "myusername");
define("PASSWORD", "mypassword");
define("SECURITY_TOKEN", "mytoken");
require_once ('/Library/Server/Web/Data/Sites/Default/sf-connect/soapclient/SforceEnterpriseClient.php');


$mySforceConnection = new SforceEnterpriseClient();
$mySforceConnection->createConnection("soapclient/enterprise.wsdl.xml");
$mySforceConnection->login(USERNAME, PASSWORD.SECURITY_TOKEN);

  $query = "select Case.CaseNumber, Owner.Name from Case where Case.ID not in (select CaseComment.ParentID from CaseComment where CaseComment.CreatedDate = LAST_N_DAYS:5 OR CaseComment.LastModifiedDate = LAST_N_DAYS:7) AND Case.Status in ('Open', 'Waiting for Response', 'In Progress')";
  $response = $mySforceConnection->query($query);

  echo "<h2>All Support Engineer cases without comments in the past 7 days";
  echo "<table>";
  foreach ($response->records as $record) {
    echo "<tr>";
      echo "<td>" . $record->CaseNumber . "</td>";
      echo "<td>" . $record->Owner.Name . "</td>";
    echo "</tr>";
  }
  echo "</table>";


?>

</body>
</html>



 
Hi, I'm trying to use an apex class to query the database and display the results on a visualforce page. The class (and page) saves without error, but nothing displays on the page when I navigate there. I'm new to this and know what's missing is likely very simple, but any help would be appreciated.

Here's the class:
public class SSReportTest {
    public String casenumber = 'JAMF-0160404';
    public List<sObject> numberList {get; set;}
    
    public List<sObject> getList() {
        numberList = Database.query('SELECT Case.Owner from Case where Case.CaseNumber = "J-0160404"');
        return numberList;

    }
}
And here is the visualforce page:
<apex:page controller="SSReportTest">
    
    <apex:pageBlock >
        {!numberList}
    </apex:pageBlock>
    
</apex:page>

Thanks everyone!
 
My problem is very specific. I know how to make a button redirect. Here's my setup and the problem

Setup:
  • Custom visualforce page with an apex:commandButton that calls an action in my controller. 
  • Controller has the appropriate PageReference method. This works, when I have a redirect URL I can get to
  • In my custom object the 'New' button is overridden to navigate to my custom visualforce page
Problem:
  • I want the button on my visualforce page to then redirect to what would normally be the standard page for the 'New' button (when not overrideen), but I cannot find right URL for that page. When I switch the standard action back to the standard page and grabe the URL, it does not work in my code. 
I suspect the URL I'm receiving points to the page of whichever action I choose in my object. Is there a way to grab the actual ID or page reference to the standard page?
I have a custom object created for tracking bugs, but the default edit page is messy and unappealing. I have created a custom visualforce page, but when I change the "Edit" button to use the custom pages, the inline editing capability (double click a field) in the object view is turned off. Is there a way for me to have my cake and eat it too? I'd like to be able to customize my edit page AND utilize inline editing for those who don't want to transfer to an edit page.

Thanks!
HI All,

I'm running the following query in PHP
 
$query = "select Case.CaseNumber, Owner.Name from Case where Case.ID not in (select CaseComment.ParentID from CaseComment where CaseComment.CreatedDate = LAST_N_DAYS:5 OR CaseComment.LastModifiedDate = LAST_N_DAYS:7) AND Case.Status in ('Open', 'Waiting for Response', 'In Progress')";

When run in SOQLXplorer I get the results I want, but when run in PHP I can echo out Case.CaseNumber just fine, but Ower.Name gives me the following error
[Tue Feb 16 09:40:53.503974 2016] [:error] [pid 42960] [client 127.0.0.1:52997] PHP Catchable fatal error:  Object of class stdClass could not be converted to string in /Library/Server/Web/Data/Sites/Default/sf-connect/CaseComment.php on line 32
I get that Owner.Name is an object and not a string, but I've tried (string) to set the type when I echo
echo "<td>" . (string) $record->Owner.Name . "</td>";
Are there good ways to do this conversion, or would it be better if I ran an additional query to grab this name?

Here's my whole code, for context:
 
<html>
<head>
  <title>Support Engineer Case Comments</title>
</head>

<body>

<?php
define("USERNAME", "myusername");
define("PASSWORD", "mypassword");
define("SECURITY_TOKEN", "mytoken");
require_once ('/Library/Server/Web/Data/Sites/Default/sf-connect/soapclient/SforceEnterpriseClient.php');


$mySforceConnection = new SforceEnterpriseClient();
$mySforceConnection->createConnection("soapclient/enterprise.wsdl.xml");
$mySforceConnection->login(USERNAME, PASSWORD.SECURITY_TOKEN);

  $query = "select Case.CaseNumber, Owner.Name from Case where Case.ID not in (select CaseComment.ParentID from CaseComment where CaseComment.CreatedDate = LAST_N_DAYS:5 OR CaseComment.LastModifiedDate = LAST_N_DAYS:7) AND Case.Status in ('Open', 'Waiting for Response', 'In Progress')";
  $response = $mySforceConnection->query($query);

  echo "<h2>All Support Engineer cases without comments in the past 7 days";
  echo "<table>";
  foreach ($response->records as $record) {
    echo "<tr>";
      echo "<td>" . $record->CaseNumber . "</td>";
      echo "<td>" . $record->Owner.Name . "</td>";
    echo "</tr>";
  }
  echo "</table>";


?>

</body>
</html>



 
Hi, I'm trying to use an apex class to query the database and display the results on a visualforce page. The class (and page) saves without error, but nothing displays on the page when I navigate there. I'm new to this and know what's missing is likely very simple, but any help would be appreciated.

Here's the class:
public class SSReportTest {
    public String casenumber = 'JAMF-0160404';
    public List<sObject> numberList {get; set;}
    
    public List<sObject> getList() {
        numberList = Database.query('SELECT Case.Owner from Case where Case.CaseNumber = "J-0160404"');
        return numberList;

    }
}
And here is the visualforce page:
<apex:page controller="SSReportTest">
    
    <apex:pageBlock >
        {!numberList}
    </apex:pageBlock>
    
</apex:page>

Thanks everyone!