• Ender
  • NEWBIE
  • 95 Points
  • Member since 2003

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 72
    Replies
I have a simple visual force data grid that is trying to collect data on a single column.

This is the visual force page:
Code:
<apex:page controller="AssignSlabs" tabstyle="Orders__c">
<apex:form id="assignSlabs">
<apex:pageBlock mode="edit">
<p>This is a list of all available {!orderline.slab_color__r.Name} slabs for 
{!orderline.order__r.Name}. This order line requires {!quantityRemaining}  
more slabs to complete the order of {!orderQuantity} slabs.</p>
<p/>
<br/>
<apex:pageblockSection id="Slabs">
   <apex:pageblocktable align="center" value="{!slabs}" var="slab" title="Slabs" width="100%">
         <apex:column headerValue="Slab" width="15%"><apex:outputLink value="/{!slab.ID}">{!slab.Name}</apex:outputlink></apex:column>
         <apex:column headerValue="Status" width="15%" value="{!slab.Status__c}"/>
         <apex:column headerValue="Quality Rating" width="20%" value="{!slab.Quality_Rating__c}"/>
         <apex:column headerValue="Finished Date" width="10%" value="{!slab.Finished_Date__c}"/>
         <apex:column headerValue="Comments" width="30%" value="{!slab.Comments__c}"/>
         <apex:column headerValue="Assign Slab—" width="10%"><apex:inputfield value="{!slab.Assigned__c}"/></apex:column>
   </apex:pageblockTable>
</apex:pageblockSection>
<p/>
<apex:pageBlockSection id="Status">
   <apex:commandButton action="{!assign}" value="Assign Slabs" rerender="Status" id="assignSlabsButton"/>
   <apex:commandButton action="{!cancel}" value="Cancel" id="cancelButton"/>
   <apex:outputLabel value="{!errormessage}"></apex:outputLabel>
</apex:pageblockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

This is the controller:

Code:
global class AssignSlabs {
    List<Slab__c> slabs;
    Order_Line__c orderline;
    Integer orderQuantity;
    Integer quantityRemaining;
    String errormessage;
    String testMessage;
    List<String> headers;
    
    public AssignSlabs() {
        slabs = getSlabs();
        orderline = getOrderLine();
        quantityRemaining = getQuantityRemaining();
        orderQuantity = getOrderQuantity();
        headers = getHeaders();
    }
    
    public List<Slab__c> getSlabs() {
        List <Slab__c> slabs = [
            select Name, comments__c, slab_color__c, status__c, 
                finished_date__c, assigned__c, order_line__c, 
                quality_rating__c from slab__c
            where slab_color__c = :ApexPages.currentPage().getParameters().get('slabcolor') 
                AND Order_Line__c = NULL 
            order by slab_color__c, finished_date__c];
        return slabs;
    }

    public Order_Line__c getOrderLine() {
        Order_Line__c orderline = [
            select id, slab_color__r.Name, Order__r.Name, quantity__c, assigned__c 
            from order_line__c 
            where id = :ApexPages.currentPage().getParameters().get('olid')]; 
        return orderLine;
    }
    
    public Integer getQuantityRemaining() {
        Integer QuantityRemaining = 0;
        orderline.assigned__c = [select count() 
            from slab__c 
            where order_line__c = :ApexPages.currentPage().getParameters().get('olid')];
        quantityRemaining = orderLine.quantity__c.intValue() - orderline.assigned__c.intValue();
        return quantityRemaining;
    }
    
    public Integer getOrderQuantity() {
        Integer OrderQuantity = 0;
        orderQuantity = orderline.quantity__c.intValue();
        return orderQuantity;
    }
    
    public string[] getheaders() { 
         return new string [] 
              {'Slab','Status','Quality Rating','Finished Date', 
               'Comments', 'Assign Slab —'} ; 
    }    

    public String geterrorMessage() {
        return errormessage;
    }

    public PageReference assign(){ 
        Integer entries = slabs.size();
        Integer assigned = 0; // integer must be initialized or it will be null
        Boolean isError = false;
        PageReference orderlinepage = new PageReference('/' + orderLine.id);
        PageReference assignSlabs = new PageReference('/apex/AssignSlabs');                
        
        for (Integer e = 0; e < entries; e++){
            if (slabs[e].assigned__c) {
                slabs[e].order_line__c = orderline.ID;
                assigned++;
            }
        }
        if (assigned <= quantityremaining) {
                // update slab records
            try {
                update slabs;
            } catch(System.DMLException e) {
                isError = true;
                ApexPages.addMessages(e);
            }
                // update assigned count in orderline record
            orderline.assigned__c = [select count() 
                from slab__c 
                where order_line__c = :ApexPages.currentPage().getParameters().get('olid')];
            try {
                update orderline;
            } catch(System.DMLException e) {
                isError = true;
                ApexPages.addMessages(e);
                
            }
            
            return (isError) – assignSlabs:orderlinepage;
        }
        else {
            errormessage = 'You have selected too many slabs for assignment.  Your selections would assign ' + assigned + ' slabs to this order, which only requires ' + quantityRemaining + ' slabs.';
            return assignSlabs;
        }
 
    } 
        

    public PageReference cancel() {
        PageReference orderlinepage = new PageReference('/' + orderline.id);
        return orderlinepage;
    }
}

 
For whatever, reason, the data is never written back.

