• sfdcdev.wordpress.com
  • NEWBIE
  • 110 Points
  • Member since 2008

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 20
    Replies

Hi everyone i have a list in my Apex class which has soql query result..

        

String query = 'SELECT  City,Latitude__c FROM Lead WHERE City LIKE \''+city+'%\'';
       
        leadrecords = Database.query(query);   

 

Eg :in the above line leadrecords is alist of lead type

 

    private List<Lead> leadrecords;

 

So now iam trying to pass this list to ajavascript variable so dat javascript variable should have query  output...but when i have done like this iam able to pass the list but when iam tryong to display that it is displaying the  ids  but i want to display the field city and latitude which are storesd in that list how to do it please someone help me with the solution... to javascript variable so how to pass this list to javascript variable

  

The applet starts successfully.Its purpose is to upload a pdf file.I have used the Salesforce APIs.And have included them in the JAR that I have prepared.The whole process works fine in HTML locally.The error that I am getting on Visual Force is :->

Exception in thread "AWT-EventQueue-4" java.lang.ClassFormatError: Incompatible magic value 168430090 in class file javax/servlet/ServletConfig
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at sun.applet.AppletClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    at java.lang.Class.getDeclaredMethod(Unknown Source)
    at org.apache.commons.discovery.tools.ClassUtils.findPublicStaticMethod(ClassUtils.java:116)
    at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:178)
    at org.apache.axis.configuration.EngineConfigurationFactoryFinder.access$200(EngineConfigurationFactoryFinder.java:46)
    at org.apache.axis.configuration.EngineConfigurationFactoryFinder$1.run(EngineConfigurationFactoryFinder.java:128)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:113)
    at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:160)
    at org.apache.axis.client.Service.getEngineConfiguration(Service.java:813)
    at org.apache.axis.client.Service.getAxisClient(Service.java:104)
    at org.apache.axis.client.Service.<init>(Service.java:113)
    at SforceServiceLocator.<init>(SforceServiceLocator.java:8)
    at UploadingPDF.login(UploadingPDF.java:78)
    at UploadingPDF.actionPerformed(UploadingPDF.java:224)
    at javax.swing.JTextField.fireActionPerformed(Unknown Source)
    at javax.swing.JTextField.postActionEvent(Unknown Source)
    at javax.swing.JTextField$NotifyAction.actionPerformed(Unknown Source)
    at javax.swing.SwingUtilities.notifyAction(Unknown Source)
    at javax.swing.JComponent.processKeyBinding(Unknown Source)
    at javax.swing.JComponent.processKeyBindings(Unknown Source)
    at javax.swing.JComponent.processKeyEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)


What can I do??Do i need to do the login and other such commands in this java file heres the whole java fileI have used this function as well.The error starts immediately after printing"Creating the binding to the web service":->

public boolean login() {
        un = ****;
        if (un.length() == 0) {
            return false;
        }
        pw = ******;
        if (pw.length() == 0) {
            return false;
        }

        // Provide feed back while we create the web service binding
        System.out.println("Creating the binding to the web service...");

    
        /*
         * There are 2 ways to get the binding, one by passing a url to the
         * getSoap() method of the SforceServiceLocator, the other by not
         * passing a url. In the second case the binding will use the url
         * contained in the wsdl file when the proxy was generated.
         */
        try {
            binding = (SoapBindingStub) new SforceServiceLocator().getSoap();
            System.out
                    .println("The login url is: "
                            + binding
                                    ._getProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY));
        } catch (ServiceException ex) {
            System.out
                    .println("ERROR: creating binding to soap service, error was: \n"
                            + ex.getMessage());
            System.out.print("Hit return to continue...");
            return false;
        }
       

        // Time out after a minute
        binding.setTimeout(60000);

        // Attempt the login giving the user feedback
        System.out.println("LOGGING IN NOW....");
        try {
            loginResult = binding.login(un, pw);
        } catch (LoginFault lf) {
            System.out.println(lf.getExceptionMessage());
            // lf.printStackTrace();
          //  getUserInput("\nHit return to continue...");
            return false;
        } catch (UnexpectedErrorFault uef) {
            System.out.println(uef.getExceptionMessage());
            uef.printStackTrace();
           // getUserInput("\nHit return to continue...");
            return false;
        } catch (RemoteException re) {
            System.out.println(re.getMessage());
            re.printStackTrace();
           // getUserInput("\nHit return to continue...");
            return false;
        }

        System.out
                .println("\nThe session id is: " + loginResult.getSessionId());
        System.out.println("\nThe new server url is: "
                + loginResult.getServerUrl());

        // set the session header for subsequent call authentication
        binding._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY,
                loginResult.getServerUrl());

        // Create a new session header object and set the session id to that
        // returned by the login
        SessionHeader sh = new SessionHeader();
        sh.setSessionId(loginResult.getSessionId());
        binding.setHeader(new SforceServiceLocator().getServiceName()
                .getNamespaceURI(), "SessionHeader", sh);

        loggedIn = true;

        // call the getServerTimestamp method
        getServerTimestampSample();

        // call the getUserInfo method
        getUserInfoSample();

        return true;

    }


