• EricVlach
  • NEWBIE
  • 104 Points
  • Member since 2008

  • Chatter
    Feed
  • 2
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 19
    Replies
Hi all,

This simple question has got me stumped.  My offending snippet is:

<apex:dataTable id="itemlist" value="{!sortedChecklistItems}" var="Item">
       <apex:facet name="header"><b>Checkbox</b></apex:facet>
            <apex:inputCheckbox id="{!Item.Id}" value="{!Item.Checkbox__c}" disabled="{!Item.Not_Available__c}"  />
       </apex:column>
</apex:dataTable>

Unfortunately the id attribute is giving me trouble.  When I try to save this I get:

Save error: Unknown property 'Checklist__cStandardController.Item'

But when I remove the id attribute it all works fine, showing clearly that the Item property is perfectly valid, since I'm also using it in the value attribute.  

Is there something about the id attribute that acts differently from the other attributes?  Can I not use a merge field in that?  If not, how else can I ensure that each input item in my table gets a predictably unique ID?  Thanks.


Message Edited by werewolf on 01-08-2009 10:37 AM

You'd think I could figure this one out by myself... I'm stuck.

I have a custom report, which I'm trying to move from the 'unfiled public reports' folder to the standard 'sales' folder.

 

My sales folder is set up properly:

 

Yet I still can't select it when I try 'save as' on my custom report:

 

Suggestions, anyone? kthnx!

 

Trying to deploy 2 apex classes to my production org. One of the two has 'an error occurred on your page,' and wont let me deploy. The other passes the tests and succeeds the deployment plan. Weird part: when I try to deploy both at the same time, it tells me both of them have errors. I can't figure out what the error is. What should be my next step? Where do I find details about the 'error on the page?' how do I deploy!!?? *argg* :smileymad:

Test Deployment Results when I do only the first one:

Test Deployment Result when I do both at the same time:


When I try the second one by itself, i get the same error as above. 


Message Edited by EricVlach on 01-13-2009 03:51 PM
Bottom line: I have apex classes I want to deploy to my live org, and I see there are only two ways - using the eclipse with force.com IDE plugin, or the Migration tool. Going with the first option:

I successfully followed the first 5 instructions on this page
http://wiki.apexdevnet.com/index.php/Force.com_IDE_Installation_for_Eclipse_3.3.x : Force.com IDE Installation for Eclipse 3.3.x

On the last step number 6, I see no force.com perspective, and under open > new > other, there is nothing related to force.com. Is there something else I need to do to get started using the force.com plugin? It seems fool proof, but I'm stuck. If anyone has another, simpler way of deploying apex classes, I'm all ears!



All the updates i downloaded and installed are Enabled... so why can't I find them?

By default, the focus is set to the first available inputField. In my case, the first input is a date field. Every time I go to the page, the focus is set to that field and the calendar pops up, covering items below it.

How do I remove the auto-focus? screenshot:

 


What am I doing wrong? I am baffled...

