Question

Disabling lookup values

Hi colleagues.

I have a question on basic functionality.

Is there any opportunity to disable some values in the lookup without additional development?

Thanks in advance.

Like 0

Like

2 comments

Hi Helen, I can help you, but with a little of coding, is simple, on Attributes section add the following (change "UsrYourLookup" by your lookup name):

"OnUsrYourLookupChangedAttribute": {
	dependencies: [
	 {
	  columns: ["UsrYourLookup"],
	  methodName: "onUsrYourLookupChanged"
	 }
	]
   },

And on Methods Section add (also changing your lookup name) and changing "VALUE NOT ELEGIBLE" by the value you will not available to select by your usuers in the following code:

onUsrYourLookupChanged: function() {
	var result = {
	 isValid: true,
	 invalidMessage: ""
	};
 
	//
	if ( this.get( "UsrYourLookup" ) ? ( this.get( "UsrYourLookup" ).displayValue === "VALUE NOT ELEGIBLE" ) : false ) {
	 result.isValid = false;
	 result.invalidMessage = "VALUE NO ALLOWED";
	 this.set( "UsrYourLookup", null );
 
	}
 
	return result;
},

I expect this helps you, if somebody had a better solution I also want to know it!

Regards,

Julio Falcon

On Competence, CHILE

Dear Helen,

The option to mark the lookup value as inactive will be available in one of the nearest releases. The information about it is available in the Upcoming Releases already:

Until then you can use the workaroud provided by Julio above.

Lisa

Show all comments