Adding Delete Functionality to a Screen or Control

From OpenPetra Wiki
Jump to navigation Jump to search

Links

Testing Schedule for Delete Functionality

Overview

Nearly all the code to delete a specific record from a table can be auto-generated by Open Petra's code generation applications. A small amount of code is generated on the client and a larger amount is generated in the server. You can activate all this code by adding a few simple lines to the YAML file that defines the behaviour of the screen or user control. When you do this you will get

  • a delete button with a label of your choice - but Delete by default
  • code that enables or disables the button depending on the circumstances. Some records in Open Petra are specifically marked as being non-deletable.
  • code that checks whether the row is referenced by another table or tables as a foreign key. If it is, a message box is displayed giving helpful information about which table(s) reference the data, and the delete action is abandoned.
  • code to ask for pre-confirmation of the action.
  • code to delete the relevant record.
  • code to confirm a successful outcome.

In addition there are optional manual code file extensions that can be made before, during and after the delete action.

This auto-generated code only applies to screens that have a grid capable of displaying multiple selectable records.

Coding the YAML File

There are a few simple steps to code the YAML file to include standard deletion. You just need one line in the Actions section and some simple lines in the Controls section.

A typical Actions section will look like this

    Actions:
        actNew: {Label=&New, ActionClick=NewRecord}
        actDelete: {Label=&Delete, ActionClick=DeleteRecord}

This has one action for the New button and one action for the Delete button

The equivalent Controls section would look like this

        pnlButtons:
            Dock: Right
            Controls: [btnNew, btnDelete]
        btnNew:
            Action: actNew
            Stretch: horizontally
        btnDelete:
            Action: actDelete
            Stretch: horizontally

This has a panel containing the two buttons docked to the right. Each button specifies the associated action and, in order to make the buttons have the same size, they are both stretched horizontally.

It is as simple as that! The only rules are that the button must be named btnDelete and the action must be called actDelete. The label does not have to be Delete. The ActionClick should normally be DeleteRecord. If ActionClick is DeleteRecord then the event handler will be coded into the -generated.cs file. If you choose a different name you will have to code the handler into the Manual.cs file. You might choose to do this if you are going to code the entire deletion procedure manually, but if you want to make use of Pre/PostDeleteManual or DeleteRowManual it makes little sense to not use DeleteRecord.

Avoiding the Reference Check

In a few cases it may be necessary to avoid performing the usage reference count check before executing the deletion code. This typically happens on a screen that maintains two tables (like Partner/LocalDataOptions). By design the second table is going to contain references to the rows of the main table. However the manual delete code will ensure that the dependent rows in the second table are deleted before the rows in the main table. So in this case you use the attribute SkipReferenceCheck=true to exclude the reference checking code. But now it is the manual coder's responsibility to ensure that the deletion works!

Here is the YAML from LocalDataOptions

actDelete: {Label=&Delete, ActionClick=DeleteRecord, SkipReferenceCheck=true}

Generating the C# Code

Normally you can make changes to a YAML file and it is a simple matter to create the C# code for the equivalent client screen and re-compile the client. But a YAML file with a delete button may require you to do more than this.

The critical occasions are

  • when you edit a YAML file and add a new Delete button
  • or when you create a new YAML file that contains a Delete button

If either of these cases apply then you will need to do the following

  • save the YAML file(s)
  • run generateORMReferenceCounts either using nant or the Developer's Assistant
  • run generateGlue either using nant or the Developer's Assistant
  • run generateWinform on the YAML file(s) (or generateWinforms for all forms) - again using nant or the Developer's Assistant
  • compile both the server and the client

Please understand that once you have done these actions once on the YAML file there is no need to repeat them again because you now have generated all the code on the server that you need. Any subsequent changes to the YAML file that you make (for example laying out the controls so that they look nice) can be compiled to C# and/or previewed in the normal way because the server code will not change when you do that.

Auto-generated Client Code

So what code gets generated on the client? There are three snippets of code that we generate on the client.

First there is a click event handler that simply calls a standard method. This code example deletes a record from the p_business table.

    private void DeleteRecord(Object sender, EventArgs e)
    {
        DeletePBusiness();
    }

Second there is a line of code that handles the enable/disable state of the button

        btnDelete.Enabled = pnlDetails.Enabled;

or, where a table has a 'deletable' flag

        btnDelete.Enabled = ((grdDetails.SelectedDataRowsAsDataRowView.Length > 1) || ((ARow != null) && (ARow.DeletableFlag == true))) && pnlDetails.Enabled;