This used to work with a pageBlockList, but this tag is no longer available.

Also, the pageBlockTable seems to ignore all column width information.

Ideas ?
I need to show a outputPanel depending on some clause.

IF(errorExists)
{
    <apex:pageBlockSection>
        <apex:outputText style="font-style:italic;font-weight:bold;color:red" value="{!error.errorDescription}"/>
    </apex:pageBlockSection>
}
else
{
    //show something else
}

How do I do this in VisualForce Page? Also the errorExists has to be read from the custom controller. Something like IF({!error.errorExists})???

Please help?
Is there a way to have the Data Loader (9.0) export records that have been marked for deletion (moved to the recycle bin)?
I have a batch Data Loader process that I want to create that should extract Event records from Salesforce based on the last run date of the process.  I have read through the Data Loader documentation and see that you can use @process.lastRunDate@ in the SQL Configuration, but how would I do something similar using SOQL?

When I attempt to use something like 'SELECT Id, Subject, ... FROM Event WHERE CreatedDate > @process.lastRunDate@' in the sfdc.extractionSOQL property, it throws a MalformedQueryFault error at the @ symbol.

Any recommendations on how I can write a SOQL statement for the batch process so that only records created after the last run date are retrieved?

How can i get distinct elements from the database? Does SOQL not provide something like unique or distinct?
I've been using the Force.com IDE since it was called the Apex plugin for Eclipse.  Today I had some trouble on it on Eclipse 3.2, so I got a brand new, clean copy of Eclipse 3.3.1.1 and installed it.  I fired up Eclipse 3.3 and installed the Force.com toolkit with its dependency (WST or whatever it was).  Everything seemed to go well.  Eclipse restarted itself.

Upon restart, though, I could see no trace of the Force.com IDE.  There was no way to create an Apex (or Force.com) project.  There is no Force.com perspective.  Everything seems to be MIA.  Meanwhile, if I go up to Help->Manage Configuration, the Force.com IDE is listed there and seems to think that it is installed properly.

I have tried disabling it, cleaning it out and reinstalling, but to no avail -- upon my second installation (which also appeared to go well), there were no Force.com items available upon restart.

What gives here?  Has anyone had this issue before, and if so, how did you fix it?
Is there a way to have a button on a page lay-out or in a list view execute Apex code without requiring an s-control to launch it?  I have the s-control approach working already.  I'd just prefer not to have a window pop open.


Message Edited by dkorba2k5 on 02-15-2008 04:28 PM
Hello- I'm new to Salesforce, an experienced developer otherwise.
I have been provided with a Salesforce account with a simple list of customers in it, and a report I'd like to get the contents of (built by someone else)

I now have Perl Salesforce::Simple working, connecting to the account, and listing some fundemental objects. ( I don't know what they mean yet!) I'd like to execute this report and recieve the result back.

The way Salesforce::Simple works is that it just wraps a SOQL query. Some type information is there, but I dont have to deal with it if I don't have to... Far, far simpler than the whole SOAP/WSDL model.

shortest route from A to B?

thanks in advance
 -Brian

I know it is possible to take a manual data export from salesforce, and that once a week an automatic data export is stored by salesforce.

I was wondering if it were possible to export the entire structure definition of my account as well.  This would help in cases where accidental damage was done to our structure - such as a necessary object being deleted etc.  We would be able to quickly return the structure and data to a previous state.

Given our current setup it would take a year to recreate the structure of salesforce before we could even start to import our data back in. 

I read Bretts answer to a similar qn in 2005, and he suggested using DBAMP to export to SQL SERVER, but
1) it is costly
2) it only seems to be the data tables that are linked and not the structure definition
3) i do not think this is really a backup tool.

