Custom table - Table Level Script

SUGGESTED

Help! Please!  I think I am running into an issue with a table level script where perhaps I cannot see the forest for the trees. :-(

I have a custom entity and if I update a field on that entity, I want to update another field on the same entity and other fields on other custom entities using the field I just updated.

I am able to update the other fields on other custom entities just fine...but I cannot get another field on the same entity to update using the field I just updated.

The custom entities are Property, Unit, Tenant, Lease.  A Tenant's LeaseNum is made up of a PropertyNum and a TenantNum.  Therefore, if I update the TenantNum on the Tenant, I want the LeaseNum on that record to update as well.  I cannot get this to  work and I am not sure what I am doing wrong.  Originally I was using Values() to update the LeaseNum field.  It would appear correctly on the screen after save.  However, as soon as I refreshed the screen, the TenantNum portion would come back undefined.  Therefore, I updated it to what I have below.  Everything in this table level script works as desired...except for the update to the LeaseNum on the Tenant Record.  I have highlighted the portion that is NOT working.

The LeaseNum updates correctly on the Unit and Lease record using the same variables.  However, there is NO CHANGE to the LeaseNum on the Tenant record.

Any assistance would be greatly appreciated!!!

function UpdateRecord()
{

var tenant = CRM.FindRecord('Tenant',WhereClause);
var propID = tenant.tena_propertyid;
var tenantnumD = tenant.tena_number;
var tenantnumV = Values("tena_number");

var prop = CRM.FindRecord('Property', 'prop_propertyid='+propID);
var propnumD = prop.prop_number;

var unit = CRM.FindRecord('Unit', 'unit_propertyid='+propID);
var lease = CRM.FindRecord('Lease', 'leas_propertyid='+propID);

//Change to tenant number============================================
if (tenantnumD!=tenantnumV) {

//Update Tenant Record--------------------------------------------------------------------------------
//LeaseNum = PropNum-TenantNum
while (!tenant.EOF)
{
tenant.tena_leasenum = propnumD+'-'+tenantnumV;
tenant.NextRecord();
}
tenant.SaveChangesNoTLS();


//Update Lease Record---------------------------------------------------------------------------------
while (!lease.EOF)
{
lease.leas_tenantnum = tenantnumV;
lease.leas_number = propnumD+'-'+tenantnumV;
lease.NextRecord();
}
lease.SaveChangesNoTLS();

//Update Unit record-------------------------------------------------------------------------------------
while (!unit.EOF)
{
unit.unit_tenantnum = tenantnumV;
unit.unit_number = 1;
unit.unit_leasenum = propnumD+'-'+tenantnumV;
unit.NextRecord();
}
unit.SaveChangesNoTLS();

}
}