• gops
  • NEWBIE
  • 0 Points
  • Member since 2009

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

Hi All,

 

I need to implement a custom button to create a new case and redirect user to edit page of newly created case. This should respect service cloud console. A use case is CSR users can click new case and do so many things before saving the case. So the actual creation time will not be captured if we go with the standard new case. The users may feel the case is not valid and may opt to cancel the case in such scenario, user should be asked for confirmation before canceling the case.

 

For this I created new custom button 'Create and Edit'. This button invokes a visualforce page 'NewCaseCreateEdit'. This VF page is tied to 'NewCaseCreateEditController'.

The VF page calls 'doOnload' controller method. This method

1. Insert a new case

2. Construct return pagereference value and return it

 

This works perfectly in standard Salesforce. However in Service cloud console, a wired Error pop up opens when the user is being redirected to the edit page of the case. The pop up says 'Unknown Error' which has made troubleshooting even more difficult. The debug logs are fine and dont show any error or exception.


Below is the VF and apex code. Please let me know if such a functionality is feasible with service cloud console.

 

Apex Code

public class NewCaseCreateEditController
{
    private ApexPages.StandardController controller;
    
    //==================================================
    // CONSTRUCTOR  
    //==================================================
    public NewCaseCreateEditController(ApexPages.StandardController controller) {
      this.controller = controller;
      
    }
    
    public pageReference doOnload()
    {        
        PageReference            returnValue = null;
        Case                     newCase     = null;
        String                   personAccountID = '';        
        personAccountID = Apexpages.CurrentPage().getParameters().get('parentAcc');
        system.debug('person Account -->'+ personAccountID );
        newCase = new Case(
           Origin = 'Phone'
           ,Status = 'New'           
        );
        
        if(personAccountID!='')
        {
         
             List<Account> personAccounLst = [Select a.PersonContactId From Account a where a.IsPersonAccount = true and a.Id =: personAccountID limit 1];   
             if(personAccounLst.size()==1)
             {
                 newcase.ContactId = personAccounLst[0].PersonContactId;     
             }
        }
         
         
        Savepoint sp = null;
        try{
            sp = Database.setSavepoint();            
            insert newCase;
            returnValue = new ApexPages.StandardController(newCase).edit();            
            returnValue.getParameters().put('isdtp','vw'); //Console Agent                     
            returnValue.getParameters().put('retURL','/'+newCase.id );
            returnValue.getParameters().put('cancelURL',System.Page.AbandonPhoneCase.getUrl()
                    + '?id='
                    + newCase.id);            
            system.debug('Return URL-->'+returnValue);
        }catch(Exception e){
            if(sp != null){
                Database.rollback(sp);
            }
            ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'An occurred while opening new case',''));
            ErrorUtils.handleError(e);
        }
        return returnValue;
    }
}

 

VF page

<apex:page standardController="Case" extensions="NewCaseCreateEditController" action="{!doOnload}" sidebar="false" showHeader="false">
    <div style="display:none;" id="errorTitle">Insufficient Privileges</div>    
</apex:page>

 

 

Please let me know if you need more details.

 

Thanks,

Gopal

 

 

 

  • April 04, 2011
  • Like
  • 1

Hi All,

 

We are using Amazon s3 as storage server to upload files from salesforce.It is working fine.

But some clients are facing issues with file upload/download due to their proxy restrictions.So the user who is uploading

the file is clueless about what went wrong.To handle this, I am trying to connect to https://s3.amazonaws.com

using XMLHttpRequest in Java script.If the request fails, I am displaying that "Unable to connect to

https://s3.amazonaws.com. Reason: Proxy Restriction".

XMLHttpRequest is failing because of cross domain problem.Can anyone guide me through this.Does anyone have

better approach?

 

Thanks

Gops

  • July 06, 2009
  • Like
  • 0

Hi all,

I came to know that case object can be shared using salesforce to salesforce feature in suimmer '09 release.Thats pretty cool.I want to know if solution object can be shared using salesforce to salesforce.

 

Thanks

Gops

  • May 18, 2009
  • Like
  • 0

Hi All,

 

I want to login to another salesforce instance and fetch the cases to my instance.Do we need to generate WSDL for the target instance and consume the WSDL here in the source instance? Is thsi approach correct or is there any other better approach to get the cases using Apex.

  • May 06, 2009
  • Like
  • 0

Hi All,

 

I want to import/export cases from one salesforce system to another.

I thought of having a visual force page say "Import cases", which will contain a button "import cases from System A".This should invoke an apex class which will query the cases object of other system(salesforce A) and display the cases in the visual force page.

As I am new to Apex and Visual force ,I dont know how to proceed from here.I need guidence to acheive this.

Is there any easier way to acheive this?

 

Thanks

Gops

  • April 28, 2009
  • Like
  • 0

Hi all,

 

I have a custom field of type email for Contact tab( field Name:personal emailId).I am also using the standard email field that comes up with contact object.Now when I create an event or task, I need to verify if the the standard email field for contact is empty then I need to send the event notification to the email specified in custom email field.If the standard email field is not empty then I need to use the standard field for event notification.

 

