This one is a pretty short tutorial, but has the potential to allow for greater control over the rules you use in App Studio.
You can use JavaScript functions and expressions to do more complex Row Rules in App Studio, however, they are a tad finicky in their current iteration, so it may take some playing in order to get it to time just right.
Row Rules fire initially on form load, so you need to check for undefined in order for it to not blow up when the screen loads. YourColumn === undefined or YourColumn !== undefined
So how do we get around base or ‘Locked’ Rules?
For instance, in MES > End Downtime the Note field is disabled by a Locked Row Rule.
In classic I used a Row Rule to reset it’s Style to ‘Default’ which allowed Note Update while Ending Downtime. In classic it looks like they used a UIPermissions function or something to prevent entry and a Row Rule allowed me to override, but in Kinetic there’s already a row rule and it’s locked. I tried copying it and enabling the field but that doesn’t seem to work, I guess the execution order isn’t what I expected.
Well, this is hacky as all get-out, but it works? LOL…
They really stonewalled me throughout with their locked stuff.
Create a layer in the Downtime Entry screen, then add an event for AfterInitialize and use a row-update widget to set the TransView.Mode field to something–anything really.
I have a BAQ that returns the number of documents of a particular type (“site safety docs”) for a given customer, linked to a dataview in customer entry. Its updating the dataview ok.
Most customers don’t have site safety docs so no rows are returned, so the null check should return true, and disable the linked control.
Some customers do have these docs, and the one I am looking at below has 1.
(CW_SafetyDocs.Calculated_SiteSafetyDocCount is 1)
I did a javascritpt thing as you decsribed, using return(Calculated_SiteSafetyDocCount === undefined || Calculated_SiteSafetyDocCount == 0):
(It is returning true as expected for customer with no safety docs, ie where dataview CW_SafetyDocs is empty, but can’t see why its true in the above case)
UPDATE I simplified it so the consdition was simply return(Calculated_SiteSafetyDocCount === undefined )
as the rows are only populated if the count is >0 anyway.
Still always returns true; I’m missing the point here somewhere…