Hello,

 

We are trying to update some Task records using data loader or with Informatica.  We have 4 triggers on Task Object which will be executed once the record set is updated.

 

In the past what used to happen is that when set of 50 task records got updated, they used to be batched up and sent as one set. All the Governor Limits are applied against this set.

 

Recently what we noticed is that, 50 record set is being split into 50 individual records and each of the triggers is run for this Individual task. This process is repeated until all the 50 records are finished. All these operations happen in one context and all the SOQLs and DMLs are added up cumulatively. This is resulting in our code crossing the governor limits which in turn is causing the failure of the update.

 

Is anyone else facing the same issue? Were you guys able to resolve this? and if yes how.

It would be great if any one can provide us with solution to your problem.

 

We really appreciate your help.

 

Thanks,

Girish Suravajhula

 

 

Hello,

 

I am planning to do a insert of a large number of records that are inside of a CSV file. In the past we have provided the client a solution of using a Java program that reads the CSV file and makes the Insert by making use of Salesforce API.

However, now that the batch mode is available I was wondering if we can make use of it in this perticular scenario. Is there a way that we can can parse a large CSV file and insert records into Salesforce using salesforce batch mode.

Right now it appears that the batch mode can only run on records that are already inserted into Salesforce. I want the other way round, I want batch mode to be operational on records that are yet to be inserted into Salesforce. 

It some one already did this, please post the code and I guess it woud be helpfull for lot of people who are running in this issue. 

Hello,

This is so frightening when something like this happens.

We had the following code
Code:
                  pageRef = new PageReference(url); 
                  pageRef.setRedirect(false);
                  return pageRef;

It was working just fine up until two days ago. Suddenly, it stops working and the Visual Force page sits in the intermediate page and nothing happens after the method executes in the controller. Is there any change recently that I am not aware of. Please respond.

Thanks,
Girish Suravajhula.

 



Message Edited by Girish989 on 09-11-2008 07:48 AM
Hello,

I have a visual force custom search developed, can I use it a home page component.

Here is the simple code for my Visual Force page and I want this to be a homepage component.

Code:
<apex:page showHeader="false" controller="quichSeachController">
<apex:form target="_top"> 
<apex:panelGrid columns="2" style="width:100%;height:100%;background:#e8e8e8"> 
<apex:outputLabel value="SSN" for="SSN"/> 
<input id="ssn" name="ssn" size="10" /> 
<apex:outputLabel value="DOB" for="DOB"/>
<input id="dob" name="dob" size="10" /> 
<apex:outputLabel value="TN" for="TN"/> 
<input id="tn" name="tn" size="10" /> 
<apex:commandButton action="{!go}"  value="Go!" styleClass="btn"/> 
</apex:panelGrid> 
</apex:form>
</apex:page>

I currently embed it using an iframe here is the code for that:
Code:
<P><IFRAME style="Z-INDEX: 220; WIDTH: 179px; 
POSITION: relative; HEIGHT: 100px" src="/apex/QuickSearch" 
frameBorder=0 scrolling=no target="_top">
</IFRAM><P></IFRAME></P>

 However I don't want to do that as it would make the page loading slower as this would load separately from the main page.

Any advice will be greatly appreciated.

Regards,
Girish Suravajhula.


 

    Hello,

    It would be great if some one can suggest me a way to develop Logger class that will log all my apex messages to a local file.

    This would greatly help me, as this would give me an ability to go through the failure messages, and debug the application             more effectively. 
   
    I created an apex class that logs into Salesforce Document object, but it would create 2 additional calls to Salesforce and is lot     of overhead for each request. Suggestions would be greatly appreciated.



