dbr.editable type='select'

(3 posts) (2 voices)

Tags:

  1. eugfri, Member

    hi,
    I have editable field using dbr.editable and I would like to be able to present user with drop down of choices for the value selection which would be dynamic - i.e. based on value of another column in the table.

    Instead of:
    SELECT 'dbr.editable', '[CustomFieldValue]', 'sp_DBR_CustomFieldsCategorySubEdit', 'inLogin=[inLogin]', 'inID=ID', 'inFieldValue=CustomFieldValue', 'type=select', "select=select 'Gen9/Gen8' AS Generation UNION select 'Gen7/Gen6' AS Generation"; SELECT ID, CustomFieldName, CustomFieldValue FROM CustomFieldsCategorySub WHERE partnumber=inPartNumber and type=inType;

    I would like to do something like this:

    SELECT 'dbr.editable', '[CustomFieldValue]', 'sp_DBR_CustomFieldsCategorySubEdit', 'inLogin=[inLogin]', 'inID=ID', 'inFieldValue=CustomFieldValue', 'type=select', "select=select mydb.myfunction(CustomFieldName)"; SELECT ID, CustomFieldName, CustomFieldValue FROM CustomFieldsCategorySub WHERE partnumber=inPartNumber and type=inType;

    The purpose here is to give user different dropdown choices depending on value of CustomFieldName column the row in my CustomFieldsCategorySub table, which is being edited.

    Unfortunately, I am using MySQL where function can not return result set and I don't know if such approach would even work with dbr.editable.
    Is there something you can suggest?
    Is there way to dynamically generate values for the dropdown of "type='select'" in dbr.editable?

    Thank you
    Eugene

  2. myDBR Team, Key Master

    Eugene,
    as function cannot return a result set, use a procedure instead:

    SELECT 'dbr.editable', 'CustomFieldValue', 'sp_DBR_CustomFieldsCategorySubEdit', 'inID=ID', 'inFieldValue=CustomFieldValue', 'type=select', "select=sp_proc_for_selection [CustomFieldName]";

    Also, there is no need to pass on the inLogin (unless you have changed it), as myDBR will fill in the value automatically.

    --
    myDBR Team

  3. eugfri, Member

    Thank you! This works perfectly - exactly as I needed.


Reply

You must log in to post.