Editable PickList Column: InforCRM 8.3

This post is an update of one I made almost 5 years ago, about enabling edits to picklist columns on the InforCRM (then SalesLogix) web client.

On 8.3 the grid was revamped, for some reason the picklist column is STILL not editable by default. It is also a bit less trivial to enable the edit function than in the previous version – there are more changes to the template, though the javascript is less of a hack. You’ll want to set the following:

  • Mark the column as editable in the XML, same as before.
  • Update the template at Model/QuickForms/Web/QFSDataGrid.WebControlScriptRenderingTemplate.vm. It should read like this:
    #macro(doPickListCol $col)
    {
        #doDefaultColParts($col),
    	#doStyleScheme($col)
        #doColIsEditableCondition($col),
    	type: PickList,
    	pickListName: '${col.PickListName}',
        storageMode: #if ($col.StorageMode == "Text") 'text' #elseif ($col.StorageMode == "Code") 'code' #elseif ($col.StorageMode == "ID") 'id' #end,
        displayMode: '${col.DisplayMode}',
        editOn: 'click',
        editorArgs: {
          pickListName: '${col.PickListName}',
          storageMode: #if ($col.StorageMode == "Text") 'text' #elseif ($col.StorageMode == "Code") 'code' #elseif ($col.StorageMode == "ID") 'id' #end,
          displayMode: '${col.DisplayMode}',
        },
        editor: DropDownSelectPickList
    }
    #end
    
  • In that same template, you also need to add an include for the dropdown control (DropDownSelectPickList) – do a search for EmailControl and update the code to look like this. This is a little bit after a comment that reads “Actual Grid Start”:
    			'Sage/UI/Controls/GridParts/Columns/EmailControl',
    			'Sage/UI/Controls/CurrencyTextBox',
    			'Sage/UI/Controls/DropDownSelectPickList',
    			'Sage/UI/Controls/GridParts/Columns/LookupControl',
    

    And you also need to add the variable for it, just below:

    ..... CurrencyControl, DropDownSelectPickList, LookupControl, when) {
    
  • I pasted my file, with those 3 changes, as a gist, but the changes should be applied manually so they don’t override a potential future update (this one comes from an 8.3.8 repository)
  • Add this javascript on form load:
    // Fix for Picklist column in Sage - the editable option does not work on it
    ScriptManager.RegisterStartupScript(this, GetType(), "PicklistColumn",
        @"
            require(['Sage/UI/Controls/DropDownSelectPickList'], function(PickListWidget) {
                PickListWidget.extend({
                    _setValueAttr: function(value) {
                        this.comboBox.set('value', value)
                    }
                })
            })
    	", true);
    
  • This should now work! You may note there is a javascript error reported when editing the value… I was not able to find where it comes from, but it does not appear to be impacting the functionality.

Leave a Reply

Your email address will not be published. Required fields are marked *