as an example..  SQL has a flat file export of all database structure, which allows for a 10 second recreation should we have a problem with the database.
Hello all. New data loader user here.

I am trying to import 1000 leads into salesforce, and I'm using data loader so that I can specify them to a specific record type (titled: "Instant Networks Lead")
I created a column in my csv called record type, and put Instant Networks Lead in each row. I then mapped that column to Lead Record Type.
Upon import, however, I get the following error message: Record Type ID: id value of incorrect type: Instant Networks Lead
and then NONE of my leads are successfully imported.
How can I get this to work in my favor? PLEASE HELP ME SOMEONE! The salesforce helpdesk said they cannot provide me with ApEx assisstance, they could only refer to sforce.com.

Thank you - I will bake brownies for the person who guides me along, as I am under a deadline to get these leads in!!!!

Thank you again, Melyssa
  • November 09, 2006
  • Like
  • 0
Hi,
 
Trying to upload Data using the Sforce Data loader GUI.
using  the 30 day trial- user login details, in the GUI open screen, an Java Connection Exception message is getting displayed.
 
are there any settings to be made to the config parameter file before using the GUI tool? are there any restriction on trial accounts?
 
 
current config file
 

Username=

password=

outputError=

extractionSOQL=

extractionRequestSize=500

username=

endpoint=

extractionTarget=

mappingFile= operation=inserts

entity=Contact

assignmentRule=

dataAccessObject=bugstestexport.csv

batchSize=200

lastBatchRow=0

outputSuccess=opsuccess.csv        

rowToStartAt=0

outputDirectory=

insertNulls=false

  • November 06, 2006
  • Like
  • 0
Hi,
 
I am using the CLI of Appexchange data loader and i am getting the below error. I am using java version 1.4.2_08. What is required to fix this issue. Also if i upgrade the jvm to 1.5 then i get a error message saying that the data loader needs version 1.4.
 
Please advise
 
C:\config>java -jar sforcedataloader.jar
2006-10-19 14:04:14,204 INFO  [main] controller.LoaderController initConfig (LoaderController.java:287) - The log has be
en initialized
2006-10-19 14:04:14,220 INFO  [main] LoaderEngineRunner main (LoaderEngineRunner.java:78) - Initializing engine
2006-10-19 14:04:14,220 INFO  [main] LoaderEngineRunner main (LoaderEngineRunner.java:85) - Loading parameters
2006-10-19 14:04:14,220 INFO  [main] LoaderEngineRunner main (LoaderEngineRunner.java:96) - Logging in to salesforce.com
 
2006-10-19 14:04:15,908 WARN  [main] httpclient.HttpMethodBase readResponseBody (HttpMethodBase.java:2091) - Response co
ntent length is not known
2006-10-19 14:04:16,440 ERROR [main] client.PartnerClient connect (PartnerClient.java:142) - ; nested exception is:
        javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
2006-10-19 14:04:16,440 ERROR [main] LoaderEngineRunner main (LoaderEngineRunner.java:126) - ; nested exception is:
        javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
 
Thanks, Dimple

Message Edited by dimple on 10-19-2006 06:19 AM

  • October 19, 2006
  • Like
  • 0
Well, I can update records and extract them but I'm having a problem deleting them
 
BTW, this is happening on the windows & linux command line programs BUT doesn't happen when I use the GUI version!
 
I run an extract to generate a .csv file I want to use for delete.  I have a good .sdl file and the .csv file generated from the extract will run deletes when using the GUI version of the data loading too.
 
The password is passed in on the command line...
 
I'm using the Id to delete the records. 
 
SDL file
=================
#Mapping values
#Thu Apr 20 15:59:40 PDT 2006
ID=Id
 
config.properties
==================
#Loader Config
password=
outputError=error.csv
extractionSOQL=
queryRequestSize=500
username=xxxxxx@xxx.com
endpoint=
extractionTarget=daily_calls_extract.csv
mappingFile=daily_calls_delete.sdl
operation=delete
entity=Daily_Calls__c
assignmentRule=
dataAccessObject=daily_calls_extract.csv
batchSize=200
lastBatchRow=0
outputSuccess=
rowToStartAt=0
outputDirectory=
insertNulls=false
 
Sample from the .csv file
=====================
"ID"
"a0730000000VshsAAC"
"a0730000000VshtAAC"
 
 
 