Code:
public class Logger {
 
 
 private static final Document log = [Select d.Body From Document d where d.Name='LogFile'][0];
 
 private String logMessage = '';
 
 public void addToLog(String message){
  logMessage = logMessage + System.now() + '::' +message + '\n';
 }
 
 public void logmessage(){
 
  log.body= Blob.valueOf(log.body.toString()+ logMessage);
  update log;
  logMessage = '';
 
 }

}

 


    Thanks,
    Girish S
Hello,

I am trying to Migrate my SControls from SandBox env to antother.

I am not able to migrate one of the scontrol that has this "Case.ContactId".

It gives me an error saying that ContactId does not exist for Case Object.

However during the coding of SControl it will not give me any error. It will even show it in the drop down when I select Case.

Any idea why this is happening. Help will be greatly appreciated.

Code:
var url = "/email/author/emailauthor.jsp—p3_lkid={!Case.Id}&rtype=003&p2_lkid={!Case.ContactId}&"+
"save=1&p24=&p4=&p5=&template_id="+tid+"&new_template=1"; 

 


Thanks,
GirishS
Hello,

I am trying to disply values in a table. When one of the value is empty, it removes the line below it. Exactly the same problem we would get , when you are coding in HTML and the value returned from the backend is null.

I tried

<apex:outputText value="{!IF(aBilldetail.Proration_Phone__c==null,' &nbsp',aBilldetail.Proration_Phone__c)}"
style="display: block;" />

but this doesnt work becuase SF coverts &nbsp to &amp,nbsp and treats it as a string.

Thanks,
GirishS

Hello,
 
How would we display a check box as an output tag. In visualforce, there is <apex:inutCheckBox> tag for input checkbox. I want to show a checked checkbox based on the data in Salesforce for a perticular field insted of boolean value.
 
Help would be apreciated.
 
Thanks,
Girish

I'm playing with the following example: http://www.salesforce.com/us/developer/docs/pages/Content/pages_controller_custom.htm

 

I created both the controller and the page. However, I see an error: http://i.imgur.com/JxJbnMy.png

 

I have *no* idea what went wrong. The question is how to debug this?

Hi,

 

I've implemented Salesforce OAuth 2.0 Web Server flow and it works perfectly well with a HTTP callback uri. But when I use an HTTPS callback URI, the page on which the User Approves the app to use Salesforce asks for less permissions than what is shown for HTTP URI. 

 

The Remote Access Applications setup for both is exactly the same except the callback uri's ( obviously )

 

