• Nuno REIS
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
Hello all,

I need some advice, help on a business requirement.
I will create a new custom button on opportunity object.
After clicking on this button the first step is to control a few fields and validate if they are filled in.
If some fields are empty we have to display a popup (or a VFP page) including error messages about the empty fields. If all the fields are filled in the system will display a VFP rendered as a PDF page.

How can achieve that? Maybe do you have some examples?
Many thanks,
Nuno.
  
Hello all,

I'm trying to create a VFP with Opportunity as the Standard controller and an extension controller.

I'd like to get the fields values from the current Opportunity.
I've tried many codes but I get error messages 

Here is one code:
// Visualforce //
<apex:page standardcontroller="Opportunity" extensions="MyController">
etc ...

// Controller //
public Opportunity opt { get; set; }
public MyController(ApexPages.StandardController sc) {
     theId = ApexPages.currentPage().getParameters().get('id');
     opt = (Opportunity) sc.getRecord(); 
     }

Unfortunately for this line opt = (Opportunity) sc.getRecord();  I get the error message "Incompatible types since an instance of SObject is never an instance of Opportunity" 
From this controller, I want to reach the current fields values and the fields values from the related objects.
Any idea, please?
Many thanks
Nuno.
Hello all,

I need some advice, help on a business requirement.
I will create a new custom button on opportunity object.
After clicking on this button the first step is to control a few fields and validate if they are filled in.
If some fields are empty we have to display a popup (or a VFP page) including error messages about the empty fields. If all the fields are filled in the system will display a VFP rendered as a PDF page.

How can achieve that? Maybe do you have some examples?
Many thanks,
Nuno.
  
Hello all,

I'm trying to create a VFP with Opportunity as the Standard controller and an extension controller.

I'd like to get the fields values from the current Opportunity.
I've tried many codes but I get error messages 

Here is one code:
// Visualforce //
<apex:page standardcontroller="Opportunity" extensions="MyController">
etc ...

// Controller //
public Opportunity opt { get; set; }
public MyController(ApexPages.StandardController sc) {
     theId = ApexPages.currentPage().getParameters().get('id');
     opt = (Opportunity) sc.getRecord(); 
     }

Unfortunately for this line opt = (Opportunity) sc.getRecord();  I get the error message "Incompatible types since an instance of SObject is never an instance of Opportunity" 
From this controller, I want to reach the current fields values and the fields values from the related objects.
Any idea, please?
Many thanks
Nuno.