What are reason logic hooks would work for Admin but not regular users?

I have recently started our CRM from scratch and created packages for all the customizations.   We have gone to production and realized that the logic hooks are not being done when the user is not an admin.

Please help..  

Parents
  • I should correct myself.  The logic hooks for course name and curriculum Type were running, but blanking everything out.  I found  that I needed to replace the following even though there were no known permission issues.

    $ctype = BeanFactory::getBean('Lev_Course_Catalog', $focus->lev_course_catalog_id_c); 

    with

    $ctype = BeanFactory::getBean('Lev_Course_Catalog', $focus->lev_course_catalog_id_c, array('disable_row_level_security' => true));

Reply
  • I should correct myself.  The logic hooks for course name and curriculum Type were running, but blanking everything out.  I found  that I needed to replace the following even though there were no known permission issues.

    $ctype = BeanFactory::getBean('Lev_Course_Catalog', $focus->lev_course_catalog_id_c); 

    with

    $ctype = BeanFactory::getBean('Lev_Course_Catalog', $focus->lev_course_catalog_id_c, array('disable_row_level_security' => true));

Children
  • BeanFactory::getBean('<module>', $id) will give you a new empty Bean if that id does not exist.

    Whenever you know the ID I recommend you use BeanFactory::retrieveBean('<module>', $id)

    this will give you the actual bean with that ID or nothing at all.

    Then you can add a check in your code to make sure that the bean was actually retrieved, for example:

    if (!empty ($focus->lev_course_catalog_id_c)){
    
      $LevBean = BeanFactory::retrieveBean('Lev_Course_Catalog', $focus->lev_course_catalog_id_c);
    
      if(!empty($LevBean)){
    
        //You've got the bean!
    
      }else{
    
        //No record found with that ID
    
      }
    
    }else{
    
      //you didn't have an ID to start with
    
      $GLOBALS['log']->fatal("ERROR: $lev_course_catalog_id_c is empty"));
    
    }