Highlighted
Honored Contributor.
Honored Contributor.
960 views

How to make a field as manadatory.

Hi Experts,

My requirement is to make the completed by field as mandatory when the work complete date is filled.

Attaching the image of the fields.

Could you please help me how I can do it via format control.

Thanks in Advance.

Regards,

Sandhu Mol

 

0 Likes
15 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: How to make a field as manadatory.

Access the format control of the form. See https://docs.microfocus.com/SM/9.61/Codeless/Content/tailor/format_control/concepts/accessing_format_control.htm

You need the validations part of format control. See screenshot here https://docs.microfocus.com/SM/9.61/Codeless/Content/PD_tailoring_BPG/Mandatory_validation.htm?Highlight=mandatory%20validations but do not follow the steps.

You need a not null complete date and a null completed by condition in the validation field. Set Update to true so that it only fire when record is being updated. Set Focus to completed by to point the cursor here for user to fill.  Add a message like, Completed by is mandatory when complete date is provided.  You do not need to fill the message id field unless you want to use a message stored in scmessage.

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: How to make a field as manadatory.

Hi,

 

Thanks for the replay.

I have done the changes in fc as you suggested. Attached the screenshot.

 

But the message saying that the field is not coming as we expected.

 

And it is working for that following scenario.

 

When the work completion date is empty and when we click on the save or ok button the mandatory message is showing.

 

Could you please help me to resolve this or please correct me if I am wrong.

 

Thanks & Regards,

Sandhu Mol

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: How to make a field as manadatory.

Try change:

from: true

to: not same(close.time in $file, close.time in $file0) and not null(close.time in $file)

and also 

from: not (null(close.time in $file)) and null(Completedby in $file))

to: not null(Completedby in $file)

****************

And by the way you can set in FD do not display Completedby field while close.time is empty.

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: How to make a field as manadatory.

Hi,

 

I have done the changes as you suggested. But I am getting the error(attached), when I am trying to save a record.

 

Could you please suggest me a solution?

 

Thanks in Advance.

 

Regards,

Sandhu Mol

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: How to make a field as manadatory.

Use Copy-Past from my post to your SM

Your are set too much brackets.

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: How to make a field as manadatory.

I am using SM 9.40.

 

I did copy- paste only.. But SM is automatically adding those extra brackets.

 

Regards,

Sandhu Mol

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: How to make a field as manadatory.

Please press "show expanded form" to better view your Validation tab.

Try to type it yourself then. Make a screenshot.

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: How to make a field as manadatory.

It looks like the wpopt fc is not working.

I tried by saving a wrong condition(eg: notnul(Completedby) and it got saved. And it looks like the fc is not accepting any new conditions.

 

Can anyone please suggest me a solution?

 

Thanks & Regards,

Sandhu Mol

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: How to make a field as manadatory.

not null()

And space between 2 words.

But to do something please give me screenshots of your current FC (for this new condition) in Exapnded mode\line.

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: How to make a field as manadatory.

Please find the attached image of a wrong condition which got saved.

Thanks & Regards,

Sandhu 

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: How to make a field as manadatory.

Please take a screenshot of "Expended form" of FormatControl.

And what condition is this - is this new one and not related with your topic ?

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.