The page requesting the user to grant access for HTTP callback uri is asking for 3 permissions ( see https://www.dropbox.com/s/62qzsgev3nidw9o/developersalesforce.tiff

1. Access your basic information

2. Access and manage your data

3. Perform requests on your behalf at any time

 

While the same page for HTTPS callback uri is only asking the first two options and not the third one ( see https://www.dropbox.com/s/w0k92iu42wuudug/securesalesforce.tiff )

 

Because of this, I cannot refresh my access tokens and the request to refresh access token fails.

 

Any insights on this will be highly appreciated.

 

Regards,

Agraj

  • April 30, 2013
  • Like
  • 0

Hello,

 

We are trying to update some Task records using data loader or with Informatica.  We have 4 triggers on Task Object which will be executed once the record set is updated.

 

In the past what used to happen is that when set of 50 task records got updated, they used to be batched up and sent as one set. All the Governor Limits are applied against this set.

 

Recently what we noticed is that, 50 record set is being split into 50 individual records and each of the triggers is run for this Individual task. This process is repeated until all the 50 records are finished. All these operations happen in one context and all the SOQLs and DMLs are added up cumulatively. This is resulting in our code crossing the governor limits which in turn is causing the failure of the update.

 

Is anyone else facing the same issue? Were you guys able to resolve this? and if yes how.

It would be great if any one can provide us with solution to your problem.

 

We really appreciate your help.

 

Thanks,

Girish Suravajhula

 

 

Trying to do the following but not having much luck... is there a way to do this?

 

SELECT Id, Name FROM Account WHERE BillingCity NOT LIKE '%Bentonville%'

 

Thanks.

I'm writing a unit test on the opportunity and opportunity line item.  I am getting the error "No standard price is defined".

 

Here is my test method:

 

public static testMethod void test3() 
    { 
    	Pricebook2 pb = new Pricebook2(Name = 'Standard Price Book 2009', Description = 'Price Book 2009 Products', IsActive = true);
    	insert pb;
    	Product2 prod = new Product2(Name = 'Anti-infectives 2007', Family = 'Best Practices', Practice__c = 'GP/BP', Service_Level__c = 'Partial Service', Product_Abbrev__c = 'CMR_Antiinfect', Sales_Unit__c = 'Each', Standard_Unit__c = 'Each', Product_Year__c = '07', Item_Type__c = 'Non-Inventory (Sales only)', IsActive = true);
    	insert prod;
    	PricebookEntry pbe = new PricebookEntry(Pricebook2Id = pb.Id, Product2Id = prod.Id, UnitPrice = 10000, IsActive = true, UseStandardPrice = false);
    	insert pbe;
    	Opportunity opp = new Opportunity(Name = 'Test Syndicated 2010', Type = 'Syndicated - New', StageName = 'Planning', CloseDate = system.today());
    	insert opp;
    	OpportunityLineItem oli = new OpportunityLineItem(opportunityId = opp.Id, pricebookentryId = pbe.Id, Quantity = 1, UnitPrice = 7500, Description = '2007 CMR #4 - Anti-Infectives');
    	insert oli;
		List<OpportunityLineItem> olis = [Select Id From OpportunityLineItem Where OpportunityId =: opp.Id];
		update olis[0];
    }

 

The error is thrown on the line where I try and insert the PricebookEntry record:

 

PricebookEntry pbe = new PricebookEntry(Pricebook2Id = pb.Id, Product2Id = prod.Id, UnitPrice = 10000, IsActive = true, UseStandardPrice = false);
    	insert pbe;

 

I'm not sure what I'm missing. 

 

Thanks for any help.

Regards.

 

Hi everyone,

I have a custom object called WorkItem which I have made visible through customer portal. In my org, I have overridden the "Create New WorkItem" button with a VF page and it is working perfectly fine. But, when I try to access it through my customer portal,  I am facing some problems and am not be redirected to the overriden page. rather, I am getting the standard edit page.

 

What do I need to do in order to fix this?

 

Thanks in advance.

 

SGM

Hi everyone i have a list in my Apex class which has soql query result..

        

String query = 'SELECT  City,Latitude__c FROM Lead WHERE City LIKE \''+city+'%\'';
       
        leadrecords = Database.query(query);   

 

Eg :in the above line leadrecords is alist of lead type

 

    private List<Lead> leadrecords;

 

So now iam trying to pass this list to ajavascript variable so dat javascript variable should have query  output...but when i have done like this iam able to pass the list but when iam tryong to display that it is displaying the  ids  but i want to display the field city and latitude which are storesd in that list how to do it please someone help me with the solution... to javascript variable so how to pass this list to javascript variable

  

Hello,

 

I am planning to do a insert of a large number of records that are inside of a CSV file. In the past we have provided the client a solution of using a Java program that reads the CSV file and makes the Insert by making use of Salesforce API.

However, now that the batch mode is available I was wondering if we can make use of it in this perticular scenario. Is there a way that we can can parse a large CSV file and insert records into Salesforce using salesforce batch mode.

Right now it appears that the batch mode can only run on records that are already inserted into Salesforce. I want the other way round, I want batch mode to be operational on records that are yet to be inserted into Salesforce. 

It some one already did this, please post the code and I guess it woud be helpfull for lot of people who are running in this issue. 

Wsdl2java (Axis 2.0) generates class extension is properly. But in Apex, generate Apex from WSDL feature is not giving appropriate class relationship.

e.g. I have following xsd in wsdl

<xsd:complexType name="Profile">
      <xsd:simpleContent>
              <xsd:extension base="xsd:string">
                 <xsd:attribute name="lang" type="xsd:string" use="optional"/>
              </xsd:extension>
      </xsd:simpleContent>
</xsd:complexType>

<xsd:complexType name="UserProfile">
        <xsd:simpleContent>
            <xsd:extension base="Profile">
                <xsd:attribute name="code" type="xsd:string"/>
            </xsd:extension>
        </xsd:simpleContent>
</xsd:complexType>

 

WSDL2Apex generates UserProfile and Profile classes, but dont have any relationship. In java Profile class has String _value containment. But Apex class does not have that containment too.

 

Any help would be appreciate.

 

Thanks.

Ankur

 

The applet starts successfully.Its purpose is to upload a pdf file.I have used the Salesforce APIs.And have included them in the JAR that I have prepared.The whole process works fine in HTML locally.The error that I am getting on Visual Force is :->

Exception in thread "AWT-EventQueue-4" java.lang.ClassFormatError: Incompatible magic value 168430090 in class file javax/servlet/ServletConfig
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at sun.applet.AppletClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    at java.lang.Class.getDeclaredMethod(Unknown Source)
    at org.apache.commons.discovery.tools.ClassUtils.findPublicStaticMethod(ClassUtils.java:116)
    at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:178)
    at org.apache.axis.configuration.EngineConfigurationFactoryFinder.access$200(EngineConfigurationFactoryFinder.java:46)
    at org.apache.axis.configuration.EngineConfigurationFactoryFinder$1.run(EngineConfigurationFactoryFinder.java:128)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:113)
    at org.apache.axis.configuration.EngineConfigurationFactoryFinder.newFactory(EngineConfigurationFactoryFinder.java:160)
    at org.apache.axis.client.Service.getEngineConfiguration(Service.java:813)
    at org.apache.axis.client.Service.getAxisClient(Service.java:104)
    at org.apache.axis.client.Service.<init>(Service.java:113)
    at SforceServiceLocator.<init>(SforceServiceLocator.java:8)
    at UploadingPDF.login(UploadingPDF.java:78)
    at UploadingPDF.actionPerformed(UploadingPDF.java:224)
    at javax.swing.JTextField.fireActionPerformed(Unknown Source)
    at javax.swing.JTextField.postActionEvent(Unknown Source)
    at javax.swing.JTextField$NotifyAction.actionPerformed(Unknown Source)
    at javax.swing.SwingUtilities.notifyAction(Unknown Source)
    at javax.swing.JComponent.processKeyBinding(Unknown Source)
    at javax.swing.JComponent.processKeyBindings(Unknown Source)
    at javax.swing.JComponent.processKeyEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)


