I didnt work out why it was happening but I have fixed the issue, so this might be useful if anyone experiences similar problems.
Changed my create form button to call a function and set the fields and save the document and redirect back to it.
function createRegionalPolicy() {
try {
var valid:boolean = true;
writeToLog("createRegionalPolicy Starting");
var RegionalPolicyDoc:NotesDocument = database.createDocument();
RegionalPolicyDoc.replaceItemValue("form","FPolicy");
RegionalPolicyDoc.computeWithForm(true, false);
RegionalPolicyDoc.replaceItemValue("createdBy", @Name("[CN]", @UserName()));
RegionalPolicyDoc.replaceItemValue("RFCEnvironment", "CSR Compliance Portal");
RegionalPolicyDoc.save();
var uid:string = RegionalPolicyDoc.getItemValueString("UID");
writeToLog("UID: " + uid);
context.redirectToPage("XP_Policy.xsp?documentId=" + RegionalPolicyDoc.getUniversalID() + "&action=editDocument" );
}
catch(e){
valid = false;
writeToLog("Problem creating RegionalPolicy document: " + e);
}
finally {
return valid;
}
}