If you're using FM 12 or greater you could use ExecuteSQL to search for maintenance records with the same Object ID. Then an if statement to set a variable to be displayed in the dialog.
Alternately if you don't have FM12 > you could use a relationship where Maintenance::Object_ID = MaintenanceSelfJoin::Object_ID. (MaintenanceSelfJoin being a new TOC you created) you then use "ValueCount ( List(MaintenanceSelfJoin::Object_ID ) > 1 " to determine if there are other maintenance records for that object.
I prefer ExecuteSQL over adding a new relationship. Each relationship you add slows your solution down just a tiny bit. If you're using client server across a VPN then every network packet counts.
Objects::__pkObjectID = MaintIssues::_fkObjectID
If you add this relationship:
MaintIssues::_fkObjectID = MaintIssues|SameObject::_fkObjectID AND
MaintIssues::constResolved ≠ MaintIIssues|SameObject::Status
MaintIssues|SameObject would be a new table occurrence of MaintIssues. constResolved would be a field of type calculation set up to evaluate to the same value that you enter or select in Status to mark a record as "resolved".
Then you can use Count ( MaintIssues|SameObject::_fkObjectID ) to check for the existence of unresolved maintenance issues for the same object.
I'd change the sequence of operations, however, if I were setting this up. I'd require the user to click a button or use a custom menu to create a new maintIssue record so that a script can check for the existence of unresolved issue reports before creating a new record. That way, if the user elects not to add a new report when they get this message, no blank MaintIssues record exists to be deleted. This script could even pull up a summary report on the layout listing the open issue reports so that the user can examine at least a brief description of all unresolved issues in order to better decide whether they still want to add their own new record.
A simple form of such a script would start out like this:
IF [ Not IsEmpty ( MaintIssues|SameObject::_fkObjectID ) // unresolved issues exist ]
#Go to Related Records could be used here to pull up all unresolved issues for the current object in a list or table view if desired
Show Custom Dialog [ "Unresolved issues already exist for this object. Create a new Issue record?" ]
If [Get ( LastMessageChoice ) = 2 // Cancel was clicked ]
Exit Script