What can I do??Do i need to do the login and other such commands in this java file heres the whole java fileI have used this function as well.The error starts immediately after printing"Creating the binding to the web service":->

public boolean login() {
        un = ****;
        if (un.length() == 0) {
            return false;
        }
        pw = ******;
        if (pw.length() == 0) {
            return false;
        }

        // Provide feed back while we create the web service binding
        System.out.println("Creating the binding to the web service...");

    
        /*
         * There are 2 ways to get the binding, one by passing a url to the
         * getSoap() method of the SforceServiceLocator, the other by not
         * passing a url. In the second case the binding will use the url
         * contained in the wsdl file when the proxy was generated.
         */
        try {
            binding = (SoapBindingStub) new SforceServiceLocator().getSoap();
            System.out
                    .println("The login url is: "
                            + binding
                                    ._getProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY));
        } catch (ServiceException ex) {
            System.out
                    .println("ERROR: creating binding to soap service, error was: \n"
                            + ex.getMessage());
            System.out.print("Hit return to continue...");
            return false;
        }
       

        // Time out after a minute
        binding.setTimeout(60000);

        // Attempt the login giving the user feedback
        System.out.println("LOGGING IN NOW....");
        try {
            loginResult = binding.login(un, pw);
        } catch (LoginFault lf) {
            System.out.println(lf.getExceptionMessage());
            // lf.printStackTrace();
          //  getUserInput("\nHit return to continue...");
            return false;
        } catch (UnexpectedErrorFault uef) {
            System.out.println(uef.getExceptionMessage());
            uef.printStackTrace();
           // getUserInput("\nHit return to continue...");
            return false;
        } catch (RemoteException re) {
            System.out.println(re.getMessage());
            re.printStackTrace();
           // getUserInput("\nHit return to continue...");
            return false;
        }

        System.out
                .println("\nThe session id is: " + loginResult.getSessionId());
        System.out.println("\nThe new server url is: "
                + loginResult.getServerUrl());

        // set the session header for subsequent call authentication
        binding._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY,
                loginResult.getServerUrl());

        // Create a new session header object and set the session id to that
        // returned by the login
        SessionHeader sh = new SessionHeader();
        sh.setSessionId(loginResult.getSessionId());
        binding.setHeader(new SforceServiceLocator().getServiceName()
                .getNamespaceURI(), "SessionHeader", sh);

        loggedIn = true;

        // call the getServerTimestamp method
        getServerTimestampSample();

        // call the getUserInfo method
        getUserInfoSample();

        return true;

    }


Recently I shift to platform 9 and API 14

