Can't get new foundset

I have new records I need to add to an existing table. Below is the code to do so, but when I run it I get the message “Can’t get new foundset for: db:/diagnosis_procedure/diagsnew”
What am I missing here? In developer when I select the fields to import the "record. " is displaying all fields in this database/table as it should. I am using Version: 6.1.2 - build 1421

/**
 * @properties={typeid:24,uuid:"9B724F9C-283F-4398-BFFA-7176AF081F9B"}
 */
function migratenewdiagnosis(){
	/** @type {JSFoundSet<db:/diagnosis_procedure/diagsnew>} */
	var newdx = databaseManager.getFoundSet('diagnosis_procedure','diagsnew');
	newdx.loadAllRecords();
	
	/** @type {JSFoundSet<db:/eyecor/diagnosis>} */
	var diagnosis = databaseManager.getFoundSet('eyecor','diagnosis');
	diagnosis.loadAllRecords();
	
	for(var i = 1; i<=newdx.getSize(); i++ ){
		var record = newdx.getRecord(i);
		if(diagnosis.newRecord()){
			diagnosis.code = record.codeicd10;
			diagnosis.description = record.description;
			diagnosis.alt_terms = record.altterms;
			diagnosis.pearls = record.pearls;
			diagnosis.flag_medical = 1;
			diagnosis.code_type = "ICD10";
			diagnosis.codingtips = record.codingtips;
			diagnosis.notes = record.notes;
		
		}	
	}
}

Thank you,
Bob

I figured out the issue -
the new table I was pulling from did not have a PK set.
Once a PK was set everything imported as it should.