Disable Edit Link from ListView

SugarCRM module’s List View comes with default options like an edit view link and  a checkbox besides it.

Many times users feels a need to hide the link and/or checkbox.However this cannot be done from SugarCRM admin panel,but you can do it if you have access to its files.

Create a file called view.list.php at custom/modules/{module}/views/view.list.php and write the code below.If you have the file view.list.php at
modules/{module}/views/ copy it to custom/modules/{module}/views else create a new one in custom.

Write the below code therein.

require_once('include/MVC/View/views/view.list.php');
class {module}ViewList extends ViewList
{
    function {module}ViewList()
    {
        parent::ViewList();
    }
    function Display()
    {
        $this->lv->quickViewLinks = false; // Removes Edit View Link
        $this->lv->multiSelect = false; //    Removes Check Box     
        parent::Display();
    }
}

 

before-listview
Before
disable-edit-listview-sugarcrm
After

 

 

 

 

Test your addon on SugarCRM On-Demand.

sugarcrm-logo
SugarCrm

Sugar On-Demand comes with a lot of module loader restrictions which might make your module installation a complete failure.I faced the same issue when installing the addon I created and installing it on Sugar On-Demand.

You have created a great module but will it work on Sugar On-Demand is big damn question.

Thankfully you can test this on your local SugarCRM environment and save the programming and support time later.

You just need to set package scanner  to be true.

To do this simply add the following line to your config_override.php file.


<?php
$sugar_config['moduleInstaller']['packageScan'] = true;

 

Now when you you install the package it will work same as it will do it on Sugar On-Demand version.

It will then return all the issues found in the package that makes it incompatible with On-Demand version.

error-installing-addon

 

 

 

Change SugarCRM Admin Password with SQL

reset-sugarcrm-admin-password
Reset Password

Suppose you or someone else have installed SugarCRM ,but you are not able to get  its access , the only wayout is to change/reset the admin password via SQL.

Get into the respective database and find table users.Firstly you will have to find the active admin account.

The active admin account is one whose is_admin column is set to 1 and the column status is set to  active .

The below sql query displays all active admin users.


SELECT user_name FROM users WHERE is_admin = '1' AND status = 'Active';

The password is simply a md5 hash, therefore you can set it to any value you like via:

UPDATE users SET user_hash = MD5('PASSWORD') WHERE user_name = 'USERNAME';

 

Make custom EditView work for Quickcreate.

sugarcrm

In this article I will show you how you can make your Custom EditView of any module also work for quickcreate via subpanels.

This took me way too long to figure out as well and I am happy to share the quite easy answer with you!

In your custom view.edit.php file add the following line inside the __construct() method:


$this->useForSubpanel = true;

The above code will make custom edit view functions to also work for quickcreate.

 

How to create a Custom Scheduler in SugarCRM

SugarCRM comes with its pre-defined Schedulers which you can set from Admin->Schedulers.Schedulers comes into place when you want to perform a recurring job .It is just as Linux Crontab.

crm-scheduler
CRM Scheduler

To create a custom scheduler you can use the Ext framework of Sugarcrm.

STEP 1 : Create a file MyJob.php in custom/Extension/modules/Schedulers/Ext/ScheduledTasks/ with the following code therein

<?php
$job_strings[] = 'MyJob';
 function MyJob(){
 //this is where you put the custom code
 }

STEP 2 : The next step is to create a language file for our custom scheduler.Create en_us.MyJob.php in custom/Extension/modules/Schedulers/Ext/Language/ with the following code

<?php
$mod_strings['LBL_MYJOB'] = 'My Custom Job';

STEP 3 : Do a Quick Repair and Rebuild . Your custom scheduler will now be available in the Scheduler dropdown list.After which you can set its execution interval.

NEVER DO THIS

Creating custom Scheduler via _AddJobsHere.php is not recommended.Its a shared file and any other customizations can simply override your scheduler.The safest way is to use the Ext framework discussed above.However you will have to use _AddJobsHere file for Sugar Version less than 6.4.