• Eric_SalesForce
  • NEWBIE
  • 80 Points
  • Member since 2013

  • Chatter
    Feed
  • 2
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 10
    Replies
Trying to write a apex class for making Salesforce and PayPal work via Form Assembly. I've created a custom object called Donation and am using a template coding provided by From Assembly support (http://www3.formassembly.com/blog/doc/connectors/salesforce/advanced-integration/making-salesforce-and-paypal-work-together/). I changed the code to replace where it referenced Opportunity to reference my custom object Donation__c. But I get the error ' Error: Compile Error: Variable does not exist: donation__c at line 8 column 9'. Below is the cod I'm using. Any Ideas?

public class IPNHandlerController {

    public PageReference myIPNupdate() {
     try{
        PageReference pageRef = ApexPages.currentPage();
        //Get the value of the 'custom' parameter from current page
        String paramCustom = pageRef.getParameters().get('custom');
        donation__c = [select Id,paid__c from Donation__c where FormAssemblyID__c = :paramCustom ];

        String content = '';
        for(String key : pageRef.getParameters().keySet()){
            //Note that there is no guarantee of order in the parameter key map.
            content += key + ' : ' + pageRef.getParameters().get(key) + '\n';
        }
        Donation__c.PayPalInfo__c = content;
        Donation__c.paid__c = True;
        update Donation__c;

        PageReference newPage = new ApexPages.StandardController(Donation__c).view();
        newPage.setRedirect(true);       

        return newPage;
     } catch (System.Exception e){
         //A failure occurred
         system.debug(e);
         return null;
     }
    }

    public Opportunity opportunity {get; set;}

    public IPNHandlerController() {
    }
}
Hello.  I am struggling to identify a way to prevent multiple records being created by clicking a commandbutton multiple times (often due to a slow internet connection).  I know there are a few ways to accomplish this if the commandbutton is not set up to take the user to another page (simply by making the button disappear briefly, etc).

However, my problem is that I have a commandbutton that inserts a record and then takes the user to another page.  It seems the tricks for making a button disappear briefly (such as actionstatus) do not work when the commandbutton is taking the user to a different page.

In other words, I am trying to figure out a way for a user to click a commandbutton...the button will disappear...and the user will then be taken to the next page.

Any suggestions?

Thanks in advance.
We want to refresh our sandbox and the biggest thing we are worried about losing is all of our code that we have on sandbox but is not yet on production. Will that be affected? What if we have a page on production and one with changes on sandbox? Will be lose the changes on sandbox? What if we have a page on sandbox that isn't on production? Will be lose that page?

thanks,
I would like to create a way for the user to go into an Opportunity via a list view and then go back to the list view they were in last. Often times users filter their opportunities by criteria and step through each list view one at a time and it is nice to allow them to go back to the previous one they were in. We currently have a custom visualforce pay for our opportunities and so we would need to create the functionality from scratch.

thanks,
Hello,

Is there a more effective way of deploying than what my company is currently using? We create our changes on our sandbox server and then deploy to production. The problem is often times our production server is not the same as our test server and so our users face problems and we have to revert the deployment and makes changes again. Is there any way to have some kind of staging area or soft deployment so we are able to do some testing on our production server without affecting our users or buying a new org for just a staging area?

thanks,
Hello,

We have a Google Maps app on our VisualForce page. We have a little window that opens up when you click on the map and shows the latittude and longitude. We also have a button on the window. When you click the button we want to send the lattitude and longitude to two different apex:inputfields on the visualforce page to populate them and then you can save the record. The only problem we are having is moving the lattitude and longitude from the javascript to the apex:inputfield. 


We are trying to do the document.getElementById('LatInput').value = LatFromMap;

where LatInput is our apex:inputfield and LatFromMap is the var in javascript that holds the lattitude.

It let us do it using a regular html input tag but it will not with the apex:inputfield.

Is there a way to do this? 

thanks in advance!
Hello,

The problem that my company has is we have our production server and our sandbox server. We make changes/updates/features on sandbox and push them to production when they are ready. The problem is often times our sandbox server isn't the same as production and so when we push something to production it breaks the current functionality or there are errors that come out of it. Is it possible to have some kind of a staging area for salesforce without purchasing a new org?

thanks,
Is there a way to save VisualForce pages and Apex Classes/Triggers to Github and vice versa? Is there any kind of integrationg for this/is there a version control system that will work with SalesForce?

thanks,
Hello,

I have a VisualForce page for users on their desktops and we recently created a mobile app that has some of the functionality but not all of the original. However I do not have a "new" button on the list view when looking at the mobile app and we already overrode the standard new button for the visualforce redirect. Is there a way to have a new button do two different things depending on if you are on mobile or not? Or have one new button show up and the other not depending if you are mobile or not?

thanks,
I have a selectList and have populated it from the Apex Controller. I have the list displaying correctly on the Visualforce page however when a user tries to select an option from the selectList and then save, it doesn't save the value. I also need the selectList to display the option that has been saved previously. How do I make sure that the field of an object gets set from the selectlist and how can i make the selectlist display the correct option depending on the field of the object?

thanks,
Hello,

I put one of my apps on SalesForce1 and it shows up perfectly formatted on a tablet but it gets scrunched together on a phone. Is there a place that tells you how to format the VF page so that it adjusted the objects size based on the resolution of the device?

thanks,
Hello,

I am trying to create a traffic counter for my VF pages. So right now I have it when the page loads it calls an apex method that increments a field value by 1. I was wondering if there was a way to automate the field to reset when the month ends, is that possible?

thanks,
Hi I have a SQL query that I want to setup through SalesForce, it querys where someDate >= (date manipulation to get last monday to last sunday).

I want to query the same way on salesforce and im not sure how I can win the existsing Date Functions available. 

I wanted to use LAST_WEEK but that gets me sunday - saturday which isn't what I wanted, I was hoping do something like:

where someDate >= LAST_WEEK + 1 AND where someDate >= LAST_WEEK + 6

Is this possible? 

thanks
I was wondering if there was any more customizing we can do for Salesforce. We would like to change the color schemes, the tabs at the top, etc. Is there a way to do that or is it kind of set in stone.
I was wondering if there was a way to track when a new Page View was created using an apex trigger. We want to be able to see what users are using what pages to help troubleshoot if a user isn't able to see content because of a view that was created incorrectly. Is there a class called PageView that we can access or a list of Page Views with a creater field that we can see?

thanks,

Hello,

 

Basically what I am trying to do is make it so when an opportunity is transfered to a different owner, the associated tasks with that opportunity are also transfered to the new owner. The problem I have is I get a list of the opportunities to transfer, then for each of those opportunities I get a list of the tasks and then I try to move everything over. However I get this error and I am not sure how to handle the error outside of the outer loop.

 

For(All Opportunities to Update Owner)

{

    For(All Tasks of Opporunitiy)

          Change Owner)

