Convert @Compose to rossetajs in Design Import

Hi,

I have a view in Domino ("Workday Types") with a button to create a new doc (@Command([Compose];"FTJL"). The form name is "12.- Workday Type | FTJL"

When I import this project in Volt MX GO, and go to the form to the view in Iris, i see the button and the script in this button is:

return voltmx.rosettajs.Create.compose("FTJL");

The button doesn´t nothing and in the console of browser is showed a RoserraJS Error "Form not specified"

Looking at the rosettajs Create.compose method I see that two parameters are expected (servername and Form). Which values are expected to pass? The objectName in foundry as ServerName?

Thanks

Hi Jordi,

First I thank you for the post because it gives me a chance to expand in depth what HCL Software development team is trying to achieve with all the Domino -> MX tool sets. Let me explain from a high level down to code level.

Dai

At a high level, Domino will execute for you a number of "hidden" steps so that the activity you are trying to achieve is seamless. For example, in the HCL Notes app, when you have a DB opened with forms, views, and documents, you click on "create" -> "form name", Notes will make sure that Domino database is open and a document is already selected at the view level.

Hence, after Design Import, you examined the "imported" button along with its converted Javascript from your Domino script and found it would error when run:

return voltmx.rosettajs.Create.compose("FTJL");

The core issue is that the above code line needs all the "hidden" steps typically done either programmatically in a Domino agent or in the Notes client UI. That is some code have to precede the line above for it to work. Specifically you have to call to open the Domino DB.

You can view the documentation for the "compose" command here:

https://help.hcl-software.com/dom_designer/14.0.0/basic/H_COMPOSE.html

Please note the requirements "... When you compose a response document, make sure a database is open and a document is already selected at the view level..."

At the Volt MX code level, you have several ways to solve this issue.

First option, we realize the purpose of your Domino button in the Notes app, is to create a new document. Hence, in your Volt Iris IDE, your Iris button does not have to execute the equivalent Javascript for the Domino command "@Command([Compose];"FTJL" (return voltmx.rosettajs.Create.compose...). The button's action should be to navigate to the Design Import generated Volt Iris form for document-create. Your Volt Iris' list of Iris "forms" (upper left side of the Iris IDE and under Desktop -> Forms) there should be a form with the name pattern "frm<Domino-Form-name>Create". For example, I have Iris form named frmCDRLFormCreate, which was generated by Design Import to create Domino document. I attached a video of my Volt Iris IDE and the changing of a button's action to navigate:

https://hclsw.box.com/s/bhufp1xvo2dnvcpt052mzxxrtgojuxya

My Volt Iris IDE has a Design Import generated Domino project containing the frmMXGOsn6cdrl3scopeDashboard, which on click for view CDRLs, will navigate to the grid form viewCDRLsGrid. Form viewCDRLsGrid has a button showing "Add New CDRL Entry" which is very similar to your "create" button. I changed its low-code action script from executing a formula with "... voltmx.rosettajs.Create.compose..." to navigating to the create form "frmCDRLFormCreate".

Alternatively, if you wish to make your Volt Iris IDE -> Design Import generated code to work in your "new Domino document" button, your script will need to also call the SDK voltmx.rosettajs.File.fileOpenDatabase API, as followed:

voltmx.rosettajs.File.fileOpenDatabase(
"name of Foundry Domino-adapter Object ",
"name of Foundry Domino-adapter Object -> Domino view data-model", "1");

You can refer to the HCL Rosetta API javadoc, here: https://opensource.hcltechsw.com/voltmxgo-documentation/javadoc/module-file.html

Thus your "create new document" button in Volt Iris IDE should contain the 2 JS lines below in its low-code action script:

voltmx.rosettajs.File.fileOpenDatabase(
"name of Foundry Domino-adapter Object ",
"name of Foundry Domino-adapter Object -> Domino view data-model", "1");

voltmx.rosettajs.Create.compose("name of Foundry Domino-adapter Object ",
"name of Foundry Domino-adapter Object -> Domino view data-model"
);

Here is my code sample from a Design Import generated Volt Iris project:

// MXGOsn6_cdrl3scope is Volt Foundry Domino-adapter Object name generated by Design Import.
// CDRLs is Volt Foundry Domino-adapter Object data model name of a Domino view, generated by Design Import.

voltmx.rosettajs.File.fileOpenDatabase(
“MXGOsn6_cdrl3scope”,
“CDRLs”, “1”);

alert(“rosettajs.File.fileOpenDatabase with MXGOsn6_cdrl3scope & CDRLs”);

// bTmp shall be “true” if Create.compose call is successful.
let bTmp = voltmx.rosettajs.Create.compose(“MXGOsn6_cdrl3scope”, “CDRLs”);
alert("Rosetta create MXGOsn6_cdrl3scope & CDRLs document. Result = "+ bTmp);

Thanks very much Dai Nguyen