This method returns the selected primary key and its friend(friend is a foreign key)
xxxxxxxxxx
async get_result(): Promise<crud_result>{
Get the currently selected table-row(tr) from the theme panel as there has to be one from check -time.
xxxxxxxxxx
const tr = <HTMLTableRowElement>this.theme.target!.querySelector(".TR");
Get the primary key of the selected table-row(tr) as an auto number.
xxxxxxxxxx
const pk = tr.getAttribute("pk");
Check the returned primary key selection which has to be a string, whereas if the value is not a string then an error occurred i.e. the last save was not successful. Then return the user defined error.
xxxxxxxxxx
if (pk == null)
throw new schema.mutall_error(`The primary key for a selected tr not found`);
Get the foreign key(friend) component of the record and there must be one. Compile the valid selection and return the primary key and the friend(foreign key).
xxxxxxxxxx
const friend = tr.getAttribute("friend")!;
if (friend === null) {
throw new schema.mutall_error(`The friendly component of tr ${pk} is not found`);
}
//
return {pk, friend};
}