Example Code to Remove Blank Records

The following script removes blank records.

Note: You might have different criteria for what constitutes a blank record. Modify the following script accordingly.
function Service_InvokeMethod (MethodName, Inputs, Outputs)

{

   if (MethodName == "Insert")

   {

    var oBusObj = TheApplication().GetBusObject("UCM FINCORP Account Source Data and 
History");

      var oBusCompFAP = oBusObj.GetBusComp("UCM FINCORP Account Privacy Source Data and 
History");

      var oBusCompFACP = oBusObj.GetBusComp("UCM FINCORP Account Contact Privacy Source 
Data and History");
       with (oBusCompFAP)
      {
          ClearToQuery();
           ActivateField("Affiliate Flag");
           ActivateField("Nonaffiliate Flag");
           ActivateField("Telemarketing Flag");
           ActivateField("Channel Flag");
           SetSearchSpec("Affiliate Flag", "IS NULL");
           SetSearchSpec("Nonaffiliate Flag", "IS NULL");
           SetSearchSpec("Telemarketing Flag", "IS NULL");
           SetSearchSpec("Channel Flag", "IS NULL");
           ExecuteQuery(ForwardBackward);
           while(FirstRecord())
          {
             DeleteRecord();
             NextSelected();
          }
       }
       with (oBusCompFACP)
       {
          ClearToQuery();
            ActivateField("Affiliate Flag");
            ActivateField("Nonaffiliate Flag");
            ActivateField("Telemarketing Flag");
            ActivateField("Channel Flag");
            SetSearchSpec("Affiliate Flag", "IS NULL");
            SetSearchSpec("Nonaffiliate Flag", "IS NULL");
            SetSearchSpec("Telemarketing Flag", "IS NULL");
            SetSearchSpec("Channel Flag", "IS NULL");
            ExecuteQuery(ForwardBackward);
            while(FirstRecord())
           {
               DeleteRecord();
               NextSelected();
           }
              }
            }
          }