I have a lookup field, it is required via validation (originally part of a more complex validation, but the entire thing wasn't working so I broke down the components until I found the culprit - the lookup field)

The system log shows:

*** Beginning [custom object] Validation Rule Evaluation for [record ID]
Start Time: [start time]
Rule Name: Lookup_Required
Error Condition Formula: ISNULL(Contact__c )
Value(s) Found: Contact__c=null
Result: PASS - Continue

End Time: [end time]
*** Ending [custom object] Validation Rule Evaluation for [record ID]


Why oh why is it passing!? Shouldn't ISNULL(lookup__c) return TRUE? Am i missinterpreting the ISNULL() function? Help please...
--------------------------
Edit: upon further investigation, adding NOT() to the formula returns TRUE and fails the save even when there is a value.
Test 1 - with a lookup contact:
Error Condition Formula: NOT(ISNULL( Contact__c ))
Value(s) Found: Contact__c=0037000000cxNeI
Result: FAIL - Save Prevented

Test 2 - without a lookup contact:
Error Condition Formula: NOT(ISNULL( Contact__c ))
Value(s) Found: Contact__c=null
Result: FAIL - Save Prevented



I hate to cry bug, but... bug?

Message Edited by EricVlach on 12-01-2008 12:38 PM
perl script testLogin.cgi contains a SF login call, and nothing else. When run locally from the server, (perl ./testLogin.cgi) it logs in correctly, no errors.

When run from a browser (http://mysite/cgi/testLogin.cgi) I get the following error:

500 Can't connect to www.salesforce.com:443 (Bad hostname 'www.salesforce.com') at Local/Salesforce.pm line 55

My Local::Salesforce.pm has the same login() and get_client() as WWW::Salesforce. Line 55 of my script is equivalent to line 469 in WWW::Salesforce.pm. SF_PROXY is https://www.salesforce.com/services/Soap/u/8.0. Everything looks right to me, so why does the script barf when run from the browser?

Here is testLogin.cgi:
#!/usr/bin/perl
use Local::Salesforce;
use CGI::Carp qw(fatalsToBrowser); #sends error messages to browser

my $sf = Local::Salesforce -> login('username' => 'MYUSERNAME',
                                    'password' => 'MYPASSWORD');

exit 0;




I have a custom object for which I want to override the standard 'new' button with a visualforce page.

My visualforce page is created, but when I go to override, the page isn't in the list! What step am I missing? I am baffled. This is in my developer edition.

screencast of my steps:
http://screencast.com/t/9yG27DxgouD


Message Edited by EricVlach on 11-13-2008 12:30 PM

I need suggestions from the pros - every time I start implementing a possible solution, I run into problems.

I have License object, with License Feature child object. (A software license, on which one or more license features can be added to increase the product capabilities.)

The license feature names come from a list in my controller. Here is what I would like my form to look like: (check to toggle date box)

License Name:
Feature NameExpiration Date
Feature A
Feature B
Feature C

Upon save, the License object would be created, as well as those features which are CHECKED. I can do this very easily if I code for each license feature independently. However, being the good programmer that I am, I am looking to write the code for the quickest implementation of future additional features. All I would do is add an item to a List of features, and the rest would auto-generate. Here is my latest attempt:

Page Snippet:
<apex:dataTable columns="2" value="{!AllLicenseFeatures}" var="feature">
  <apex:column>
    <apex:facet name="header">Available Features</apex:facet>
    <apex:inputCheckbox value="{!feature.name}" id="feature{!feature.name}" onChange="toggle('feature{!feature.name}Expiration')" />
  </apex:column>
  <apex:column>
    <apex:facet name="header">Expiration Date</apex:facet>
    <apex:InputField id="feature{!feature.name}Expiration" value="{!feature.Expiration_Date__c}" />
  </apex:column>
</apex:dataTable>
 

Current Problem: variable from the apex:dataTable tag is not usable in the apex:InputField or apex:InputCheckbox - it is looking for a controller class called feature, instead of using the variable.

Error messages returned by the compiler:

Error Error: id="feature{!feature.name}" core.apexpages.quickfix.QuickFixException: Unknown property 'newLicenseController.feature' Quick Fix Create Apex method 'newLicenseController.getFeature'

Error Error: Unknown property 'newLicenseController.feature'

How do I get those apex tags to refer to the dataTable variable feature, not a controller method feature!?

Controller Snippet:
List<String> feature_names = new List<String>{'Feature A','Feature B','Feature C'};
License_Feature__c[] features = new License_Feature__c[feature_names.size()];

public License_Feature__c getLicenseFeature(Integer i){
   if (features[i] == null) features[i] = new License_Feature__c();
   return features[i];
}
public License_Feature__c[] getAllLicenseFeatures() {
   integer i;
for ( i = 0; i < feature_names.size() ; i ++) { features[i] = getLicenseFeature(i); features[i].name = feature_names[i]; } return features; }
 


Message Edited by EricVlach on 09-11-2008 12:24 PM
By default, the focus is set to the first available inputField. In my case, the first input is a date field. Every time I go to the page, the focus is set to that field and the calendar pops up, covering items below it.

How do I remove the auto-focus? screenshot:

 


New to this so appologies if I'm doing something stupid.

 

Running the following:

 

use strict;
use WWW::Salesforce::Simple;


# Authenticate with the Salesforce

 

my $sforce = WWW::Salesforce::Simple->new(
        'username' => '*****',
        'password' => '*****'
) or die 'failed sf login'.$!;

my %lead=();

%lead = (
        'email' => 'testtestcom',
        'leadsource' => 'WebRegistration',
        'company' => 'TestCo',
        'country' => 'US',
        'firstname' => 'Test',
        'lastname' => 'Person'

);

my $result = $sforce->create(type => 'lead',%lead);

 

 

and get the error: 

> Missing entity type information. sObject requires a separate 'type' field be sent. at sf2.pl line 30

 

Any ideas?

 

While I'm at it, are there any decent docs on using Perl with salesforce with code examples of queries ,inserts & creates etc? There doesn't seem to be much around.

 

Thanks in advance.

 

G

Trying to deploy 2 apex classes to my production org. One of the two has 'an error occurred on your page,' and wont let me deploy. The other passes the tests and succeeds the deployment plan. Weird part: when I try to deploy both at the same time, it tells me both of them have errors. I can't figure out what the error is. What should be my next step? Where do I find details about the 'error on the page?' how do I deploy!!?? *argg* :smileymad:

Test Deployment Results when I do only the first one:

Test Deployment Result when I do both at the same time:


When I try the second one by itself, i get the same error as above. 


Message Edited by EricVlach on 01-13-2009 03:51 PM
I'm working on developing some custom-customer portal things and one of the hiccups I've found is not having the ability to remove a contact from an account once it becomes a portal user. Is this the case for you? Am I missing something here that everyone else is seeing? Any help would be greatly appreciated.

-Jesse Middleton
  • January 13, 2009
  • Like
  • 0
Bottom line: I have apex classes I want to deploy to my live org, and I see there are only two ways - using the eclipse with force.com IDE plugin, or the Migration tool. Going with the first option:

I successfully followed the first 5 instructions on this page
http://wiki.apexdevnet.com/index.php/Force.com_IDE_Installation_for_Eclipse_3.3.x : Force.com IDE Installation for Eclipse 3.3.x

On the last step number 6, I see no force.com perspective, and under open > new > other, there is nothing related to force.com. Is there something else I need to do to get started using the force.com plugin? It seems fool proof, but I'm stuck. If anyone has another, simpler way of deploying apex classes, I'm all ears!



All the updates i downloaded and installed are Enabled... so why can't I find them?

Hi

I am using visualforce and custom controller to try and extract and save information from a custom object (call it FSL) and then automatically store certain information from an FSL entry into various fields in the Case object.
So the FSL custom object would contain fields like Account and Contact that are lookups to Account and Contact entries, as well as containing other info.

And the goal is then to automatically create a Case entry that will then use the same Account Name, Contact Name, and other info from the FSL object.

So somewhere in my Class code, I would do something like:

Case c = new Case();
c.AccountID = FSL.Account;  
c.ContactID=FSL.Contact;

And one of the things that I do want to store in the Case's Description field would be a reference to how to access the FSL entry in salesforce (i.e. something like https://na0.salesforce.com/5000R00000zf)

I know that when I am writing custom button or link and I select Content Sounrce to be URL, I can extract from the
Insert fields of the custom object FSL the Detailed Link field (!FSL.Link}

But in my visualforce class, if I try to access that, it tells me that it is an invalid field Link for Sobject FSL.

That is, I can't do something like this:
c.Description='This case is based on a specific custom object FSL entry. To access it, please click on this link '+FSL.Link;


So the only way I can think of to somehow store that info in the Description field is to somehow use the PageReference
function.

In the class, we have methods like this:

public PageReference Save() {
PageReference FSLpage = new PageReference('/' +FSL.id);
.
.
}

and so the PageReferenceFSLpage is storing this info. But how to get this info to be extracted/converted into a string value so that in my code,  that I can't seem to get it working properly.

If I put in something like this in the code above:

PageReference FSLpage = new PageReference('/' +FSL.id);
String FSL_Link = FSLpage.getURL;

c.Description = 'This case is based on a specific custom object FSL entry. To access it, please click on this link '+FSL_Link;

Then what happens is that the FSL_Link will only provide just the id, and not the full url path. So the Description would contain:
This case is based on a specific custom object FSL entry. To access it, please click on this link 5000R00000zf

instead of:
This case is based on a specific custom object FSL entry. To access it, please click on this link https://na0.salesforce.com/5000R00000zf


Can someone show me how to get the complete url?
thx in advance



  • January 08, 2009
  • Like
  • 0
Hi all,

This simple question has got me stumped.  My offending snippet is:

<apex:dataTable id="itemlist" value="{!sortedChecklistItems}" var="Item">
       <apex:facet name="header"><b>Checkbox</b></apex:facet>
            <apex:inputCheckbox id="{!Item.Id}" value="{!Item.Checkbox__c}" disabled="{!Item.Not_Available__c}"  />
       </apex:column>
</apex:dataTable>

Unfortunately the id attribute is giving me trouble.  When I try to save this I get:

Save error: Unknown property 'Checklist__cStandardController.Item'

But when I remove the id attribute it all works fine, showing clearly that the Item property is perfectly valid, since I'm also using it in the value attribute.  

Is there something about the id attribute that acts differently from the other attributes?  Can I not use a merge field in that?  If not, how else can I ensure that each input item in my table gets a predictably unique ID?  Thanks.


Message Edited by werewolf on 01-08-2009 10:37 AM
By default, the focus is set to the first available inputField. In my case, the first input is a date field. Every time I go to the page, the focus is set to that field and the calendar pops up, covering items below it.

How do I remove the auto-focus? screenshot:

 


I have a visual force page (call it VS1) with a custom controller(CS1). In VS1 I have a IFrame that opens a VS page (VSsub1). VSsub1 displays inputfields tied to a custom object.

Now My VS1 page has 1 button on it called save and upon clicking it I want to save my data (using the CS1). Problem is how do reference the custom object in the iframe in my CS1. Is it even possible.

If you are wondering why i am doing this - so keep a long story short I this VS1 page is used to generate page that on runtime changes the objects it displays. its part of a wizard and its the object type is selected on the previous page. and Yes I know record type does something similar however in our case we cant use it.

Thanks.
Hello,

I am using data loader to populate a large number of person account records. One of the fields in the csv file contains a newline character to display the data on two lines. The string is in quotes and uploads fine. However, when the field (Current Plan) is displayed on the Person Account page, the newline does not get converted to a
, nor is the newline in the html source.

How can I get the data to wrap on two lines? The origin of the data is being exported from an Oracle database.

Example:

This is how it displays now:
Current Plan: Monthly Plan Dec 2008 - Jun 2009

I need the data to be displayed as:
Current Plan: Monthly Plan
Dec 2008 - Jun 2009

Thanks in advance,

Jim
So what I failed to take into account was the fact that normally on Case Submission  (on Customer Portal with the Enable Suggested Solutions on Case Submission checkbox enabled on Portal Settings) if there was a Solution that was applicable to the Case it would send the user to a page where they could view the suggested Solutions and drill into the specific Solution and Close their own Case if the Solution resolved the Case by selecting Yes the Solution was Helpful. This would close the Case.

Obviously I missed this component in building the new Case pages in Visualforce and am not sure how to include it using VF.

VF New case code looks like this:

Code:
<apex:page standardController="case" tabstyle="trouble_tickets__tab">
<apex:sectionHeader title="Trouble Tickets" subtitle="New Trouble Ticket"/>
<apex:form >
<apex:pageBlock title="New Trouble Ticket">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Submit" />
<apex:commandButton action="/p/attach/NoteAttach—pid=50080000005ulLn&retURL=%2Fui%2Fsolution%2FSolutionSuggestionPage%3Fcaseid%3D50080000005ulLn%26autoredirected%3D1" value="Submit & Add Attachment" />
<apex:commandButton action="/apex/CustomerPortalCaseHomePage" value="Cancel"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Trouble Ticket Details" columns="1">
<apex:inputField value="{!case.priority}" />
<apex:outputField value="{!case.status}">
<apex:outputText ><font style="color:red">New</font></apex:outputText>
</apex:outputField>
<apex:inputField value="{!case.subject}" style="width: 400px;"/>
<apex:inputField value="{!case.description}" style="width: 700px; height: 100px;"/>
<apex:outputField value="{!case.Resolution__c}"/>
</apex:pageBlockSection>
</apex:pageBlock>
<apex:pageBlock >
<apex:pageBlockSection >
<c:CaseQuickTipsGuideComponent />
<c:CaseAttachmentsInstructions />
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

And the URL for a Case submitted using the standard New Case page that suggests a Solution is this:

https://na6.salesforce.com/ui/solution/SolutionSuggestionPage—caseid=50080000005v4nB&autoredirected=1

 How do I build into my VF page the right code to make sure that those Cases submitted where there maybe a relevant Solution that the page redirects through to the Suggested Solutions page?


Message Edited by MATTYBME on 01-07-2009 02:28 PM
I cannot get this to work.  I can query each field seperately but together I get errors.  Can someone please
tell me what I am doing wrong?
 
 
Code:
//connect to salesforce
    $client = new SforcePartnerClient();
    $client->createConnection($wsdl);
    $loginResult = $client->login($userName, $password);


$string = "SELECT Description, (SELECT TrackingNumber__c FROM Opportunity) FROM OpportunityLineItem";

$response = $client->query($string);
$queryresult = new QueryResult($response);   

 
foreach($queryresult->records as $result)
{    

  $Description = $result->fields->Description;
  $TrackingNumber = $result->fields->TrackingNumber__c;
   
      echo "Description: " . $Description . "<br />";
      echo "Tracking Number: " . $TrackingNumber . "<br /><br /><br />";

}    

 
How can I set a password on a self service user using PHP?

I found an example in asp.net, so I know it can be done in PHP:

Thanks for any help in advanced!
I'm struggling translating the java format from the API doc to a Perl call.
I can't seem to get past the basics, spending lots of time on this. Just want to get one query to work with some pointers to the correct documentation and I'm off doing something useful.

Starting with:



use Salesforce;

my $user="bubba\@gmail.com";
my $pass="SusaniscoolRfA44QuF7I97QlJr0KEQDV2js";

my $service = new Salesforce::SforceService;
my $port = $service->get_port_binding('Soap');
$port->login('username' => $user,'password' => $pass)
|| die "Could not login to salesforce.com";

my $result = $port->query("select FirstName, LastName from Contact",100);
print "$result\n";
print "We got " . $result->valueof('//queryResponse/result/size') . " back.\n";



Returns this:



C:\Perl Files\SFDC>test.pl
1
Use of uninitialized value in concatenation (.) or string at C:\Perl Files\SFDC
test.pl line 20.
We got back.



Now this makes me quite curious where the //queryResponse/result/size is coming from. Is there a doc that explains these elements? I have not located yet.

This does not work either:


foreach my $elem ($result->valueof('//queryResponse/result/records'))
{
printf "%s, %s\n", $elem->{Id}[0],$elem->{AccountId};


And I really don't mean to be negative demonstrating all that does not work but apparently Perl is still quite challenged here.

At the end of the day, if one exists. I would like to simply insert some leads and associate a task with them so the sales folks get a nice alert. I can do this with the loader and spreadsheets but it is a pretty manual process. If you can point me to some working scripts, pretty much -anything- that actually works I would be most grateful.

I must say this is the coolest and most flexible service I have encountered, just need a little help from my friends.

Regards,

Jacksonp2008@gmail.com
perl script testLogin.cgi contains a SF login call, and nothing else. When run locally from the server, (perl ./testLogin.cgi) it logs in correctly, no errors.

When run from a browser (http://mysite/cgi/testLogin.cgi) I get the following error:

500 Can't connect to www.salesforce.com:443 (Bad hostname 'www.salesforce.com') at Local/Salesforce.pm line 55

My Local::Salesforce.pm has the same login() and get_client() as WWW::Salesforce. Line 55 of my script is equivalent to line 469 in WWW::Salesforce.pm. SF_PROXY is https://www.salesforce.com/services/Soap/u/8.0. Everything looks right to me, so why does the script barf when run from the browser?

Here is testLogin.cgi:
#!/usr/bin/perl
use Local::Salesforce;
use CGI::Carp qw(fatalsToBrowser); #sends error messages to browser

my $sf = Local::Salesforce -> login('username' => 'MYUSERNAME',
                                    'password' => 'MYPASSWORD');

exit 0;




I'm just getting started with trying to use the Salesforce API, and I will admit I don't quite understand how it all fits together yet. With my first attempt at a simple script:

Code:
#!/usr/bin/perl -w
use strict;
use WWW::Salesforce::Simple;

# Authenticate with the Salesforce API based on command line parameters.
my $sforce = WWW::Salesforce::Simple->new(
        'username' => 'x',
        'password' => 'x',
);

my %lead = (
        "type"  => "Lead",
        "Email" => 'test@test.com',
        "LeadSource" => "Web Registration",
        "Company" => "Test Co",
        "Country" => "US",
        "FirstName" => "Test",
        "LastName" => "Person",
        "web_reg_dest__c" => "http://www.test.com/",
);

my $result = $sforce->create(%lead);
if ($result->result->{"success"} eq "false") {
        print $result->result->{errors}->{message} . "\n";
}

I'm receiving the error: "Unable to find a de-serializer for the type {http://www.w3.org/2001/XMLSchema}anyURI"

I have found that if I remove the "http://" from the value of web_reg_dest__c then the lead is successfully created.




Message Edited by Kingsley on 02-08-2007 04:59 PM