Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subforms #63

Open
sattam-datum opened this issue Jan 7, 2021 · 5 comments
Open

Subforms #63

sattam-datum opened this issue Jan 7, 2021 · 5 comments

Comments

@sattam-datum
Copy link

Is there a way to get subforms related to a specific form?

In standard notes. jar I can get any subform by name using Database.getForm but
I didn't find any linkage between form and related subforms

@klehmann
Copy link
Owner

klehmann commented Jan 8, 2021

I just added NotesDatabase.getForms():
3777879
20e6230

Next I will take a look at subform usage. Should be possible by traversing the design richtext ($body item).

@klehmann
Copy link
Owner

And here are the methods to read subform names and formulas:
80cc4d4

@sattam-datum
Copy link
Author

thanks,
Can you add sample code of how to use it?
And when will you release latest artifact?

@frocentus
Copy link

I think you can always have a look at the test-code to see how to use the new methods: https://github.com/klehmann/domino-jna/blob/master/domino-jna/src/test/java/com/mindoo/domino/jna/test/TestDesignFormAccess.java

@klehmann
Copy link
Owner

Here is a snippet:

NotesDatabase db = new NotesDatabase("", "mydatabase.nsf", "");
NotesForm form = db.getForm("MyFormWithSubform");
				
//read the design richtext
IRichTextNavigator rtNav = form.getNote().getRichtextNavigator("$Body");
				
//returns pairs of dbreplicaid/subformname that are contained in the form
//(replica id "0000000000000000" for the same db as the form)
List<Pair<String,String>> namedSubforms = RichTextUtils.collectNamedSubforms(rtNav);
				
//returns a list of subform formulas
List<String> subformFormulas = RichTextUtils.collectSubformFormulas(rtNav));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants