Creating a response document that inherits fields via Java?

OK, there’s got to be something really simple I’m missing here. Users need to frequently migrate documents from OldDB to NewDB; however when they get migrated into NewDB, various fields need to have restricted access because we have a much larger set of Roles in NewDB.

I have a Java agent in OldDB users run that does newDoc = oldDoc.copyToDatabase(NewDB). Now my plan is to create several newResponse documents based on newDoc that inherit various fields from it. That way, I can ensure that some strict Readers fields are on the different newResponse documents, ensuring that various UserRoles either can or cannot ever see those newResponse documents. Then, the agent will finally delete a number of these confidential fields from newDoc.

The problem is that the newResponse documents aren’t inheriting any of the parent’s data. I’ve tried various combinations of .save and .computeWithForm on both the newDoc and newResponse, along with using makeResponse of course. The $RSP response pointer gets setup correctly, but none of the fields (either calculated or calc on compose) actually inherit any of the main newDoc’s field data, even though the form bit is set on as well.

Am I missing something about response documents inheriting parent document data? Can this not be done by the backend classes or something wierd? I know the answer is really simple! (even if it’s “No, because of this doc here…”)

Alternately, any suggestions on alternate ways to implement this would be appreciated.

oldDoc has fields F1, F2, F3…F298

In newDB, AllRole should be able to see F1 in newDoc

In newDB, StaffRole should also be able to see F2 associated with newDoc somehow

In newDB, ManagerRole should also be able to see F2 and F3 associated with newDoc somehow

I don’t want to list all fields to copy to various places because that’s a maintenance nightmare.

I don’t want to use encryption keys, mainly because it’s terribly ugly - AllRole people would always get the “you don’t have the encryption key…” dialog, so even though they could read the form if F2, F3 were encrypted, it would result in user confusion

Thanks in advance!

Subject: Creating a response document that inherits fields via Java?

Inheritance only happens at the moment of composition. In other words, it’s a strictly UI function, which means inheritance and Java are mutually exclusive. Rather than inheriting, you need to set the field values explicitly in your code. No way around it, I’m afraid.