• ksanket
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies

How to scroll the parent (standard) page to a particular position when an inline VF page link is clicked??

Please help

Hi everyone,

 

I have created a 'User' through Apex code,and the password is being sent on the respective email address given.

My question is ,can i set the password or get the password in my code so that i can login through apex code.

Please help me.. 

  • September 04, 2012
  • Like
  • 0

Hi,

 

we have custom button that render as PDF for Opportunity with their opportunitylineitems.

Now the user will add another opportunitylineitem on same Opportunity and generate the PDF BUT how can i make sure it does include the one that added recently.

 

ex.

1)Opprtunity with 3 lineitem

2) custom button generate PDF with step 1

3) user add another lineitem on same Opportunity

4) custom button generate PDF with step 3 and not include step 1 (3 lineitems)?? HOW???

 

I would appriciate if someone can help.

 

Many thanks,

 

  • September 24, 2012
  • Like
  • 0

Hi everyone,

 

I have created a 'User' through Apex code,and the password is being sent on the respective email address given.

My question is ,can i set the password or get the password in my code so that i can login through apex code.

Please help me.. 

  • September 04, 2012
  • Like
  • 0

Hi,

 

Thanks for all expert here to help everytime with any query.

 

I have controller class and test class. The test works fine except this line.... from controller class. Any solution to make it work?

 

Thanks,

 

public list <OpportunityLineItem> getLicenceServicelist () {
        return [SELECT id, ServiceDate, License_service__c, PricebookEntry.Product2.Quote_service_group__c, Opportunity.name FROM OpportunityLineItem                                          WHERE License_service__c = 1 AND Opportunity.id = 
            :System.currentPageReference().getParameters().get('id')];
     } /* how can i run the test class for this line*/

 

controller class:

public class OppsControllerExtension {

    private final Opportunity opps;
    
    
    public OppsControllerExtension(ApexPages.StandardController stdController) {
        this.opps = (Opportunity)stdController.getRecord();
    }
List<OpportunityLineItem> OppsLicence = [SELECT id, ServiceDate, Opportunity.name FROM OpportunityLineItem 
                                         WHERE License_service__c = 1 AND Opportunity.id = 
            :System.currentPageReference().getParameters().get('id')];
   
        public integer getLicenceRowNumber() {
            if (OppsLicence.size() >= 1)
            return OppsLicence.size() - 1;       
           
        else
            return 0;
        }
        public list <OpportunityLineItem> getLicenceServicelist () {
        return [SELECT id, ServiceDate, License_service__c, PricebookEntry.Product2.Quote_service_group__c, Opportunity.name FROM OpportunityLineItem                                          WHERE License_service__c = 1 AND Opportunity.id = 
            :System.currentPageReference().getParameters().get('id')];
     } }

 

Test class:

@IsTest(SeeAllData=true)
private class OppsContollerExtensionTestV2 {

    static testMethod void myUnitTestforNull() {
                Pricebook2 pb = [Select Id, Name From Pricebook2 Where IsStandard = true Limit 1];//Id = '01sM00000000ApLIAU' Limit 1];//IsStandard = true Limit 1];

        /* Setup a basic opportunity */
        Opportunity o  = new Opportunity();
        o.Name = 'TEST'; o.AccountId = '001M0000002PGFO'; o.CloseDate = Date.today(); o.StageName = 'Interest';o.Pricebook2Id = pb.id; Database.insert(o);

        /* Create a product2 */
        Product2 p = new Product2();
        p.Name     = 'TEST'; 
        Database.insert(p);
        
        /* Create a pricebook entry. */
        PricebookEntry pbe = new PricebookEntry();
        pbe.Pricebook2Id = pb.id; pbe.Product2Id   = p.id; pbe.IsActive     = true;         pbe.UnitPrice    = 50;
        Database.insert(pbe);
        
         /* Create a line item */
        OpportunityLineItem i = new OpportunityLineItem();
        i.opportunityId = o.id; i.pricebookentryid = pbe.id; i.quantity = 4; i.TotalPrice = 2000;
        Database.insert(i);
        
        /* Set the request parameter that the constructor for quoteExt is expecting */
        Pagereference pref = Page.quote1PDF;
        pref.getParameters().put('id',o.Id);
        Test.setCurrentPage(pref);

        ApexPages.StandardController stdcontroller = new ApexPages.Standardcontroller(o);
        OppsControllerExtension opptyCtrlObj = new OppsControllerExtension (stdcontroller);
        
        Test.startTest();
        integer licenceRowNumebr = opptyCtrlObj.getLicenceRowNumber();
        Test.stopTest();
                
	}
	
	static testMethod void myUnitTestforLicense() {
                        
        Pricebook2 pb = [Select Id, Name From Pricebook2 Where IsStandard = true Limit 1];//Id = '01sM00000000ApLIAU' Limit 1];//IsStandard = true Limit 1]; 

/* Setup a basic opportunity */
Opportunity o = new Opportunity(); o.Name = 'TEST'; o.AccountId = '001M0000002PGFO'; o.CloseDate = Date.today(); o.StageName = 'Interest';o.Pricebook2Id = pb.id; Database.insert(o); /* Create a product2 */ Product2 p = new Product2(); p.Name = 'TEST'; p.Quote_service_group__c='Licence'; Database.insert(p); /* Create a pricebook entry. */ PricebookEntry pbe = new PricebookEntry(); pbe.Pricebook2Id = pb.id; pbe.Product2Id = p.id; pbe.IsActive = true; pbe.UnitPrice = 50; Database.insert(pbe);

/* Create a line item */
OpportunityLineItem i = new OpportunityLineItem(); i.opportunityId = o.id; i.pricebookentryid = pbe.id; i.quantity = 4; i.TotalPrice = 2000; Database.insert(i);

/* Set the request parameter that the constructor for quoteExt is expecting */
Pagereference pref = Page.quote1PDF;
pref.getParameters().put('id',o.Id);
Test.setCurrentPage(pref);
ApexPages.StandardController stdcontroller = new ApexPages.Standardcontroller(o); OppsControllerExtension opptyCtrlObj = new OppsControllerExtension (stdcontroller);
Test.startTest();
integer licenceRowNumebr = opptyCtrlObj.getLicenceRowNumber();
Test.stopTest(); } }
Hai, In my vfpage i have 2 pageblock sections 1st section contains two radio buttons 2nd section contains file upload with "Attach" command button to show the attached file. Now i selected one radio button,then i uploaded one file and now when i am click on "Attach" the page refreshes and the selected radio in section 1 dissappears. I need to show the selected radio even after page refresh...Can anyone suggest me how to do this one....