Symptom
When you delete the text within the notes on a contract, the checkbox 'Note Exists' does not get removed.
Environment
SAP Cloud for Customer
Reproducing the Issue
-
Go to the Contracts work centre.
-
Go to the Contracts view.
-
In the OWL you'll see the column 'Note Exists' if added through the Master Layout.
-
Open any contract which has a note maintained.
-
Navigate to the Notes facet.
-
Delete the note and save.
Actual Result: the checkbox will stay checked, despite removing/ deleting the note.
Cause
When a text is removed, technically, an instance still remains - so to say a kind of empty line. If we would delete this generally, this could lead to issues for other customers.
Resolution
If it is very important for you to recognize if (semantically) there is a text or not, this would be feasible via an implementation with the SAP Cloud Applications Studio.
For example, you might add a further field on Root level, and in a "before save" exit, it could be filled according to the requirement. A code snippet might look like outlined below:
Code example (NON-BINDING!) for Root Event-BeforeSave.absl:
import ABSL;
// TextCollection.TextExistsIndicator is also true when there are empty text instances
// Extension field nonemptyText shall be set to true only when a non-empty text exists
if (this.TextCollection.TextExistsIndicator == true)
{
var textExists = false;
var text;
// Loop over all texts for this contract Root instance
foreach (text in this.TextCollection.Text)
{
if (text.TextContent.Text.IsInitial() == false)
// There is really a text which is not empty
{
textExists = true;
// Leave loop
break;
}
}
// End of loop
// Set extension field on contract Root
if (textExists == true)
{
this.nonemptyText = true;
}
else
{
this.nonemptyText = false;
}
}
Keywords
Note Exists, contract, checkbox , KBA , LOD-LE-COP , Contract Processing , Problem