Access Control unable to find the value of --None-- for demand record

MBarrott
Mega Sage

I have modified the Access Control dmn_demand.type so that the Type field can be modified on the demand form if the value is --none--. Right now it is not detecting it as this and instead remaining in read-only mode. 

 

I thought that this value was simply null or blank but this doesn't seem to be working, see code below:

answer=false;

if((JSUtil.notNil(current.getValue('type')) && current.getValue('type').startsWith('no_conversion_')) ||
   (current.getValue('type') == 'project' && current.project.nil()) ||
   (current.getValue('type') == '' && current.project.nil()) || // added
   (current.getValue('type') == 'enhancement' && current.isValidField('enhancement') && current.enhancement.nil()) ||
   (current.getValue('type') == 'enhancement' && !current.isValidField('enhancement')) ||
   (current.getValue('type') == 'change' && current.change.nil()) ||
   (current.getValue('type') == 'defect' && current.isValidField('defect') && current.defect.nil()) ||
   (current.getValue('type') == 'defect' && !current.isValidField('defect')))
	answer = true;

 

 

 

1 ACCEPTED SOLUTION

Michael Jones -
Giga Sage

Try updating the line you added to be: 

(current.getValue('type') == null && current.project.nil()) || // added

I think in this case current.getValue is returning null / undefined rather than a string. 

 

 

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

View solution in original post

3 REPLIES 3

Michael Jones -
Giga Sage

Try updating the line you added to be: 

(current.getValue('type') == null && current.project.nil()) || // added

I think in this case current.getValue is returning null / undefined rather than a string. 

 

 

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

Doesn't look like this worked. 

 

I'm wondering if the current.project.nil() needs to be adjusted since it isn't checking against 'project' anymore 

This did it! Greatly appreciate the help. 

 

At first it wasn't working but I remembered there was still a default value within the dictionary for Type. Removing that and modifying the code resolved the issue.