Lookup in detail

Hello, community!

This is a selection window for my lookup. Lets take this example, I should not be able to select collaterals that have remaining allocation 0. My problem is that this field is being populated by a process, and the regular lookup filtration does not work. Is there any way to make that select button throw an error/ not let the user save their pick? As in, if remaining allocation equals 0 => select button will do nothing.

Like 0

Like

1 comments

Hello Maria,

Modifying this module window is quite a hard task to do. I believe is your case attribute filter will work just fine:

attributes: {
			"{Your lookup column Name}": {
                "dataValueType": Terrasoft.DataValueType.LOOKUP,
                "lookupListConfig": {
                    "filters": [
                        function() {
                            var filterGroup = Ext.create("Terrasoft.FilterGroup");
                            filterGroup.add("IsNotNull",
                                Terrasoft.createColumnFilterWithParameter(
                                    Terrasoft.ComparisonType.GREATER,
                                    "[{Your lookup column Name}:Id].RemainingAllocation", 0));
                            return filterGroup;
                        }
                    ]
                }
            }
		},

With these records where the remaining allocation is 0 will not be displayed.

Show all comments