Results 1 to 9 of 9

Thread: Quickcreate Case

  1. #1
    swaroops1 is offline Senior Member
    Join Date
    Jul 2010
    Posts
    43

    Exclamation Quickcreate Case

    Dear Members,

    The problem I am facing is in the Opportunity Detailview, I have a subpanel case.

    When I open case using quickcreate Accounts field would be blank.

    I searched the forums, found that the solution given is auto filling works if the field in quickcreate is based on parent module that holds the subpanel.

    But here the case is different,

    I have Opportunity Detailview with case subpanel and want accounts field to be filled up with which opportunity is linked.

    Hope my question is clear.. Please help me to solve this ..

    Thanks in advance

  2. #2
    shailendra001's Avatar
    shailendra001 is offline A Prolific Poster
    Join Date
    Oct 2008
    Location
    Bangalore India
    Posts
    255

    Default Re: Quickcreate Case

    Hi

    In csutom/modules/Cases/views/view.edit.php

    try something like this
    Code:
    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
    
    require_once('include/MVC/View/views/view.edit.php');
    require_once('include/utils.php');
    
    
    class CasesEdit extends ViewEdit {
    	    
        function display() {
    		global $current_user;
    		global $timedate;
    		
    		if($_REQUEST['return_module'] == 'Opportunities' && $this->bean->id==""){
    			$opp_id  = $_REQUEST['return_id'];
    			require_once('modules/Opportunities/Opportunity.php');
    			
    			$opp_obj 			= new Opportunity();
    			$opp_data 			= $opp_obj->retrieve($opp_id);
    			$this->bean->account_name 	= $opp_data->account_name; // for account in case modules 
    			$this->bean->account_id 	= $opp_data->account_id;  // account id  
    			$this->bean->opportunities_cases_name  = $opp_data->name; // opportunities name 
    			$this->bean->opportunities_cases_name   = $opp_id; // opportunities id 
    			
    		}
    		
    		parent::Display();
        }
        
        
        
        
    }
    ?>

    modify it according to your fields name (get the name and id through inspect element )

    this may help

    Regards
    Shailendra
    Last edited by shailendra001; 2010-08-27 at 05:59 AM.

  3. #3
    swaroops1 is offline Senior Member
    Join Date
    Jul 2010
    Posts
    43

    Exclamation Re: Quickcreate Case

    Hi Shailendra,

    Thanks for your quick response.

    I will clear you with my doubt.

    I am using Opportunity Detailview. I have linked Case to opportunity and I have subpanel called case.

    When I open to create a new case using quickcreate I don't find Account Name Auto Filled.


    Thanks in advance..

  4. #4
    shailendra001's Avatar
    shailendra001 is offline A Prolific Poster
    Join Date
    Oct 2008
    Location
    Bangalore India
    Posts
    255

    Default Re: Quickcreate Case

    Quote Originally Posted by swaroops1 View Post
    Hi Shailendra,


    I am using Opportunity Detailview. I have linked Case to opportunity and I have subpanel called case.

    When I open to create a new case using quickcreate I don't find Account Name Auto Filled.


    Thanks in advance..
    Hi !
    my assumption for

    cases in Opportunities sub panel : define relationship through studio between Opportunities and Cases modules .

    then from that sub panel you would be trying to create Cases , right ?

    if yes put this code ,should work with little modification ( i have not tested , this is just first hand code )

    Regards
    Shailendra

  5. #5
    swaroops1 is offline Senior Member
    Join Date
    Jul 2010
    Posts
    43

    Exclamation Re: Quickcreate Case

    Hi Shailendra,

    Exactly..

    I created the file in custom/modules/Cases/views/view.edit.php

    Pasted the code which was specified by you, but no effect.

    Is there anything that in addition to it needs to be done. ? ?

    It took me a whole day to make it work, still not able to get it..

    Thanks in advance..

  6. #6
    shailendra001's Avatar
    shailendra001 is offline A Prolific Poster
    Join Date
    Oct 2008
    Location
    Bangalore India
    Posts
    255

    Default Re: Quickcreate Case

    Hi !

    I gave relationship between Opportunities and Cases ( one to many ) , when i created a new case from opportunity sub panel , detail view page of case had account name in Accounts field without any code change .
    remove the code i gave you , here it is not required
    just try repair relationship

    and clear cache

    this may help
    Regads
    Shailendra

  7. #7
    swaroops1 is offline Senior Member
    Join Date
    Jul 2010
    Posts
    43

    Exclamation Re: Quickcreate Case

    Hi Shailendra,

    As you said I removed the code and tried to create a new case from opportunity detailview through case subpanel.

    It had not filled the account name by default. But the auto complete option is working.

    And I removed the Account name field from case quickcreate, But As you said in case detail view , the account name was blank.

    Please help if you have any idea and thanks in advance..

  8. #8
    swaroops1 is offline Senior Member
    Join Date
    Jul 2010
    Posts
    43

    Exclamation Re: Quickcreate Case

    Hi,

    Is there any idea I can solve this problem.. After disappointment I added link to opportunity field removing accounts.

    That was working fine, but now it gives the error "No match for field" even though the text is filled with appropriate opportunity name. Pl help me solve this problem either making account name auto fill or in removing "No match for field" error from opportunity link field in cases quickcreate form.

    Thanks in advance.

  9. #9
    swaroops1 is offline Senior Member
    Join Date
    Jul 2010
    Posts
    43

    Exclamation Re: Quickcreate Case

    Hi all,

    At last found a solution for myself.

    Don't know whether it is best or not ? But i have removed the validation for the opportunity name as it was pre populating with the same name as the Opportunity name But I don't know whether they are linking to the same Opportunity.

    Here is the code below
    function addToValidateBinaryDependency($field, $type, $displayName, $required, $prefix='',$compareTo){
    if($field != 'opportunities_cases_name')
    $this->script .= "addToValidateBinaryDependency('".$this->formname."', '".$prefix.$field."', '".$type . "', $required,'".$this->stripEndColon(translate($displayName,$this->sugarbean->module_dir)) . "', '$compareTo' );\n";
    }

    I changed in include/javascript/javascript.php

    Please help me to solve this problem...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 9
    Last Post: 2009-12-18, 11:39 AM
  2. Automatically email Case Resolution Notes on Case Closed
    By Tayler in forum Feature Requests
    Replies: 7
    Last Post: 2009-10-02, 10:59 AM
  3. file not found errors in link for Case in case tasks.
    By jenjen in forum Installation and Upgrade Help
    Replies: 0
    Last Post: 2009-01-29, 02:15 PM
  4. QuickCreate Case Layout Editing
    By HankG in forum Help
    Replies: 4
    Last Post: 2008-11-04, 08:18 AM
  5. Replies: 0
    Last Post: 2006-06-20, 11:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •