Search code examples
xpagesssjs

Unable to Parent Child Relationship in xpages


I have an xpage where I am having two data sources parentDoc and childDoc. On click of button 1st time parent is saved and id is passed to child document created on couple of interface field than user can add multiple child documents later on clicking of this button. I have created UI interface to meet this requirement.

But somehow system is saving parent document but unable to save child document. I have created a button on page with the following code.

var cDoc:NotesDocument = database.createDocument();
print ("Document Created");
cDoc.replaceItemValue("Form" , "KPLPDPChild");
cDoc.replaceItemValue("ParentDocID" , viewScope.parentDocID);
cDoc.replaceItemValue("kp_omc" , getComponent("omc").getValue());
cDoc.save();

but this is also not saving the record in database. interesting is that when data in UI field is entered its not saving.

Thanks, Qaiser


Solution

  • You may have forgotten to set ignoreRequestParams="true" on the child dominoDocument datasource. There is definitely o technical limitation to using parent-child relationships in XPages.