{

Hello,

I have a VisualForce page for users on their desktops and we recently created a mobile app that has some of the functionality but not all of the original. However I do not have a "new" button on the list view when looking at the mobile app and we already overrode the standard new button for the visualforce redirect. Is there a way to have a new button do two different things depending on if you are on mobile or not? Or have one new button show up and the other not depending if you are mobile or not?

thanks,
Trying to write a apex class for making Salesforce and PayPal work via Form Assembly. I've created a custom object called Donation and am using a template coding provided by From Assembly support (http://www3.formassembly.com/blog/doc/connectors/salesforce/advanced-integration/making-salesforce-and-paypal-work-together/). I changed the code to replace where it referenced Opportunity to reference my custom object Donation__c. But I get the error ' Error: Compile Error: Variable does not exist: donation__c at line 8 column 9'. Below is the cod I'm using. Any Ideas?

public class IPNHandlerController {

    public PageReference myIPNupdate() {
     try{
        PageReference pageRef = ApexPages.currentPage();
        //Get the value of the 'custom' parameter from current page
        String paramCustom = pageRef.getParameters().get('custom');
        donation__c = [select Id,paid__c from Donation__c where FormAssemblyID__c = :paramCustom ];

        String content = '';
        for(String key : pageRef.getParameters().keySet()){
            //Note that there is no guarantee of order in the parameter key map.
            content += key + ' : ' + pageRef.getParameters().get(key) + '\n';
        }
        Donation__c.PayPalInfo__c = content;
        Donation__c.paid__c = True;
        update Donation__c;

        PageReference newPage = new ApexPages.StandardController(Donation__c).view();
        newPage.setRedirect(true);       

        return newPage;
     } catch (System.Exception e){
         //A failure occurred
         system.debug(e);
         return null;
     }
    }

    public Opportunity opportunity {get; set;}

    public IPNHandlerController() {
    }
}
Hello,

Here is my test class which I am getting Attempt to de-reference a null object. Not sure what's wrong. Any help to resovle this error will be appreciated. So there is VF page where users enters start date and end date with datatime data type, and based on these dates, clickout records should be fetched and printed as pdf.

Public Static TestMethod void test1(){
        init();   // this method creates the required data like opp, account, contact, etc.
           
        clickO.CLICK_OUT_DATE__C = system.now(); // error on this line "FATAL_ERROR|System.NullPointerException: Attempt to de-reference a null object"
        clickO.RELATED_MERHCANT__C = 'abcd';
        clickO.MERCHANT_OF_THE_DAY__C = true;
        clickO.MERCHANT_OF_THE_WEEK__C= false;
        clickO.COST_PER_CLICK__C= 0.33;
        insert clickO;
       
       clickO.CLICK_OUT_DATE__C = system.now();
        clickO.RELATED_MERHCANT__C = 'abcd';
        clickO.MERCHANT_OF_THE_DAY__C = false;
        clickO.MERCHANT_OF_THE_WEEK__C= true;
        clickO.COST_PER_CLICK__C= 0.33;
        insert clickO;
       
       clickO.CLICK_OUT_DATE__C = system.now();
        clickO.RELATED_MERHCANT__C = 'abcd';
        clickO.MERCHANT_OF_THE_DAY__C = false;
        clickO.MERCHANT_OF_THE_WEEK__C= false;
        clickO.COST_PER_CLICK__C= 0.33;
        insert clickO;          
            
        Test.startTest();
            ApexPages.StandardController scon = new ApexPages.StandardController(opp);
            OpportunityPDFController pdfC = new OpportunityPDFController(scon);
          
            pdfC.billing.Billing_Cycle_Start_Date__c = system.now();
            pdfC.billing.Billing_Cycle_end_Date__c = system.now().addDays(8);
            pdfc.billing.refund__c=12;
           
            pdfc.refund=2;
           
            pdfC.refreshCheckout(); // This method refresh the vf page, and display all the click out records between start date and end date
            pdfC.generatePDF();  // This method generates pdf.
           
            pdfC.generatePDFBill();
            pdfC.savePDF();
            ApexPages.currentPage().getParameters().get(pdfC.billing.id);
            pdfC.refreshCheckoutPDF();
           
        Test.stopTest();
   
    }
  • April 17, 2014
  • Like
  • 0
Hello.  I am struggling to identify a way to prevent multiple records being created by clicking a commandbutton multiple times (often due to a slow internet connection).  I know there are a few ways to accomplish this if the commandbutton is not set up to take the user to another page (simply by making the button disappear briefly, etc).

However, my problem is that I have a commandbutton that inserts a record and then takes the user to another page.  It seems the tricks for making a button disappear briefly (such as actionstatus) do not work when the commandbutton is taking the user to a different page.

In other words, I am trying to figure out a way for a user to click a commandbutton...the button will disappear...and the user will then be taken to the next page.

Any suggestions?

Thanks in advance.
Hello,

Is there a more effective way of deploying than what my company is currently using? We create our changes on our sandbox server and then deploy to production. The problem is often times our production server is not the same as our test server and so our users face problems and we have to revert the deployment and makes changes again. Is there any way to have some kind of staging area or soft deployment so we are able to do some testing on our production server without affecting our users or buying a new org for just a staging area?

thanks,
Please suggest how to maintain Universal picklist?

I have one picklist which is having 50 values and this picklist present in various objects. My requiremnt is when ever user get change the value (Insert,delete,update) particular value should be updated in other picklist fields present in various objects.

Please give me the code if you done in your projects


Hello,

I am trying to create a traffic counter for my VF pages. So right now I have it when the page loads it calls an apex method that increments a field value by 1. I was wondering if there was a way to automate the field to reset when the month ends, is that possible?

thanks,
Hi I have a SQL query that I want to setup through SalesForce, it querys where someDate >= (date manipulation to get last monday to last sunday).

I want to query the same way on salesforce and im not sure how I can win the existsing Date Functions available. 

I wanted to use LAST_WEEK but that gets me sunday - saturday which isn't what I wanted, I was hoping do something like:

where someDate >= LAST_WEEK + 1 AND where someDate >= LAST_WEEK + 6

Is this possible? 

thanks