Skip to main content
Asked a question 4 days ago

Few questions on some validations - How do I - 1. Making Openingtimes (field) read only if ClockRound(another field in the same entity) is 1, else it can editable. 2. Making JetAdditive(a field) Visible for selection if JetFuel (another field in the same entity) is Yes else Jetaddtive should be not displayed and set as No. 3. If Record state(a field) in Fuel Provider Entity is set to public, how can I make an entry in the Openinghours entity mandatory.

Where am I?

In Semarchy Community you can ask and answer questions and share your experience with others!

Zahuur MohamudSemarchy Team
Customer Success Consultant at Semarchy

1. For the read-only property you will need to write a semQL expression. Here are examples of a read-only semQL expression. 

The first example uses string values in the case statement. The second example uses numeric values both methods provide the same results.

case when ClockRound = '1' then '0' else '1' end
case when ClockRound = 1 then 0 else 1 end

2. In the Visible property you would need to write an semQL condition. In your Form, Navigate to Properties > Display Properties. Then you can change the Visible field from a checkbox to semQL. Here are two examples of semQL conditions that would work for a use case.

case when JetFul = ‘YES’ then 1 else 0 end = 1
JetFuel ='YES'

For point 3, assuming that OpeningHours references (aka is a child of) FuelProvider I'd do a SemQL validation on FuelProvider as shown below. 

( RecordState = 'public' and any OpeningHours have (1=1) ) or ( RecordState <> 'public' )

By doing so, you mandate at least one OpeninigHour when RecordState is public.
Hope this makes sense.

Related Questions

No related questions.