Problem with doo.form.openform()

Hello,
I have an issue with a simple task: opening a new form via a push button. After pressing the button with this script:

(async (doo: IDoo) => { // do not change this line

try{
doo.form.openForm(“bTKReminder_2”);
console.log(“done”);
}
catch (error){
console.log(“err:”,error);
}
}) // do not change this line

I get this error:

I’d be grateful for any advice. Thank you.

Hi,

I send example how to use openForm. information in consoli says that there are missing fields to create new form see documentation: doo.form - Tabidoo Help Center

const options: IOpenFormOptions = {
        model: {
            number: 1000
        }
    };
    await doo.form.openForm('company',options);

Regards,

Filip

It works. Thank you, Filip.

Hi Filip,

I would like to reopen this thread. If I prefill the form with the function above and the prefilled item is a linked table, everything looks correct. The item gets prefilled with the proper values, and it is possible to save this prefilled form. However, the created form loses the prefilled values.

Example to clarify situation: I have the following tables: Customer, Contract, and Invoices.
In the Contract table, there is an item customer (a link to the Customer table) and also a button that calls the script below. This script opens a new form in the Invoice table and prefills the customer item (which is also a link to the Customer table).

JS script:

const options: IOpenFormOptions = {
model: {
number: 1000,
polozka2: doo.model.zakaznik.value,
posledniBTKKontrola : doo.model.planovanaRealizace.value
}
};
await doo.form.openForm(‘bTKReminder_2’,options);

Best regards,
Zdenek

Hey, what fields get lost? number, position2, lastBTKKontrola? Is it possible to use the Console to find out what is happening with the form?

Filip

Hi,

I sent you the problem description along with a video to support@tabidoo.cloud.

Zdenek