Select Contacts linked to Accounts in Target Lists

Works perfect wasnt 100% correct. :frowning:
IĀ“ve just seen that the funktion adds the accounts to a target list, but not the linked contacts.

In the target list under contacts it still says ā€œNo Dataā€

hmm are you saying that if you go to the list view, select accounts, then use the ā€œAdd Contacts To Target Listā€, then select an account, then go to the target listā€¦there are no contacts?

Exactly. The account i selected is added as account to the target list, but no contacts.
There is no error message.

Using version Version 7.3.1.

do you have an IDE? or a something you can use for debugging purposes?

strange that it only adds the account as my instance adds the contacts and not the account?

have you set permissions on your machine?

quick repair and rebuild? deleted cookies and cache and stuff like that?

Unfortunately IĀ“m not capable of doing software developments - so I dont know what an IDE is and dont have any debugging software.
If you mean the permissions within the CRM - IĀ“m using a user with admin-rights at the moment.
Quick repair and rebuid has run but didnĀ“t change anything.
Deleted all browser data and tried three different browsers (Chrome, IE, FF) - nothing changed.

I select an account with 6 linked contacts, the account is added but no contacts.

uhh then you may hve a hit a blocked road as you have not used git either!

the only thing i suggest now it to double check you have added all of the files and saved them in the correct places.

Or when possible you a developers tool to try and go through the code and debug to see what has gone wrong!

goodluck

hiā€¦ i would really say using git is your best option.

http://stackoverflow.com/questions/6743514/how-can-i-fetch-an-unmerged-pull-request-for-a-branch-i-dont-own this will help you with fetching my pull request.

this will explain how to and what git/hub is

https://guides.github.com/activities/hello-world/

Hello!

I managed to get a error message on my test system:
Notice: Undefined index: enable_line_editing_list in C:\xampp\htdocs\suitecrm\include\ListView\ListViewSmarty.php on line 109

Does this help?

That is not an error but only a notice.

If you are on a Linux system, there are a few things you can do to reset permissions:

  1. Edit config.php
    in the root folder of your SuiteCRM installation there is a file called config.php
    If you open that file (I recommend that you use Notepad++ which you can download from here: https://notepad-plus-plus.org/download/v6.8.6.html ) and search for ā€˜default_permissionsā€™

Edit the following lines of code:

  'default_permissions' => 
  array (
    'dir_mode' => 1533, // (decimal equivalent of octal 2775) - this is my recommended value, but beware that it may cause some security issues. Others use 1517, 1528 0r 1533
    'file_mode' => 493,  // (decimal equivalent of octal 755) - this is my recommended value, but beware that it may cause some security issues. Others use 644, 660 or 664
    'user' => '<enter you user or leave blank - only the two single quotes with no space inside>',
    'group' => '<enter you group or leave blank - only the two single quotes with no space inside>',
  ),
  1. Edit include/utils.php
    Search for default_permissions (there are two occurrences in the file) and put the same things you entered in config.php.
    You will notice that one of the two occurrences has chgroup and chown: leave them as they are and add the two lines with user and group as shown above
    Beware that this is a non upgrade safe modification so, each time you upgrade your CRM you have to check that these changes are still there and, if not, reimplement them.

  2. Reset permissions on your SuiteCRM installation
    Since you donā€™t seem to have full access to your hosting system you can use the file contained inside the attached zip file) to reset permissions appropriately (I run it with a scheduler every 5 minutes!, but this is another issue)
    To use it: extract chperms.php from the .zip file and place it in your SuiteCRM root folder and invoke it in a separate browser tab in the following way: http://www.yoursite.com//chperms.php
    The file works only on Linux systems (if you have another system, eg Windows it will not work)


and resets permissions for you. It takes a few seconds to execute with no screen output. If you want to see what it is doing you have to edit the file and change the second line of the file from:
$chmod_debug_mode = FALSE;
to:
$chmod_debug_mode = TRUE;

(however, execution takes a lot longer since it will show you all the files and folders to which it is changing the permissions, and there are a few thousand)
This script resets permissions for a better use of your CRM.

Before you do anything of the above I recommend that you back up both all your SuiteCRM files as well as the database.

Hi Darren

I tested your modifications:

  1. I saved all your files
  2. Replaced the old ones with the new ones (except the language file which I updated manually because SuiteCRM 7.4 has changed plenty of labels to replace Sugar with Suite)
  3. Reset permissions manually
  4. Quick Repair and Rebuild
  5. Reset permissions manually (second time)
  6. Quick Repair and Rebuild(second time)
  7. went to Accounts List view
  8. Selected one account
  9. Added Contacts to Target List
  10. Went to target list

The account was ther but not its contacts

Any idea?

Hi Darren,

I did some investigation and found the following:

  1. The value of do_contacts is not being passed therefore the if statement in line 108 returns false so the relevant section of the code is not executed and skips to adding the accounts instead of the contacts.
                if($_REQUEST['do_contacts']){
  1. There is a typo in line 109 of modules/ProspectLists/TargetListUpdate.php.
    You incorrectly typed ā€˜Contacts3ā€™ instead of just ā€˜Contactā€™ (without the ending ā€˜s3ā€™) so the line should read:
                    $contacts = $focus->get_linked_beans('contacts','Contact');

instead of:

                   $contacts = $focus->get_linked_beans('contacts','Contacts3');

I have figured out a workaround but it will add both Accounts and contacts.
In line 108. instead of checking for do_contacts I check if the module is Accounts

                if($beanList[$_REQUEST['module']] == 'Account'){

It would be nice however, to be able to pass the value of do_contacts to give the possibility to add just the Contacts.

Do you have any clue on how to do it?
I spent time going through the php and javascript code and inserting various echos and alerts but I havenā€™t figured out why do_contacts is not being passed.

Hello amariussi!

I made your changes at my test system and its working fine now. But im my case itĀ“s only adding the contacts to the list, not the accounts as you stated.

thx

EDIT: I just saw that if you select multiple accounts in the list only the contacts of the first account are added to the list.