Firstly I login the Salesforce through web and after I got API.SessionId and API.ServerUrl on VF page,  I invoke web service method "loginBySessionID" to login Salesforce  on the JAVA side.
But now it doesn't work.

Any Idea about it?

Thanks,
Kunpeng
Hello,

This is so frightening when something like this happens.

We had the following code
Code:
                  pageRef = new PageReference(url); 
                  pageRef.setRedirect(false);
                  return pageRef;

It was working just fine up until two days ago. Suddenly, it stops working and the Visual Force page sits in the intermediate page and nothing happens after the method executes in the controller. Is there any change recently that I am not aware of. Please respond.

Thanks,
Girish Suravajhula.

 



Message Edited by Girish989 on 09-11-2008 07:48 AM
Hi
I am trying to override the edit page for "Log a Call" or task with a custom visualforce page. I am having trouble getting some of the fields like
Assigned To,
Related To and
the checkbox "Send Notification Email".
I was able to add other fields uisng the API names.
 
Appreciate if anyone can help with the right way to adding the above fields in VF page.

When I add the following for the Assigned To, it throws the error "Assigned To ID: owner cannot be blank". Basiaclly I want to display the Assigned To field as it appears in the standard Log a Call edit page. Is there some reference available somewhere for converting all these fields in the standard page into a VF page?
 
VF Code:
<apex:page standardController="Task" extensions="conTaskNew">
<apex:form >
       <apex:pageBlock id="mypageblock" title="Task Edit" mode="new">       
     
            <apex:pageBlockButtons >                    
            <apex:commandButton onclick="return lsave()"   action="{!save}" value="Save"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Task Information" columns="2" id="theSection">  
           <apex:inputField id="vOwner" value="{!task.OwnerId}"/>             
            <apex:inputField id="vActDate" value="{!task.ActivityDate}"/>     
            <apex:inputField id="vsubject" value="{!task.Subject}"/>                
     </apex:pageBlockSection>               
</apex:pageBlock>
</apex:form>
</apex:page>

 Appreciate all your valuable feedbacks.
  • September 04, 2008
  • Like
  • 0
The "MIXED_DML_OPERATION" issue that plagues unit tests (see this forum discussion) is now effecting production code as well.

Our application adds an extra custom field to Users called "Other Emails".  This is a string field where a User can enter a bunch of email aliases; whenever it's updated we normalize the information into a separate "EmailAddress" table and the Address then points back at the User.

As of yesterday, that worked great.  I updated my User record to add an address to the "Other Emails" field.  The trigger code executed perfectly, and the EmailAddress object was created & linked to my User record.

As of today, it is failing:



This is a critical part of an Apex-based application that we have been developing for over 8 months, and this section of code has always worked until today.

We've had to comment out unit tests to deal with this issue - which was lame, but acceptable - but actually changing our object relationships and code at this late date would be difficult.
  • June 19, 2008
  • Like
  • 0
Hello,

I am trying to disply values in a table. When one of the value is empty, it removes the line below it. Exactly the same problem we would get , when you are coding in HTML and the value returned from the backend is null.

I tried

<apex:outputText value="{!IF(aBilldetail.Proration_Phone__c==null,' &nbsp',aBilldetail.Proration_Phone__c)}"
style="display: block;" />

but this doesnt work becuase SF coverts &nbsp to &amp,nbsp and treats it as a string.

Thanks,
GirishS

Hello,
 
How would we display a check box as an output tag. In visualforce, there is <apex:inutCheckBox> tag for input checkbox. I want to show a checked checkbox based on the data in Salesforce for a perticular field insted of boolean value.
 
Help would be apreciated.
 
Thanks,
Girish
Hi,
I want to write a query like this:

select Account__r.Id,Account__r.Name,Account__r.Account_Country__c from Card_UPC__c where Account__r.partner_relationship_status__c='Allow Relationships To Be Created' and Account__r.Name not like 'Test%'.
 
The above query throws SOQL exception.
 
It works and runs when I remove the NOT operator as shown below:

select Account__r.Id,Account__r.Name,Account__r.Account_Country__c from Card_UPC__c where Account__r.partner_relationship_status__c='Allow Relationships To Be Created' and Account__r.Name like 'Test%'
 
My questions is: Does SOQL support "NOT LIKE" operator. If no, then what is the alternative to achieve a similar operation.
 
Thanks for all your feedbacks.
Ambili
  • October 16, 2007
  • Like
  • 1