cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Mandatory Form Field

ToddDavey
Super Contributor

Hi all,

I am running HOEX V4 CP2 and want to make a form field mandatory.

The documentation says to add the Mandatory(Always) control to the Item, which I did.

Mandatory Business Line 3.jpg

 

 

My code in the PropertyPage:

businessLines=Item([Category <Business Line>]),Contains(AppsMap),Control(ListView),Name(Ministerial Responsibility),Title(Left),Param(NoDefaultColumn),Mandatory(Always)

 

When you open the object you get a nice red * next to the field title, but I am still able to remove the contents of the field and leave it blank. There does not appear to be any mandatory validation on the field.

 

 Mandatory Business Line 1.jpg

 

I updated the creation wizard using exactly the same line of code and this worked.  It prevents the object from being created when the field is null.  But this is pretty useless if I cannot prevent the users deleting the content after creation.

 

 

So my question is pretty simple, how can I make this field mandatory (ie: cannot be null)?

 

Thanks.

6 Replies

I have tried defining an attribute within the list view and making that mandatory, but that doesn't work either.

The only thing that seems to work is if I change the mutiplicity from Many to 1 and force the entry through the metaassociation.  This is really bad because it means I go from an extension to a customisation.  The MetaAssociation I am trying to force is the standard Category (Business Line) association and customising it shouldn't be necessary surely.

ToddDavey
Super Contributor

Hi Lionel,

Thanks for your reply. 

Why I say V4 is broken is because I have added the Mandatory control as per the documentation and it doesn't work.

No, I didn't have it working in previous versions.  This is the first time I have tried it.

Is it the official Mega position that the Mandatory control does not work for Listviews? 

 


@lionel wrote:

It works only for metaAttributes (in a listview or not), or for links displayed as metaAttributes.


Does this mean I can define an attribute within the listview and make that mandatory?

lionel
MEGA
MEGA

Hi there,

when you say that V4 is broken, does that mean that you had it work in previous version ?

I think that the mandatory option is not available for a listview. It works only for metaAttributes (in a listview or not), or for links displayed as metaAttributes.

ToddDavey
Super Contributor

Has anyone ever made a field mandatory?  If so how did they do it?

ToddDavey
Super Contributor

Hi Philip,  

 

Thanks for the suggestion.  I tried Mandatory(True), Mandatory(Yes) and Mandatory(Always).

All three do the same thing.  They give my the red * (Mandatory indicator), but there is no mandatory control on the field. 

 

It really seems like something in HOPEX V4 is broken.

png
MEGA
MEGA

Hi Todd,

 

Have you tried Mandatory(True) instead of Mandatory(Always)? See if that works.

 

Thanks,

Philip

Technical Support Engineer