Friday Teaser

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
customaware
Posts: 2409
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Friday Teaser

Post by customaware »

Imagine this scenario....

I have a Parent BO that Owns Many Child BOs

In the Child BO, I have a Yes/No Attribute (as a Switch)... Lets call it recordEnabled.

Assume there are any number of Child records for a given Parent. But ONE AND ONLY ONE Child Record is allowed to have recordEnabled set to Yes.. or Enabled.

If one single record has recordEnabled Enabled, then recordEnabled for all the other Child records of this Parent should be visible but uneditable... PROTECT.

The ONLY Record that can have recordEnabled UNPROTECTED is the record where it is set to Yes or Enabled. For this record it can be then set to No or Disabled.

If ALL records have recordEnabled set to No or Disabled then recordEnabled is UNPROTECTED for all record until one of them is set to Enabled.

I have frigged around with the BO Rule to properly and dynamically PROTECT this attribute appropriately for hours to no avail.

Would appreciate any ideas or suggestions please.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
PointsWell
Posts: 1460
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Friday Teaser

Post by PointsWell »

Create another attribute on Parent called psEnabledRecord

You can dispense with the yes no attribute and instead use a button to insert the Child into psEnabledRecord.

Then if a child record != Parent.psEnabledRecord it is uneditable.
customaware
Posts: 2409
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Friday Teaser - SOLVED

Post by customaware »

Awesome Sean.

Had to fiddle with Autorefresh a bit but got it working perfectly using your suggested methodology.

Thank You 🙏🏼
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
Post Reply