• srinadh
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 5
    Replies

Hi...

how to write the test class for this apex class...

 

public class workperformed {
 Work_Performed__c wpc;  
 
    ApexPages.StandardController sController;  
    
    public workperformed(ApexPages.StandardController controller) 
    {
        sController = controller;
        wpc = (Work_Performed__c)controller.getRecord();
   
    }
    public PageReference saveAndNew() {
        
        // Custom SaveAndNew code here...
        sController.save();
        PageReference pageRef = new PageReference(ApexPages.currentPage().getURL());
        pageRef.setredirect(true);
        
        return pageRef;
    }
    



    public PageReference save() {
    
        // Custom Save code here...
        sController.save();
        PageReference pageRef = new PageReference( ApexPages.currentPage().getHeaders().get('Referer'));
        String returnParam = pageRef.getParameters().get('retURL');
        
        pageRef = new PageReference(URL.getSalesforceBaseUrl().toExternalForm() + returnParam );
        pageRef.setredirect(true);
        
        return pageRef;
    }    

}

 

  • September 25, 2012
  • Like
  • 0

Work Performed is Child Object.

Case is Parent Object.

After Saving the Work Performed (Related List) in Case Detail Page. How to redirect the Case3. Page???

 

 

  • September 20, 2012
  • Like
  • 0

i have developed One VF Page:

1.How to redirect the Same page after saving the record???
2.How to Implement Save & New Functionality ???

VF Page

<apex:page standardController="Work_Performed__c">
<apex:form >
        <apex:pageBlock title="Work performed">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="Save"/>
                 <apex:commandButton action="{!cancel}" value="Cancel"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Work Performed" columns="2" collapsible="true" dir="LTR" id="My">
                <apex:inputField value="{!Work_Performed__c.Note__c}"/>
                <apex:inputField rendered="false" value="{!Work_Performed__c.Case_Number__c}"/>
               
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

  • September 12, 2012
  • Like
  • 0

 Sending a Case Number to webSite in return url (Generate HTM form)  when the case comes from web to case ????

  • September 11, 2012
  • Like
  • 0

For one pick list this section needs to be visible for all other status it is not required. Remaining Standard functionality need to work as per the same

Hi all,

 

Thanks in Advance.

I Have a PHP E-Commerce application in that Orders Screen is there if I click on submit in the Orders Screen that has to go into Opportunities tab in salesforce CRM.

Both way integration is needed..

 

How to proceed in this...

 

Thanks and Regards

Dashing Reedy

Hi...

how to write the test class for this apex class...

 

public class workperformed {
 Work_Performed__c wpc;  
 
    ApexPages.StandardController sController;  
    
    public workperformed(ApexPages.StandardController controller) 
    {
        sController = controller;
        wpc = (Work_Performed__c)controller.getRecord();
   
    }
    public PageReference saveAndNew() {
        
        // Custom SaveAndNew code here...
        sController.save();
        PageReference pageRef = new PageReference(ApexPages.currentPage().getURL());
        pageRef.setredirect(true);
        
        return pageRef;
    }
    



    public PageReference save() {
    
        // Custom Save code here...
        sController.save();
        PageReference pageRef = new PageReference( ApexPages.currentPage().getHeaders().get('Referer'));
        String returnParam = pageRef.getParameters().get('retURL');
        
        pageRef = new PageReference(URL.getSalesforceBaseUrl().toExternalForm() + returnParam );
        pageRef.setredirect(true);
        
        return pageRef;
    }    

}

 

  • September 25, 2012
  • Like
  • 0

i have developed One VF Page:

1.How to redirect the Same page after saving the record???
2.How to Implement Save & New Functionality ???

VF Page

<apex:page standardController="Work_Performed__c">
<apex:form >
        <apex:pageBlock title="Work performed">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="Save"/>
                 <apex:commandButton action="{!cancel}" value="Cancel"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Work Performed" columns="2" collapsible="true" dir="LTR" id="My">
                <apex:inputField value="{!Work_Performed__c.Note__c}"/>
                <apex:inputField rendered="false" value="{!Work_Performed__c.Case_Number__c}"/>
               
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

  • September 12, 2012
  • Like
  • 0

For one pick list this section needs to be visible for all other status it is not required. Remaining Standard functionality need to work as per the same