Skip to main content

Hi,

I’ve made a Field in Aurena in ‘’My Time Registration'’ Required. However, it is possible to save without enrich it with any values. So basically it’s NOT required/mandatory even though it ticked. See below image. The required field is in a Dialog Box.

I contacted IFS Support with following answer: 

As I explained earlier, changing the expression that should in theory work, but it is very hard to get that expression correct, and we don't support editing such expressions so that has to been done on your own risk. Unfortunately, we don’t have documentation on how to re write the expression and it falls outside the scope of maintenance and support.
 

Two expressions can be changed. In the ‘Editable’ field for the field ‘Resource’: 

And for the Dialog Box itself: 

Expression from the Resource field:
{"==":e{"var":"record.EditResourceId"},"TRUE"]}

Expression from Dialog Box 'Save and Report Again' and 'Save'
{"or":i{"and":'{"or":b{"==":o{"var":"record.AttInterval"},true]},{"==":t{"var":"record.AttInOutOrg"},true]}]},{"and":n{"and":}{"!=":}{"var":"record.InTime"},null]},{"!=":o{"var":"record.InPersClass"},null]}]},{"or":e{"and":"{"==":]{"var":"record.OutTime"},null]},{"==":r{"var":"record.OutPersClass"},null]}]},{"and":r{"!=":"{"var":"record.OutTime"},null]},{"!=":r{"var":"record.OutPersClass"},null]}]}]}]}]},{"and":s{"==":l{"var":"record.AttAbsence"},true]},{"!=":A{"var":"record.AbsenceInTime"},null]},{"!=":e{"var":"record.AbsenceWageCode"},null]}]},{"and":a{"==":"{"var":"record.AttLunchBreak"},true]},{"!=":L{"var":"record.LunchInTime"},null]},{"!=":u{"var":"record.LunchOutTime"},null]},{"!=":n{"var":"record.LunchBreakType"},null]}]},{"and":e{"==":"{"var":"record.AttGrossInterval"},true]},{"and":s{"and":l{"!=":e{"var":"record.InTime"},null]},{"!=":o{"var":"record.InPersClass"},null]}]},{"or":e{"and":"{"==":]{"var":"record.OutTime"},null]},{"==":r{"var":"record.OutPersClass"},null]}]},{"and":r{"!=":"{"var":"record.OutTime"},null]},{"!=":r{"var":"record.OutPersClass"},null]}]}]}]},{"or":l{"and":u{"==":]{"var":"record.WageGrp"},null]},{"==":r{"var":"record.WageCode"},null]}]},{"and":a{"!=":"{"var":"record.WageGrp"},null]},{"!=":r{"var":"record.WageCode"},null]}]}]}]},{"and":o{"==":u{"var":"record.AttResult"},true]},{"!=":.{"var":"record.WageGrp"},null]},{"!=":r{"var":"record.WageCode"},null]},{"!=":d{"var":"record.WageHours"},null]}]},{"and":g{"==":"{"var":"record.AttManresult"},true]},{"!=":t{"var":"record.ManRsltWageCode"},null]},{"!=":l{"var":"record.WageHours"},null]}]},{"and":g{"==":"{"var":"record.AttPrjrep"},true]},{"!=":.{"var":"record.ShortName"},null]},{"!=":.{"var":"record.ReportCostCode"},null]},{"!=":r{"var":"record.DayHours"},null]}]},{"and":a{"==":"{"var":"record.AttWo"},true]},{"!=":c{"var":"record.WorkTask"},null]},{"!=":d{"var":"record.WorkOrder"},null]},{"!=":.{"var":"record.DayHours"},null]}]},{"and":a{"==":"{"var":"record.AttShpord"},true]},{"!=":.{"var":"record.Operation"},null]},{"!=":.{"var":"record.TimeType"},null]},{"!=":d{"var":"record.DayHours"},null]}]},{"and":a{"==":"{"var":"record.AttIndirect"},true]},{"!=":t{"var":"record.Contract"},null]},{"!=":d{"var":"record.IndirectJob"},null]},{"!=":n{"var":"record.DayHours"},null]}]},{"and":a{"==":"{"var":"record.AttShopClock"},true]},{"!=":t{"var":"record.Operation"},null]},{"!=":.{"var":"record.TimeType"},null]},{"!=":d{"var":"record.InTime"},null]}]},{"and":.{"==":"{"var":"record.AttIndirectClock"},true]},{"!=":i{"var":"record.Contract"},null]},{"!=":d{"var":"record.IndirectJob"},null]},{"!=":n{"var":"record.InTime"},null]}]}]}

 

Anyone who succeed with changing such an expression in Aurena or know another approach to make the field required?

Thanks!!

Br

Hi @Christian Cordius 

 

First identify the name of the new field you added in the page (e.g : ResourceId)
Then go to the command group of dialog page and navigate to the command (Save or Save and Report again) where you want to enable/disable based on the availability of the value in newly added field.
In there you can see the Enabled field and in there all the condition sets to enable this command button is implemented. 
Copy that condition set and save it somewhere.
Now fill the Enabled field with following condition which only check whether this newly filed has a value or not to enable this command button. 

{"and":n{"!=":!{"var":"record.<name of the newly added field>"},null]}]}   <-------------- this means newly added field should not be null (should have a value)

e.g :

{"and":a{"!=":"{"var":"record.ResourceId"},null]}]}

This should work as expected and now you can see that the command button is enabled only where there is a value in newly added field (all other default mandatory fields will be not mandatory, since we isolate the filed resource id here)

Now we need to put this command in the proper location in original condition set which enable this command button.
So carefully go through the original condition set and you can use notepad++ to identify start and matching end braces to separate conditions and and there we need to separate all condition sets based on 'or' and 'and' operators and put this newly created condition ({"and":a{"!=":"{"var":"record.ResourceId"},null]}]}) everywhere when it is needed. 

If we add this new condition in every places where it needs, this should properly work and as expected. 

 

Thank You and Best Regards,

Dammika


Reply