php - SugarCRM Custom Dropdown Field -


I have created a custom dropdown field in the Leeds module. It dynamically manages users from the table with the keying value = Is being brought in as

The field works fine, but when editing mode (create a new staircase) ... value is not being stored and the key is not being stored instead.

I mean the ID is being stored instead of 'James Bond' .. which is like '78 9 6877 '

Now the funny thing is that Garkman Modules) The name has been displayed properly in detail, as I wanted to work it only to display it in the list and it gets stored in the database as a key or hash id.

This function is:

  function getUSERS ($ variant) {$ result ore = array (); $ Query = "Choose ID, (first_name + '' + last_name) AS dbo.users name ORDER first_name ASC"; $ Outcome [''] = ''; $ Result = $ bin- & gt; DB- & gt; Query ($ query); While ($ line = $ bény-> gt; & gt; fetch ($ result)) {$ result over [$ row ['id']] = $ line ['name']; } The result of return; }  

Dropdown keys / values ​​in the sugar work as coupling, the key is Which is stored, does a suitable lookup to display values ​​in the database and Chinese.

Instead of working as your code differently in the form of $ resultArray [$ row ['id']] = $ line ['name'] , You can use the username - $ resultArray [$ row ['username']] = $ row ['name'] because the username should be unique, but for the users in the list See more will be worthwhile.

However, is there any reason that you are not using the related module to the user module? It should solve all your problems without any coding.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

lua - HowTo create a fuel bar -