REQIRED only if CREATE/ENTER NEW, not on EDIT?

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
lueu
Posts: 89
Joined: Tue Mar 07, 2023 11:49 pm

REQIRED only if CREATE/ENTER NEW, not on EDIT?

Post by lueu »

Can I force REQUIRED for only CREATE/ENTER NEW, and not EDIT? If I tick Required on the attribute, it applies to both creating and updating, but I need these attributes to only be required when creating a new record. The attributes in question is set in creating new objects through reference BOs and rules, and will not be edited in the editing form. But if ticked as required, the editing form can not be saved.

Can I write somthing in my ENTER NEW process rules to make these attributes required when new object is created, intstead of ticking the required checkbox for the attribute?
PointsWell
Posts: 1460
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: REQIRED only if CREATE/ENTER NEW, not on EDIT?

Post by PointsWell »

Code: Select all

IF BO IS NEW AND BO.Attribute IS UNDEFINED THEN REPORT ERROR 'Attribute must have a value'
hpl123
Posts: 2598
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: REQIRED only if CREATE/ENTER NEW, not on EDIT?

Post by hpl123 »

Also take a look at the presentation rules which may be used for scenarios like this. Another thing I have done in the past is, I set all attributes to non required BUT I place a red asterix in the label name and then I use regular rules to control, report error etc. for those "required" (label) attributes.
Henrik (V8 Developer Ed. - Windows)
lueu
Posts: 89
Joined: Tue Mar 07, 2023 11:49 pm

Re: REQIRED only if CREATE/ENTER NEW, not on EDIT?

Post by lueu »

Thank you both!

I am now testing PointsWells suggestion, combined with an asterix (not red yet, though) in the label name. Will also take a look at the presentation rules, thanks for the tip!
Post Reply