FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.



Aug 7, 2013, 9:22 AM
93 Posts
topic has been resolvedResolved

Value on saved when debug panel is open

  • Category: Other
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 1

Hi guys,

 

I am using the debug custom control, (issue is not here)

I set a text field and save a document then run some workflow code against it. All fields that are filled in on my xpage are saved on the backend document, except one!

However, if I have debug panel showing, the value is then stored on the backend document. (Debug images at bottom of the post)

 

Has anyone experienced this or have any ideas?

In the beforePageLoad code I have: viewScope.formDescription = "FPolicy";

 

The default value for the field in question is:

if(viewScope.formDescription = "FPolicy"){
writeToLog("WORKS");
return "CSR Compliance Portal" 
}else{
writeToLog("Not Working");
return "NOT SET"}

Then the code on a field that builds a string of 3 fields, including the field above is: (RFCEnvironment is the field name above / Key 2 in the code below, and the field that is not saving)

var key1 = String(currentDocument.getValue("flow_step"));

if(key1 == null || key1 == "null" || key1 == ""){
key1 = "10";
}
var key2 = getComponent("RFCEnvironment").getValue();
if(key2 == null || key2 == "null" || key2 == ""){
key2 = "CSR Compliance Portal";
}
 
var key3 = getComponent("domain").getValue();
key2 + "|" + key3 + "|" + key1;

 

Thanks for any pointers

 

BEFORE DEBUG PANEL IS ENABLED 

 

 

AFTER DEBUG PANEL IS ENABLED 

Aug 8, 2013, 10:04 AM
93 Posts
Fixed

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;
 
 
}
}

FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.