Using Value of Advanced Search Field

Hi we have a Advanced search select as shown, I want to populate the Name Field displayed in the Advanced search select in a text field.

Currently I am doing it by using the selected ID, Call the sdata to get the field value required and then populate the text filed. How ever this is not the best use of resource. If I can directly get the value from the search select field it should be much quicker.

Let me know if there are any way to access the Search select Advanced selected value all the rows.

The select field when selected now displayed the Code, we need this also and Description to have the text.

  • 0

    Suresh

    In your SData call are you referencing the exposed table or a view? A simple view against a view product that just contains the ID and name of the product should be very quick to respond.

    But I wonder, why are you de-normalising anyway? Why not just take the ID field across. The product name (depending on how the SSA field is set up) could de displayed in the resulting screen. See for example

    community.sagecrm.com/.../sage-crm-v7-1-enhance-your-advanced-search-selects.aspx

    If you do need to de-normalise then it may be fastest to do this on save with a table level script.

  • 0

    If I am understanding correctly what you are wanting to do....

    Take this scenario, I have the pers_companyId field, and I want to write the company name to a new field when it is changed.

    When the Search Select Advance is changed, it writes the company name into a field called _HIDDENpers_companyidTEXT, so I can write some code and put it in the onchange of the pers_companyid field, to take the value of the aforementioned field and write it somewhere else, example:

    var CN = $('#_HIDDENpers_companyidTEXT').val();

    $('#field_name_here').val(CN);


    That way it is all handled on the client, and no call back to the server needed.

    You just need to check if you have the hidden text field for the product field you are using.

    Hope that helps.

  • 0

    Thanks Jeff / Toby,

    Your answers helped me. To be more precise on the issue the Search select advanced when selected will display the Product Code, It used the technique described in the Article Jeff has shown, I have checked the hidden filed and it has only the Product code displayed and not the Project Name. The user want to see Product code and Product Name. Using translation I can show code + Name in the selection field but User wants it to be displayed separately. SO I have used the simple view and SDATA to show.

    Thanks for the quick replies.