SQS configuration for Custom Relate Field

I have this custom view for Notes in dc_lender Module. I have two relate fields one is Banker Contact for dc_lender_contact module and second is Loan Program for dc_loan_program module. when i click on arrow icon a popup display with related module record name which is perfect. now i want when a user write something in input field, it show name suggestion in dropdown from related module record. By default SuiteCRM have this functionality but as i mentioned it is custom view we cannot use default functionality. Please help me out to resolve this issue.

<div class="col-xs-12 col-sm-12 edit-view-row-item" style="margin-top: 30px !important;">
        <!-- Banker Contact -->
        <div class="col-xs-12 col-sm-2 cstm_main_label_relate_to">
            Relate To:
        </div>
        <div class="col-xs-12 col-sm-1 cstm_label_relate_to" style='margin-right: 10px; !importent'>
            Banker Contact:
        </div>
        <div class="col-xs-12 col-sm-3 edit-view-field yui-ac" type="parent" field="parent_name">
            <input type="text" name="banker_contact" id="banker_contact" class="sqsEnabled yui-ac-input" value="{$banker_contact}" autocomplete="off" style="width: 60% !important">
            <input type="hidden" name="banker_contact_id" id="banker_contact_id" value="">
            <span class="id-ff multiple">
                <button type="button" name="btn_banker_contact" id="btn_banker_contact" class="button firstChild">
                    <span class="suitepicon suitepicon-action-select"></span>
                </button>
                <button type="button" name="btn_clr_banker_contact" id="btn_clr_banker_contact" class="button lastChild">
                    <span class="suitepicon suitepicon-action-clear"></span>
                </button>
            </span>
        </div>

        <!-- Loan Program -->
        <div class="col-xs-12 col-sm-1 cstm_label_relate_to">
            Loan Program:
        </div>
        <div class="col-xs-12 col-sm-3 edit-view-field yui-ac" type="parent" field="loan_program">
            <input type="text" name="loan_program" id="loan_program" class="sqsEnabled yui-ac-input" value="{$loan_program}" autocomplete="off" style="width: 60% !important">
            <input type="hidden" name="loan_program_id" id="loan_program_id" value="">
            <span class="id-ff multiple">
                <button type="button" name="btn_loan_program" id="btn_loan_program" class="button firstChild">
                    <span class="suitepicon suitepicon-action-select"></span>
                </button>
                <button type="button" name="btn_clr_loan_program" id="btn_clr_loan_program" class="button lastChild">
                    <span class="suitepicon suitepicon-action-clear"></span>
                </button>
            </span>
        </div>
    </div>

Hi @jim.nancy23

Your posts sound a lot like they’re coming from ChatGPT or similar. That’s not really appreciated here. You’re telling a person that writes “SQS” on the topic title that “hey, there’s something called SQS that you could use!”

Your other posts are the same style. Then people reply to you and you ignore them.

You’re one post away from being banned and blocked.

I think it was better if you provide me a solution or guide me to resolve this issue instead analysis of my post. I have problem that’s why i came here to discuss with community. But i found most analyzer instead of problem solver. I was waiting from 2 to 3 hours for a response which will help me to solve not analyzer like. Please be Professional.
Thanks

@abdullah who are you replying to?

If you see my post above, I clearly addressed myself to Jim, not to you. Maybe you didn’t see that?

I don’t have any problem with you :slight_smile:

But I am afraid that I also don’t know a good answer to your question, otherwise I would have answered, as I always do.

Peace

Here’s from my notes. I know this works in SuiteCRM 7. I’ve never tried it in SuiteCRM 8. I’d love to know if it works:

Step 1: The Quick Search

The first example is how to complete this task using the Sugar Quick Search:

In your FTP client, navigate to your /custom/Extensions/modules/{MODULE NAME}/Ext/vardefs

From here you can either create a new file, or edit an existing file. Look for a file name sugarfield_{name_of_your_field}.php that’s the best place to add new code and maintain organization Open that up and add the following lines:

$dictionary['{YOUR MODULE NAME}']['fields']['{YOUR RELATE_FIELD NAME}']['populate_list'] = array('id','name','{FIELD_FROM_RELATED_MODULE}');

$dictionary['{YOUR MODULE NAME}']['fields']['{YOUR RELATE_FIELD NAME}']['field_list'] = array('account_id_c','account_name','{THE ID OF YOUR FIELD_TO_POPULATE ON THE EDITVIEW LAYOUT}');

RELATE_FIELD is the Relate field id we want to use (in the example, we used the account_name)

FIELD_FROM_RELATED_MODULE is the db name of the field we want to get from related module

FIELD_TO_POPULATE is the field in current module that we want to populate with value from FIELD_FROM_RELATED_MODULE

account_id_c is the hidden field in a Relate Field where the id of the record selected is stored

  • Note that the name should be the first item in the array because the auto complete of Relate field shows the result from the first item in the array

You’ll want to replace anything contained in curly brackets with the specific information for your application. The populate_list is a list of the database field names that you are going to be pulling from the database. The field_list is the list of fields that you are going to be placing these values. Once you have this in place, go to Admin/Repair/Quick Repair and this process will rebuild the vardefs file in /custom/modules/{MODULE NAME}/Ext/vardefs/vardefs.ext.php. That’s all there really is to it from a technology standpoint, you can add fields to the arrays to populate more than 1field as well.

After a repair and rebuild, if it does not work, Check the file cache/modules/{your_module}/{your_module}vardefs.php . It should have populate_list and field_list arrays in the field array $GLOBALS[“dictionary”]… If not delete/rename the file and do a Quick Repair and Rebuild and it should work.

Also make sure developer mode is not enabled. It will not work with developer mode enabled.

1 Like