Dear ,
U can achieve that by doin the following ,
Add data label into Editable list 1 ,
then on list item click , Execute a smartobject method Get list , execute SMO that is used in Editable list 2 ,
make sure u add a filter , ID (From editable list one) = Building ID from Editable list 2 SMO ,
and return the ID into the data label ,
When the user tries to action "delete" button ,
u need to check , if the data label is empty or equals to 0 , Proceed >> Delete the record because it means it has no childs in the editable list 2,
else if data label >0 , which means that ur SMO get list method returned an ID , that means the record has child record , then execute show msg "u cant delete it"
Note : Make sure if ur succeed condition applies and deletion applies , to transfer data to the data label =0 , to make it empty again for the second try for deletion .
Hope it helps!
Regards.
Hi Ahmad,
Just tried your idea and it works great... However one slight issue.
On the view, when i click an item and click delete. it comes up with message saying "you can't delete campus etc etc" and then transfers the 0 to the data label.
But because the row IS STILL selected, it then allows you to delete it because we transferred 0.
Is there any way of removing the focus from the selected item so that the user is forced to select an item again (and thus enforcing the Item Click rule)???
Great step by step, by the way!!
Dear ,
This solution might sound weird , but this is the only one that worked for me to unfocus a record ,
ur items are already saved in the DB , so try the following steps ,
after u click on delete , in the condition where the msg shows up , add 2 rules after it ,
-remove selected row <-- this will only delete the row as visual list , it wont delete the record from the DB ,
-execute view method List Refresh , <-- this will then reload the data , and the deleted row will come back but unselected (unfocused)
Hope it helps!
Regards.
Ahmad,
Your hack worked great, it's a great workaround.
Have some kudos bro...