Thanks in advance

Gops

  • April 06, 2009
  • Like
  • 0
I am new to Salesforce.I want to buid a discussion forum like the one what we have for  Salesforce community site.I found ideas object to be nearest to the discussion board.But it does not have features like comment threading(comment on comment).And also I want to remove the feature of rating for Ideas object.Is there a way where I can clone the ideas object add extend the object to meet my needs.
  • March 19, 2009
  • Like
  • 0

Hi All,

 

I need to implement a custom button to create a new case and redirect user to edit page of newly created case. This should respect service cloud console. A use case is CSR users can click new case and do so many things before saving the case. So the actual creation time will not be captured if we go with the standard new case. The users may feel the case is not valid and may opt to cancel the case in such scenario, user should be asked for confirmation before canceling the case.

 

For this I created new custom button 'Create and Edit'. This button invokes a visualforce page 'NewCaseCreateEdit'. This VF page is tied to 'NewCaseCreateEditController'.

The VF page calls 'doOnload' controller method. This method

1. Insert a new case

2. Construct return pagereference value and return it

 

This works perfectly in standard Salesforce. However in Service cloud console, a wired Error pop up opens when the user is being redirected to the edit page of the case. The pop up says 'Unknown Error' which has made troubleshooting even more difficult. The debug logs are fine and dont show any error or exception.


Below is the VF and apex code. Please let me know if such a functionality is feasible with service cloud console.

 

Apex Code

public class NewCaseCreateEditController
{
    private ApexPages.StandardController controller;
    
    //==================================================
    // CONSTRUCTOR  
    //==================================================
    public NewCaseCreateEditController(ApexPages.StandardController controller) {
      this.controller = controller;
      
    }
    
    public pageReference doOnload()
    {        
        PageReference            returnValue = null;
        Case                     newCase     = null;
        String                   personAccountID = '';        
        personAccountID = Apexpages.CurrentPage().getParameters().get('parentAcc');
        system.debug('person Account -->'+ personAccountID );
        newCase = new Case(
           Origin = 'Phone'
           ,Status = 'New'           
        );
        
        if(personAccountID!='')
        {
         
             List<Account> personAccounLst = [Select a.PersonContactId From Account a where a.IsPersonAccount = true and a.Id =: personAccountID limit 1];   
             if(personAccounLst.size()==1)
             {
                 newcase.ContactId = personAccounLst[0].PersonContactId;     
             }
        }
         
         
        Savepoint sp = null;
        try{
            sp = Database.setSavepoint();            
            insert newCase;
            returnValue = new ApexPages.StandardController(newCase).edit();            
            returnValue.getParameters().put('isdtp','vw'); //Console Agent                     
            returnValue.getParameters().put('retURL','/'+newCase.id );
            returnValue.getParameters().put('cancelURL',System.Page.AbandonPhoneCase.getUrl()
                    + '?id='
                    + newCase.id);            
            system.debug('Return URL-->'+returnValue);
        }catch(Exception e){
            if(sp != null){
                Database.rollback(sp);
            }
            ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'An occurred while opening new case',''));
            ErrorUtils.handleError(e);
        }
        return returnValue;
    }
}

 

VF page

<apex:page standardController="Case" extensions="NewCaseCreateEditController" action="{!doOnload}" sidebar="false" showHeader="false">
    <div style="display:none;" id="errorTitle">Insufficient Privileges</div>    
</apex:page>

 

 

Please let me know if you need more details.

 

Thanks,

Gopal

 

 

 

  • April 04, 2011
  • Like
  • 1

Hi All,

 

We are using Amazon s3 as storage server to upload files from salesforce.It is working fine.

But some clients are facing issues with file upload/download due to their proxy restrictions.So the user who is uploading

the file is clueless about what went wrong.To handle this, I am trying to connect to https://s3.amazonaws.com

using XMLHttpRequest in Java script.If the request fails, I am displaying that "Unable to connect to

https://s3.amazonaws.com. Reason: Proxy Restriction".

XMLHttpRequest is failing because of cross domain problem.Can anyone guide me through this.Does anyone have

better approach?

 

Thanks

Gops

  • July 06, 2009
  • Like
  • 0

Hi All,

 

I want to login to another salesforce instance and fetch the cases to my instance.Do we need to generate WSDL for the target instance and consume the WSDL here in the source instance? Is thsi approach correct or is there any other better approach to get the cases using Apex.

  • May 06, 2009
  • Like
  • 0

Hi All,

 

I want to import/export cases from one salesforce system to another.

I thought of having a visual force page say "Import cases", which will contain a button "import cases from System A".This should invoke an apex class which will query the cases object of other system(salesforce A) and display the cases in the visual force page.

As I am new to Apex and Visual force ,I dont know how to proceed from here.I need guidence to acheive this.

Is there any easier way to acheive this?

 

Thanks

Gops

  • April 28, 2009
  • Like
  • 0