Finally there is the deletion code itself - in this example in the method DeletePBusiness(). Only the single row deletion code is shown.

    private void DeletePBusiness()
    {
        string CompletionMessage = String.Empty;

        if ((FPreviouslySelectedDetailRow == null) || (FPrevRowChangedRow == -1))
        {
            return;
        }

        DataRowView[] HighlightedRows = grdDetails.SelectedDataRowsAsDataRowView;

        if (HighlightedRows.Length == 1)
        {
            TVerificationResultCollection VerificationResults = null;

            if (!FPetraUtilsObject.VerificationResultCollection.HasCriticalErrors)
            {
                this.Cursor = Cursors.WaitCursor;
                TRemote.MPartner.ReferenceCount.WebConnectors.GetCacheableRecordReferenceCount(
                    "BusinessCodeList",
                    DataUtilities.GetPKValuesFromDataRow(FPreviouslySelectedDetailRow),
                    out VerificationResults);
                this.Cursor = Cursors.Default;
            }

            if ((VerificationResults != null)
                && (VerificationResults.Count > 0))
            {
                MessageBox.Show(Messages.BuildMessageFromVerificationResult(
                        Catalog.GetString("Record cannot be deleted!") +
                        Environment.NewLine +
                        Catalog.GetPluralString("Reason:", "Reasons:", VerificationResults.Count),
                        VerificationResults),
                        Catalog.GetString("Record Deletion"));
                return;
            }

            string DeletionQuestion = Catalog.GetString("Are you sure you want to delete the current row?");
            if ((FPrimaryKeyControl != null) && (FPrimaryKeyLabel != null))
            {
                DeletionQuestion += String.Format("{0}{0}({1} {2})",
                    Environment.NewLine,
                    FPrimaryKeyLabel.Text.Replace("&", ""),
                    TControlExtensions.GetDisplayTextForControl(FPrimaryKeyControl));
            }

            bool AllowDeletion = true;
            bool DeletionPerformed = false;

            if(AllowDeletion)
            {
                if ((MessageBox.Show(DeletionQuestion,
                         Catalog.GetString("Confirm Delete"),
                         MessageBoxButtons.YesNo,
                         MessageBoxIcon.Question,
                         MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.Yes))
                {
                    try
                    {
                        FPreviouslySelectedDetailRow.Delete();
                        DeletionPerformed = true;
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(String.Format(Catalog.GetString("An error occurred while deleting this record.{0}{0}{1}"),
                            Environment.NewLine, ex.Message),
                            Catalog.GetString("Error"),
                            MessageBoxButtons.OK,
                            MessageBoxIcon.Warning);
                    }

                    if (DeletionPerformed)
                    {
                        FPetraUtilsObject.SetChangedFlag();
                    }

                    // Select and display the details of the nearest row to the one previously selected
                    SelectRowInGrid(FPrevRowChangedRow);
                    // Clear any errors left over from  the deleted row
                    FPetraUtilsObject.VerificationResultCollection.Clear();
                }
            }

            if(DeletionPerformed && CompletionMessage.Length > 0)
            {
                MessageBox.Show(CompletionMessage,
                                 Catalog.GetString("Deletion Completed"));
            }
        }

This snippet of code does the following.

  • It checks that the row is not empty
  • It queries the server to find out of the row is currently referenced by another table or tables. If it is it displays a helpful message and exits the function.
  • It asks the user to confirm deletion. The user can abandon deletion at this point. The default deletion question shows the label text and the data text for the primary key control. Usually the question will be correct but sometimes you may need to frame your own question inside PreDeleteManual().
  • It deletes the record. Note that this step is inside a try/catch block. If you need to write your own deletion code inside DeleteRowmanual() please do not use a try/catch block for that method but let the exception be caught inside this code.
  • It sets the flag that enables the Save button
  • It selects the correct row in the grid now that the row has been deleted. Note that this is all that is necessary even if there are no no more rows in the grid.
  • It displays a 'success' message

The reference count message is something like: You cannot delete this record. It is used by 3 records in the XXX table and 19 records in the YYY table. An example of a record that uses this record is found in Partner with a key of 43005009.

You can modify the behaviour of the deletion process by including any or all of the following methods in your manual code file.

private bool PreDeleteManual(PInternationalPostalTypeRow ARowToDelete, ref string ADeletionQuestion)

private bool DeleteRowManual(PInternationalPostalTypeRow ARowToDelete, ref string ACompletionMessage)

private void PostDeleteManual(PInternationalPostalTypeRow ARowToDelete, bool AAllowDeletion, bool ADeletionPerformed, string ACompletionMessage)
  • If the first method returns false the deletion will be abandoned. You can use this method to modify the deletion question.
  • The second method can be used to replace the standard record deletion code with more complex code of your choice. You can modify the completion message. You return true or false depending on whether the deletion succeeded.
  • The third optional manual method can be used to do manual clean-up after deletion has occurred. The parameters tell you if deletion was initially allowed/disallowed, whether deletion actually succeeded and what the recommended message is that should be shown.

Multi-Row Deletion

The auto-generated code supports multi-row deletion. In fact if the generator creates deletion code it will always include code that handles the Details Grid having multiple highlighted rows. But note that it is the grid itself that determines whether multi-row select is enabled. By default the generator will enable multi-row select on grdDetails where there is a btnDelete in the YAML file. Usually this will be the desired behaviour. But if you want to ensure that only single rows can be selected you need to apply the attribute EnableMultiSelection=false to the grdDetails. Note that this attribute only applies to grdDetails.

When multiple rows are highlighted the deletion code is executed for each row but the logic sequence is subtly different from single row deletion.

  • The standard deletion question is not used. Instead a simple question is always asked - 'Do you want to delete the N highlighted rows?'
  • PreDeleteManual, if it exists, is still called and if it returns false, deletion is not performed for this row.
  • The reference count is checked for the row and if it is non-zero the row is not deleted
  • DeleteRowManual is called for the row and ACompletionMessage is passed in. If you want a completion message (which would be unusual but might be appropriate if the data is always saved to disk, for example), you need to test whether ACompletionMessage is an empty string. If it is this is the first time that DeleteRow has been called. If it is not then you have already set the message once and you may wish to change it now that you know we are deleting multiple rows.
  • PostDeleteManual is called each time, if it exists, but always with a Completion Message of empty string
  • After the last highlighted row has been deleted the standard code will report how many rows were in fact deleted. The user will be able to review any errors or reasons why some rows were not successfully deleted. In addition the completion message is displayed.

Auto-generated Server Code

You will notice from the client code above that the client calls a method on the server named

TRemote.MPartner.ReferenceCount.WebConnectors.GetCacheableRecordReferenceCount

using a web connector method. (There is an equivalent non-cacheable table method too). All the code to implement the connectors, interfaces and implementations of these methods is auto-generated for the server.

The implementations are all found in the web folder beneath Server/lib/ModuleName in a file named ReferenceCount-generated.cs. So, for example, there is a file csharp/ICT/Petra/Server/lib/MPartner/ReferenceCount-generated.cs. These implementations all call standard Data Access methods to determine the reference counts and construct a Verification Result Collection that should be returned to the client.

Delete Button Implementation (As was on 15 April)

Analysis run at 15:09 on 15/04/2013.
All the files listed below have either a 'New' button or an 'Add' button with a name containing btnNew or btnAdd

Screens Based on Template: WindowEdit (7 files use this template. The following have Add/Delete functionality)

Filename DetailTable Has New Button Has Delete Button Has Auto-delete Has ReferenceCount Has Deletable Flag Calls .Delete() Manual Calls Auto Client/Server Match
MSysMan\Gui\MaintainUsers.yaml SUser Yes No n/a Yes No No n/a
MPartner\Gui\PersonnelStaffData.yaml PmStaffData Yes Yes No Yes No Yes No Yes
MFinance\Gui\Setup\GiftMotivationSetup.yaml AMotivationDetail Yes Yes Yes Yes No Yes No Yes
MFinance\Gui\Setup\MotivationGroupSetup.yaml AMotivationGroup Yes Yes Yes Yes No No Yes
MFinance\Gui\Setup\SetupAnalysisTypes.yaml AAnalysisType Yes Yes No Yes No Yes No Yes
MFinance\Gui\Common\BankStatementImport.yaml Yes Yes No No No Yes Yes No

Screens Based on Template: WindowTDS (6 files use this template. The following have Add/Delete functionality)

Filename DetailTable Has New Button Has Delete Button Has Auto-delete Has ReferenceCount Has Deletable Flag Calls .Delete() Manual Calls Auto Client/Server Match

Screens Based on Template: WindowMaintainTable (8 files use this template. The following have Add/Delete functionality)

Filename DetailTable Has New Button Has Delete Button Has Auto-delete Has ReferenceCount Has Deletable Flag Calls .Delete() Manual Calls Auto Client/Server Match
MSysMan\Gui\Setup\SecurityGroupSetup.yaml SGroup Yes Yes Yes Yes No No Yes
MPersonnel\Gui\Setup\ApplicationTypeSetup.yaml PtApplicationType Yes Yes Yes Yes Yes No Yes
MPartner\Gui\Setup\MailingSetup.yaml PMailing Yes Yes Yes Yes No No Yes
MFinance\Gui\Setup\CurrencyLanguageSetup.yaml ACurrencyLanguage Yes Yes Yes Yes No No Yes
MFinance\Gui\Setup\SetupCorporateExchangeRate.yaml ACorporateExchangeRate Yes No n/a Yes No No n/a
MFinance\Gui\Setup\SetupDailyExchangeRate.yaml ADailyExchangeRate Yes Yes No Yes No Yes Yes
MCommon\Gui\Setup\InternationalPostalTypeSetup.yaml PInternationalPostalType Yes Yes No Yes Yes Yes Yes Yes
MCommon\Gui\Setup\SetupCurrency.yaml ACurrency Yes Yes No Yes No No Yes

Screens Based on Template: WindowMaintainCacheableTable (57 files use this template. The following have Add/Delete functionality)

Filename DetailTable CacheableTable Has New Button Has Delete Button Has Auto-delete Has ReferenceCount Has Deletable Flag Calls .Delete() Manual Calls Auto Client/Server Match
MSysMan\Gui\Setup\LanguageSpecificSetup.yaml SLanguageSpecific LanguageSpecificList Yes Yes Yes Yes No No Yes
MPersonnel\Gui\Setup\AbilityAreaSetup.yaml PtAbilityArea AbilityAreaList Yes Yes Yes Yes Yes No Yes
MPersonnel\Gui\Setup\AbilityLevelSetup.yaml PtAbilityLevel AbilityLevelList Yes Yes Yes Yes Yes No Yes
MPersonnel\Gui\Setup\ApplicantStatusSetup.yaml PtApplicantStatus ApplicantStatusList Yes Yes Yes Yes Yes No Yes
MPersonnel\Gui\Setup\ArrivalDeparturePointSetup.yaml PtArrivalPoint ArrivalDeparturePointList Yes Yes Yes Yes Yes No Yes
MPersonnel\Gui\Setup\Country_EventLevelSetup.yaml PtOutreachPreferenceLevel OutreachPreferenceLevelList Yes Yes Yes Yes Yes No Yes
MPersonnel\Gui\Setup\DocumentTypeCategorySetup.yaml PmDocumentCategory DocumentTypeCategoryList Yes Yes Yes Yes Yes No Yes
MPersonnel\Gui\Setup\DocumentTypeSetup.yaml PmDocumentType DocumentTypeList Yes Yes Yes Yes Yes No Yes
MPersonnel\Gui\Setup\DriverStatusSetup.yaml PtDriverStatus DriverStatusList Yes Yes Yes Yes Yes No Yes
MPersonnel\Gui\Setup\EventRoleSetup.yaml PtCongressCode EventRoleList Yes Yes Yes Yes Yes No Yes
MPersonnel\Gui\Setup\JobAssignmentTypeSetup.yaml PtAssignmentType JobAssignmentTypeList Yes Yes Yes Yes Yes No Yes
MPersonnel\Gui\Setup\LanguageLevelSetup.yaml PtLanguageLevel LanguageLevelList Yes Yes Yes Yes Yes No Yes
MPersonnel\Gui\Setup\LeadershipRatingSetup.yaml PtLeadershipRating LeadershipRatingList Yes Yes Yes Yes Yes No Yes
MPersonnel\Gui\Setup\LeavingCodeSetup.yaml PtLeavingCode LeavingCodeList Yes Yes Yes Yes Yes No Yes
MPersonnel\Gui\Setup\OrganisationContactSetup.yaml PtContact ContactList Yes Yes Yes Yes Yes No Yes
MPersonnel\Gui\Setup\PassportTypeSetup.yaml PtPassportType PassportTypeList Yes Yes Yes Yes Yes No Yes
MPersonnel\Gui\Setup\PositionSetup.yaml PtPosition PositionList Yes Yes Yes Yes Yes No Yes
MPersonnel\Gui\Setup\ProfessionalAreaSetup.yaml PtQualificationArea QualificationAreaList Yes Yes Yes Yes Yes No Yes
MPersonnel\Gui\Setup\QualificationLevelSetup.yaml PtQualificationLevel QualificationLevelList Yes Yes Yes Yes Yes No Yes
MPersonnel\Gui\Setup\SkillCategorySetup.yaml PtSkillCategory SkillCategoryList Yes Yes Yes Yes Yes No Yes
MPersonnel\Gui\Setup\SkillLevelSetup.yaml PtSkillLevel SkillLevelList Yes Yes Yes Yes Yes No Yes
MPersonnel\Gui\Setup\TransportTypeSetup.yaml PtTravelType TransportTypeList Yes Yes Yes Yes Yes No Yes
MPartner\Gui\Setup\AcquisitionCodeSetup.yaml PAcquisition AcquisitionCodeList Yes Yes Yes Yes Yes No Yes
MPartner\Gui\Setup\AddresseeTypeSetup.yaml PAddresseeType AddresseeTypeList Yes Yes Yes Yes Yes No Yes
MPartner\Gui\Setup\BusinessCodeSetup.yaml PBusiness BusinessCodeList Yes Yes Yes Yes Yes No Yes
MPartner\Gui\Setup\ContactAttributeSetup.yaml PContactAttribute ContactAttributeList Yes Yes No Yes No Yes No Yes
MPartner\Gui\Setup\ContactMethodSetup.yaml PMethodOfContact MethodOfContactList Yes Yes Yes Yes Yes No Yes
MPartner\Gui\Setup\DenominationCodeSetup.yaml PDenomination DenominationList Yes Yes Yes Yes Yes No Yes
MPartner\Gui\Setup\InterestCategorySetup.yaml PInterestCategory InterestCategoryList Yes Yes Yes Yes No No Yes
MPartner\Gui\Setup\InterestSetup.yaml PInterest InterestList Yes Yes Yes Yes No No Yes
MPartner\Gui\Setup\LocalDataOptionListNameSetup.yaml PDataLabelLookupCategory DataLabelLookupCategoryList Yes Yes Yes Yes No No Yes
MPartner\Gui\Setup\LocalDataOptionsSetup.yaml PDataLabelLookup DataLabelLookupList Yes Yes Yes Yes No No Yes
MPartner\Gui\Setup\LocationTypeSetup.yaml PLocationType LocationTypeList Yes Yes Yes Yes Yes No Yes
MPartner\Gui\Setup\MaritalStatusSetup.yaml PtMaritalStatus MaritalStatusList Yes Yes Yes Yes Yes No Yes
MPartner\Gui\Setup\OccupationCodeSetup.yaml POccupation OccupationList Yes Yes Yes Yes Yes No Yes
MPartner\Gui\Setup\PartnerStatusSetup.yaml PPartnerStatus PartnerStatusList Yes Yes Yes Yes Yes No Yes
MPartner\Gui\Setup\PartnerTypeSetup.yaml PType PartnerTypeList Yes Yes Yes Yes Yes No Yes
MPartner\Gui\Setup\PublicationCostSetup.yaml PPublicationCost PublicationCostList Yes Yes Yes Yes No No Yes
MPartner\Gui\Setup\PublicationSetup.yaml PPublication PublicationList Yes Yes Yes Yes No No Yes
MPartner\Gui\Setup\ReasonSubscriptionCancelledSetup.yaml PReasonSubscriptionCancelled ReasonSubscriptionCancelledList Yes Yes Yes Yes No No Yes
MPartner\Gui\Setup\ReasonSubscriptionGivenSetup.yaml PReasonSubscriptionGiven ReasonSubscriptionGivenList Yes Yes Yes Yes No No Yes
MPartner\Gui\Setup\RelationCategorySetup.yaml PRelationCategory RelationCategoryList Yes Yes Yes Yes Yes No Yes
MPartner\Gui\Setup\RelationshipSetup.yaml PRelation RelationList Yes Yes Yes Yes Yes No Yes
MFinance\Gui\Setup\EmailDestinationSetup.yaml AEmailDestination EmailDestinationList Yes Yes Yes Yes No No Yes
MFinance\Gui\Setup\SetupAdminGrantsPayable.yaml AFeesPayable FeesPayableList Yes Yes Yes Yes No No Yes
MFinance\Gui\Setup\SetupAdminGrantsReceivable.yaml AFeesReceivable FeesReceivableList Yes Yes Yes Yes No No Yes
MFinance\Gui\Setup\SetupCostCentreTypes.yaml ACostCentreTypes CostCentreTypesList Yes Yes Yes Yes Yes No Yes
MFinance\Gui\Setup\SetupMethodOfGiving.yaml AMethodOfGiving MethodOfGivingList Yes Yes No Yes No No Yes
MFinance\Gui\Setup\SetupMethodOfPayment.yaml AMethodOfPayment MethodOfPaymentList Yes Yes Yes Yes No No Yes
MFinance\Gui\Setup\SetupSuspenseAccount.yaml ASuspenseAccount SuspenseAccountList Yes Yes No Yes No Yes Yes
MConference\Gui\Setup\ConferenceCostTypeSetup.yaml PcCostType ConferenceCostTypeList Yes Yes Yes Yes Yes No Yes
MCommon\Gui\Setup\CountrySetup.yaml PCountry CountryList Yes Yes Yes Yes Yes No Yes
MCommon\Gui\Setup\FrequencySetup.yaml AFrequency FrequencyList Yes Yes Yes Yes No No Yes
MCommon\Gui\Setup\LanguageCodeSetup.yaml PLanguage LanguageCodeList Yes Yes Yes Yes Yes No Yes
MCommon\Gui\Setup\LocalDataFieldSetup.yaml PDataLabel DataLabelList Yes Yes Yes Yes No Yes No Yes

Screens Based on Template: WindowEditUIConnector (3 files use this template. The following have Add/Delete functionality)

Filename DetailTable Has New Button Has Delete Button Has Auto-delete Has ReferenceCount Has Deletable Flag Calls .Delete() Manual Calls Auto Client/Server Match
MFinance\Gui\Budget\MaintainBudget.yaml ABudget Yes Yes No Yes No Yes No Yes

Screens Based on Template: WindowEditWebConnectorMasterDetail (1 files use this template. The following have Add/Delete functionality)

Filename DetailTable Has New Button Has Delete Button Has Auto-delete Has ReferenceCount Has Deletable Flag Calls .Delete() Manual Calls Auto Client/Server Match
MFinance\Gui\AP\APEditDocument.yaml AApDocumentDetail Yes Yes No Yes No Yes No Yes

Screens Based on Template: ControlMaintainTable (29 files use this template. The following have Add/Delete functionality)

Filename DetailTable Has New Button Has Delete Button Has Auto-delete Has ReferenceCount Has Deletable Flag Calls .Delete() Manual Calls Auto Client/Server Match
MPartner\Gui\UC_Applications.yaml PmGeneralApplication Yes Yes No Yes No Yes No Yes
MPartner\Gui\UC_FinanceDetails.yaml PBankingDetails Yes Yes No Yes No Yes No Yes
MPartner\Gui\UC_IndividualData_Abilities.yaml PmPersonAbility Yes Yes No Yes No Yes Yes Yes
MPartner\Gui\UC_IndividualData_CommitmentPeriods.yaml PmStaffData Yes Yes No Yes No Yes Yes Yes
MPartner\Gui\UC_IndividualData_JobAssignments.yaml PmJobAssignment Yes Yes No Yes No Yes Yes Yes
MPartner\Gui\UC_IndividualData_Passport.yaml PmPassportDetails Yes Yes No Yes No Yes Yes Yes
MPartner\Gui\UC_IndividualData_PersonalDocuments.yaml PmDocument Yes Yes No Yes No Yes Yes Yes
MPartner\Gui\UC_IndividualData_PersonalLanguages.yaml PmPersonLanguage Yes Yes No Yes No Yes Yes Yes
MPartner\Gui\UC_IndividualData_PersonSkills.yaml PmPersonSkill Yes Yes No Yes No Yes Yes Yes
MPartner\Gui\UC_IndividualData_PreviousExperience.yaml PmPastExperience Yes Yes No Yes No Yes Yes Yes
MPartner\Gui\UC_IndividualData_ProgressReports.yaml PmPersonEvaluation Yes Yes No Yes No Yes Yes Yes
MPartner\Gui\UC_PartnerRelationships.yaml PPartnerRelationship Yes Yes No Yes No Yes Yes Yes
MPartner\Gui\UC_Subscriptions.yaml PSubscription Yes Yes No Yes No Yes Yes Yes
MPartner\Gui\Extracts\UC_ExtractMaintain.yaml MExtract Yes Yes Yes Yes No Yes No Yes
MPartner\Gui\Extracts\UC_ExtractMasterList.yaml MExtractMaster No Yes No Yes No Yes No Yes
MFinance\Gui\Setup\UC_AccountAnalysisAttributes.yaml AAnalysisAttribute Yes Yes No Yes No Yes No Yes
MFinance\Gui\Setup\UC_SetupAnalysisValues.yaml AFreeformAnalysis Yes Yes No Yes No Yes No Yes
MFinance\Gui\GL\UC_GLBatches.yaml ABatch Yes No n/a Yes No Yes No n/a
MFinance\Gui\GL\UC_GLJournals.yaml AJournal Yes No n/a Yes No Yes No n/a
MFinance\Gui\GL\UC_GLTransactions.yaml ATransaction Yes Yes No No No Yes Yes No
MFinance\Gui\GL\UC_RecurringGLBatches.yaml ARecurringBatch Yes Yes No Yes No Yes Yes Yes
MFinance\Gui\GL\UC_RecurringGLJournals.yaml ARecurringJournal Yes Yes No Yes No Yes Yes Yes
MFinance\Gui\GL\UC_RecurringGLTransactions.yaml ARecurringTransaction Yes Yes No Yes No Yes Yes Yes
MFinance\Gui\Gift\UC_GiftBatches.yaml AGiftBatch Yes Yes Yes Yes No Yes Yes
MFinance\Gui\Gift\UC_GiftTransactions.yaml AGiftDetail Yes Yes No Yes No Yes Yes Yes
MFinance\Gui\Gift\UC_RecurringGiftBatches.yaml ARecurringGiftBatch Yes Yes No Yes No Yes Yes Yes
MFinance\Gui\Gift\UC_RecurringGiftTransactions.yaml ARecurringGiftDetail Yes Yes No Yes No Yes Yes Yes

Screens Based on Template: ControlMaintainCacheableTable (1 files use this template. The following have Add/Delete functionality)

Filename DetailTable CacheableTable Has New Button Has Delete Button Has Auto-delete Has ReferenceCount Has Deletable Flag Calls .Delete() Manual Calls Auto Client/Server Match
MPartner\Gui\Setup\UC_ContactAttributeDetail.yaml PContactAttributeDetail ContactAttributeDetailList Yes Yes No Yes No Yes No Yes

Summary

 99 potential issues found in 42 files
 There are 98 New/Add buttons in the application
 There are 95 Delete/Remove buttons in the application
  60 of these call the auto-delete function
  35 of these call a manual delete function
    23 of these call the auto-delete function from manual code

A Blue cell indicates an unusual entry that is 'by design'
A Yellow cell indicates an unusual entry that requires investigation

Delete Button Implementation

Analysis run at 21:54 on 12/05/2013.
All the files listed below have either a 'New' button or an 'Add' button with a name containing btnNew or btnAdd

Screens Based on Template: WindowEdit (7 files use this template. The following have Add/Delete functionality)

Filename DetailTable Has New Button Has Delete Button Has Auto-delete Has ReferenceCount Has Deletable Flag Has Enable Delete Calls .Delete() Manual Calls Auto PreDelete DeleteRow PostDelete Client/Server Match Multi Select
MFinance\Gui\Common\BankStatementImport.yaml Yes Yes No No No No Yes Yes No No No No No
MFinance\Gui\Setup\GiftMotivationSetup.yaml AMotivationDetail Yes Yes Yes Yes No Yes Yes No No No No Yes Yes
MFinance\Gui\Setup\MotivationGroupSetup.yaml AMotivationGroup Yes Yes Yes Yes No Yes No No No No No Yes Yes
MFinance\Gui\Setup\SetupAnalysisTypes.yaml AAnalysisType Yes Yes Yes Yes No Yes No No Yes No No Yes Yes
MPartner\Gui\PersonnelStaffData.yaml PmStaffData Yes Yes Yes Yes No Yes No No Yes No No Yes Yes
MSysMan\Gui\MaintainUsers.yaml SUser Yes No n/a Yes No n/a No No No No No n/a No

Screens Based on Template: WindowTDS (6 files use this template. The following have Add/Delete functionality)

Filename DetailTable Has New Button Has Delete Button Has Auto-delete Has ReferenceCount Has Deletable Flag Has Enable Delete Calls .Delete() Manual Calls Auto PreDelete DeleteRow PostDelete Client/Server Match Multi Select

Screens Based on Template: WindowMaintainTable (8 files use this template. The following have Add/Delete functionality)

Filename DetailTable Has New Button Has Delete Button Has Auto-delete Has ReferenceCount Has Deletable Flag Has Enable Delete Calls .Delete() Manual Calls Auto PreDelete DeleteRow PostDelete Client/Server Match Multi Select
MCommon\Gui\Setup\InternationalPostalTypeSetup.yaml PInternationalPostalType Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MCommon\Gui\Setup\SetupCurrency.yaml ACurrency Yes Yes Yes Yes No Yes No No No No No Yes Yes
MFinance\Gui\Setup\CurrencyLanguageSetup.yaml ACurrencyLanguage Yes Yes Yes Yes No Yes No No No No No Yes Yes
MFinance\Gui\Setup\SetupCorporateExchangeRate.yaml ACorporateExchangeRate Yes Yes Yes Yes No Yes No No Yes No No Yes Yes
MFinance\Gui\Setup\SetupDailyExchangeRate.yaml ADailyExchangeRate Yes Yes No Yes No No No Yes No No No Yes Yes
MPartner\Gui\Setup\MailingSetup.yaml PMailing Yes Yes Yes Yes No Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\ApplicationTypeSetup.yaml PtApplicationType Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MSysMan\Gui\Setup\SecurityGroupSetup.yaml SGroup Yes Yes Yes Yes No Yes No No No No No Yes Yes

Screens Based on Template: WindowMaintainCacheableTable (57 files use this template. The following have Add/Delete functionality)

Filename DetailTable CacheableTable Has New Button Has Delete Button Has Auto-delete Has ReferenceCount Has Deletable Flag Has Enable Delete Calls .Delete() Manual Calls Auto PreDelete DeleteRow PostDelete Client/Server Match Multi Select
MCommon\Gui\Setup\CountrySetup.yaml PCountry CountryList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MCommon\Gui\Setup\FrequencySetup.yaml AFrequency FrequencyList Yes Yes Yes Yes No Yes No No No No No Yes Yes
MCommon\Gui\Setup\LanguageCodeSetup.yaml PLanguage LanguageCodeList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MCommon\Gui\Setup\LocalDataFieldSetup.yaml PDataLabel DataLabelList Yes Yes Yes Yes No Yes Yes No No No No Yes Yes
MConference\Gui\Setup\ConferenceCostTypeSetup.yaml PcCostType ConferenceCostTypeList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MFinance\Gui\Setup\EmailDestinationSetup.yaml AEmailDestination EmailDestinationList Yes Yes Yes Yes No Yes No No No No No Yes Yes
MFinance\Gui\Setup\SetupAdminGrantsPayable.yaml AFeesPayable FeesPayableList Yes Yes Yes Yes No Yes No No No No No Yes Yes
MFinance\Gui\Setup\SetupAdminGrantsReceivable.yaml AFeesReceivable FeesReceivableList Yes Yes Yes Yes No Yes No No No No No Yes Yes
MFinance\Gui\Setup\SetupCostCentreTypes.yaml ACostCentreTypes CostCentreTypesList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MFinance\Gui\Setup\SetupMethodOfGiving.yaml AMethodOfGiving MethodOfGivingList Yes Yes Yes Yes No Yes No No No No No Yes Yes
MFinance\Gui\Setup\SetupMethodOfPayment.yaml AMethodOfPayment MethodOfPaymentList Yes Yes Yes Yes No Yes No No No No No Yes Yes
MFinance\Gui\Setup\SetupSuspenseAccount.yaml ASuspenseAccount SuspenseAccountList Yes Yes Yes Yes No Yes No No No No No Yes Yes
MPartner\Gui\Setup\AcquisitionCodeSetup.yaml PAcquisition AcquisitionCodeList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPartner\Gui\Setup\AddresseeTypeSetup.yaml PAddresseeType AddresseeTypeList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPartner\Gui\Setup\BusinessCodeSetup.yaml PBusiness BusinessCodeList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPartner\Gui\Setup\ContactAttributeSetup.yaml PContactAttribute ContactAttributeList Yes Yes Yes Yes No Yes No No Yes Yes No Yes Yes
MPartner\Gui\Setup\ContactMethodSetup.yaml PMethodOfContact MethodOfContactList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPartner\Gui\Setup\DenominationCodeSetup.yaml PDenomination DenominationList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPartner\Gui\Setup\InterestCategorySetup.yaml PInterestCategory InterestCategoryList Yes Yes Yes Yes No Yes No No No No No Yes Yes
MPartner\Gui\Setup\InterestSetup.yaml PInterest InterestList Yes Yes Yes Yes No Yes No No No No No Yes Yes
MPartner\Gui\Setup\LocalDataOptionListNameSetup.yaml PDataLabelLookupCategory DataLabelLookupCategoryList Yes Yes Yes Yes No Yes No No No No No Yes Yes
MPartner\Gui\Setup\LocalDataOptionsSetup.yaml PDataLabelLookup DataLabelLookupList Yes Yes Yes Yes No Yes No No No No No Yes Yes
MPartner\Gui\Setup\LocationTypeSetup.yaml PLocationType LocationTypeList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPartner\Gui\Setup\MaritalStatusSetup.yaml PtMaritalStatus MaritalStatusList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPartner\Gui\Setup\OccupationCodeSetup.yaml POccupation OccupationList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPartner\Gui\Setup\PartnerStatusSetup.yaml PPartnerStatus PartnerStatusList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPartner\Gui\Setup\PartnerTypeSetup.yaml PType PartnerTypeList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPartner\Gui\Setup\PublicationCostSetup.yaml PPublicationCost PublicationCostList Yes Yes Yes Yes No Yes No No No No No Yes Yes
MPartner\Gui\Setup\PublicationSetup.yaml PPublication PublicationList Yes Yes Yes Yes No Yes No No No No No Yes Yes
MPartner\Gui\Setup\ReasonSubscriptionCancelledSetup.yaml PReasonSubscriptionCancelled ReasonSubscriptionCancelledList Yes Yes Yes Yes No Yes No No No No No Yes Yes
MPartner\Gui\Setup\ReasonSubscriptionGivenSetup.yaml PReasonSubscriptionGiven ReasonSubscriptionGivenList Yes Yes Yes Yes No Yes No No No No No Yes Yes
MPartner\Gui\Setup\RelationCategorySetup.yaml PRelationCategory RelationCategoryList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPartner\Gui\Setup\RelationshipSetup.yaml PRelation RelationList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\AbilityAreaSetup.yaml PtAbilityArea AbilityAreaList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\AbilityLevelSetup.yaml PtAbilityLevel AbilityLevelList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\ApplicantStatusSetup.yaml PtApplicantStatus ApplicantStatusList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\ArrivalDeparturePointSetup.yaml PtArrivalPoint ArrivalDeparturePointList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\Country_EventLevelSetup.yaml PtOutreachPreferenceLevel OutreachPreferenceLevelList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\DocumentTypeCategorySetup.yaml PmDocumentCategory DocumentTypeCategoryList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\DocumentTypeSetup.yaml PmDocumentType DocumentTypeList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\DriverStatusSetup.yaml PtDriverStatus DriverStatusList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\EventRoleSetup.yaml PtCongressCode EventRoleList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\JobAssignmentTypeSetup.yaml PtAssignmentType JobAssignmentTypeList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\LanguageLevelSetup.yaml PtLanguageLevel LanguageLevelList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\LeadershipRatingSetup.yaml PtLeadershipRating LeadershipRatingList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\LeavingCodeSetup.yaml PtLeavingCode LeavingCodeList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\OrganisationContactSetup.yaml PtContact ContactList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\PassportTypeSetup.yaml PtPassportType PassportTypeList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\PositionSetup.yaml PtPosition PositionList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\ProfessionalAreaSetup.yaml PtQualificationArea QualificationAreaList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\QualificationLevelSetup.yaml PtQualificationLevel QualificationLevelList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\SkillCategorySetup.yaml PtSkillCategory SkillCategoryList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\SkillLevelSetup.yaml PtSkillLevel SkillLevelList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MPersonnel\Gui\Setup\TransportTypeSetup.yaml PtTravelType TransportTypeList Yes Yes Yes Yes Yes Yes No No No No No Yes Yes
MSysMan\Gui\Setup\LanguageSpecificSetup.yaml SLanguageSpecific LanguageSpecificList Yes Yes Yes Yes No Yes No No No No No Yes Yes

Screens Based on Template: WindowEditUIConnector (3 files use this template. The following have Add/Delete functionality)

Filename DetailTable Has New Button Has Delete Button Has Auto-delete Has ReferenceCount Has Deletable Flag Has Enable Delete Calls .Delete() Manual Calls Auto PreDelete DeleteRow PostDelete Client/Server Match Multi Select
MFinance\Gui\Budget\MaintainBudget.yaml ABudget Yes Yes Yes Yes No Yes No No Yes Yes Yes Yes Yes

Screens Based on Template: WindowEditWebConnectorMasterDetail (1 files use this template. The following have Add/Delete functionality)

Filename DetailTable Has New Button Has Delete Button Has Auto-delete Has ReferenceCount Has Deletable Flag Has Enable Delete Calls .Delete() Manual Calls Auto PreDelete DeleteRow PostDelete Client/Server Match Multi Select
MFinance\Gui\AP\APEditDocument.yaml AApDocumentDetail Yes Yes Yes Yes No Yes No No Yes No Yes Yes Yes

Screens Based on Template: ControlMaintainTable (29 files use this template. The following have Add/Delete functionality)

Filename DetailTable Has New Button Has Delete Button Has Auto-delete Has ReferenceCount Has Deletable Flag Has Enable Delete Calls .Delete() Manual Calls Auto PreDelete DeleteRow PostDelete Client/Server Match Multi Select
MFinance\Gui\Gift\UC_GiftBatches.yaml AGiftBatch Yes Yes Yes Yes No Yes No No No Yes Yes Yes Yes
MFinance\Gui\Gift\UC_GiftTransactions.yaml AGiftDetail Yes Yes Yes Yes No Yes No No Yes Yes Yes Yes Yes
MFinance\Gui\Gift\UC_RecurringGiftBatches.yaml ARecurringGiftBatch Yes Yes Yes Yes No Yes No No No Yes Yes Yes Yes
MFinance\Gui\Gift\UC_RecurringGiftTransactions.yaml ARecurringGiftDetail Yes Yes Yes Yes No Yes No No Yes Yes Yes Yes Yes
MFinance\Gui\GL\UC_GLBatches.yaml ABatch Yes No n/a Yes No n/a Yes No No No No n/a No
MFinance\Gui\GL\UC_GLJournals.yaml AJournal Yes No n/a Yes No n/a Yes No No No No n/a No
MFinance\Gui\GL\UC_GLTransactions.yaml ATransaction Yes Yes Yes Yes No Yes No No No Yes Yes Yes Yes
MFinance\Gui\GL\UC_RecurringGLBatches.yaml ARecurringBatch Yes Yes Yes Yes No Yes No No No Yes Yes Yes Yes
MFinance\Gui\GL\UC_RecurringGLJournals.yaml ARecurringJournal Yes Yes Yes Yes No Yes No No No Yes Yes Yes Yes
MFinance\Gui\GL\UC_RecurringGLTransactions.yaml ARecurringTransaction Yes Yes Yes Disabled No Yes No No No Yes Yes n/a Yes
MFinance\Gui\Setup\UC_AccountAnalysisAttributes.yaml AAnalysisAttribute Yes Yes Yes Yes No Yes No No Yes No No Yes Yes
MFinance\Gui\Setup\UC_SetupAnalysisValues.yaml AFreeformAnalysis Yes Yes Yes Yes No Yes No No No No No Yes Yes
MPartner\Gui\UC_Applications.yaml PmGeneralApplication Yes Yes Yes Yes No Yes No No Yes Yes Yes Yes Yes
MPartner\Gui\UC_FinanceDetails.yaml PBankingDetails Yes Yes Yes Yes No Yes No No Yes Yes Yes Yes Yes
MPartner\Gui\UC_IndividualData_Abilities.yaml PmPersonAbility Yes Yes Yes Yes No Yes No No No No Yes Yes Yes
MPartner\Gui\UC_IndividualData_CommitmentPeriods.yaml PmStaffData Yes Yes Yes Yes No Yes No No Yes No Yes Yes Yes
MPartner\Gui\UC_IndividualData_JobAssignments.yaml PmJobAssignment Yes Yes Yes Yes No Yes No No Yes No Yes Yes Yes
MPartner\Gui\UC_IndividualData_Passport.yaml PmPassportDetails Yes Yes Yes Yes No Yes No No No No Yes Yes Yes
MPartner\Gui\UC_IndividualData_PersonalDocuments.yaml PmDocument Yes Yes Yes Yes No Yes No No Yes No Yes Yes Yes
MPartner\Gui\UC_IndividualData_PersonalLanguages.yaml PmPersonLanguage Yes Yes Yes Yes No Yes No No No No Yes Yes Yes
MPartner\Gui\UC_IndividualData_PersonSkills.yaml PmPersonSkill Yes Yes Yes Yes No Yes No No Yes No Yes Yes Yes
MPartner\Gui\UC_IndividualData_PreviousExperience.yaml PmPastExperience Yes Yes Yes Yes No Yes No No Yes No Yes Yes Yes
MPartner\Gui\UC_IndividualData_ProgressReports.yaml PmPersonEvaluation Yes Yes Yes Yes No Yes No No Yes No Yes Yes Yes
MPartner\Gui\UC_PartnerRelationships.yaml PPartnerRelationship Yes Yes Yes Yes No Yes No No Yes No Yes Yes Yes
MPartner\Gui\UC_Subscriptions.yaml PSubscription Yes Yes Yes Yes No Yes No No Yes No Yes Yes Yes
MPartner\Gui\Extracts\UC_ExtractMaintain.yaml MExtract Yes Yes ??? Yes No No Yes Yes Yes No No Yes Yes
MPartner\Gui\Extracts\UC_ExtractMasterList.yaml MExtractMaster No Yes No Yes No No Yes Yes Yes No No Yes No

Screens Based on Template: ControlMaintainCacheableTable (1 files use this template. The following have Add/Delete functionality)

Filename DetailTable CacheableTable Has New Button Has Delete Button Has Auto-delete Has ReferenceCount Has Deletable Flag Has Enable Delete Calls .Delete() Manual Calls Auto PreDelete DeleteRow PostDelete Client/Server Match Multi Select
MPartner\Gui\Setup\UC_ContactAttributeDetail.yaml PContactAttributeDetail ContactAttributeDetailList Yes Yes Yes Yes No Yes Yes No No No Yes Yes Yes

Summary

 17 potential issues found in 4 files
 There are 98 New/Add buttons in the application
 There are 96 Delete/Remove buttons in the application
  92 of these call the auto-delete function
  3 of these call a manual delete function
    4 of these call the auto-delete function from manual code

A Blue cell indicates an unusual entry that is 'by design'.
A Yellow cell indicates an unusual entry that requires investigation.