Anyone here have any ideas?
 
 
Trace from the command line too.
===============================

        at com.sforce.soap.partner.SoapBindingStub.describeSObject(SoapBindingStub.java:1170)
        at com.salesforce.lexiloader.client.PartnerClient.setFieldTypes(PartnerClient.java:343)
        at com.salesforce.lexiloader.controller.LoaderController.setFieldTypes(LoaderController.java:109)
        at LoaderEngineRunner.main(LoaderEngineRunner.java:105)
2145 [main] INFO LoaderEngineRunner  - Creating Map
2153 [main] INFO LoaderEngineRunner  - About to perform delete
Exception in thread "main" java.lang.NullPointerException
        at com.salesforce.lexiloader.controller.LoaderController.executeAction(LoaderController.java:103)
        at LoaderEngineRunner.main(LoaderEngineRunner.java:115)
[root@tiger download]#

I've happily used the data loader over the past year, but in the past 2 months or so, it stopped working for me.  I've attempted to uninstall the loader and have re-downloaded it and tried to re-install it, but I continue to get an error message:
 
"The feature you are trying to use is on a network resource that is unavailable.  Click OK to try again, or enter an alternate path to a folder containing the installation package 'Sforce Data Loader.msi' in the box below.  Use source: [browse to folder]"
 
I assume this means that the last version hasn't truly been uninstalled, though I can't find any files that reference it.  My guess is that there's something in the registry that's tripping up my installation.  Has anyone else had this problem? 
 
If you have any suggestions for how to fix this, I'd be extremely greatful - unfortunately my IT support staff is as clueless about this as I am (frightening, I know).
 
Thanks in advance for your help,
-Cara
Hi All,

I read all the threads about this but I'm still having this issue.
I've been developing an application and it runs fine under tomcat.

When I deploy it under Websphere Community Edition 1.0.1.1, my login to salesforce fails with the following exception message:
nested exception is: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
And part of the stack trace:

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
        at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
        at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
        at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
        at org.apache.axis.client.Call.invoke(Call.java:2767)
        at org.apache.axis.client.Call.invoke(Call.java:2443)
        at org.apache.axis.client.Call.invoke(Call.java:2366)
        at org.apache.axis.client.Call.invoke(Call.java:1812)
        at com.sforce.soap.partner.SoapBindingStub.login(SoapBindingStub.java:1062)

Here's the url that I'm trying to connect to:
https://www.salesforce.com/services/Soap/u/7.0

It's the same URL in tomcat and websphere.

Please note that tomcat and websphere are running under the exact same JDK, namely Sun 1.4.2_11.

Most of the threads about this error say you can solve it by upgrading your JDK. I am already running the highest 1.4x JDK and Websphere does not run (as far as I can tell) under java 1.5x.

Other threads had instructions about upgrading the certificates stored in JAVA_HOME/jre/lib/security/cacerts. I followed those instructions to the letter and that did not help or change the situation--the app still works on Tomcat 5.0.28 but not Websphere.

Hope someone can help. I am developing this app under tomcat but it needs to be deployed to websphere.




Hi all,
 
First, let me say that i am new to developing with SalesForce and the API.  I am using the Partner WSDL to connect to SF.  I am trying to pull a query that contains a formula field in the condition clause, but i am getting a MALFORMED_QUERY error saying 'unexpected token Next_Invoice_Date__c'.  I have searched and searched for an answer, but i cant seem to find one.
 
My query (VB.NET):
Code:
Dim SFqr As SForce.QueryResult = SFService.query("SELECT Id, Name, ACCT_Last_invoice_date__c, Next_Invoice_Date__c FROM Opportunity " _
                & "WHERE OPS_Lease_Begin_Date__c != null " _
                & "AND Next_Invoice_Date__c <= " & sMaxDate & " " _
                & "AND (Turn_off_billing_date__c = null OR Turn_off_billing_date__c > Next_Invoice_Date__c) " _
                & "AND (ACCT_Last_invoice_date__c != Next_Invoice_Date__c AND ACCT_Last_invoice_date__c != null)")

 The variable sMaxDate is populated with a date in the format yyyy-MM-dd.  The text in red is what the error is referring to.  What i dont understand is why it is excepting the first Next_Invoice_Date__c (in orange), but not the second.

Can someone please advise me on what to do?
 
Thanks in advance
 
~Scott~
Hello All,

We have an application that parses SOAP message to extract the data. From Last week, we have been having problems with Salesforce sending random characters in the Response . It is intermitten and our application crashes for about 2 - 3 hours and starts working again. So I am guessing it is not the problem with our application as it works when the response is right.

Have any one of you have seen anything like this before? I m not sure if this is the problem with the winter release.

Thanks,
Chitra
  • January 31, 2006
  • Like
  • 0