Add Button (save and open new form) on Form EcoResProductCreate


Now I have no error on method, but the form is closed and saved record, in my scenario I want to prevent of closing form just new record and clear values

void clicked()

if (element.validateWrite())
if (element.write())

closedOK = false;



I think you are using a command button (OK). Try using a normal button.

Hi Kranthi

I changed the command of my button to normal button and now the form is saving the records and the form its not being closed which is perfect, but it is not clearing the field values after clicking the button.
What should I do!


You may have to clear them explicitly in your code.


How to clear them ?


Example → identification_ProductNumber.text(’’); // take the control name and set the value.
If the product number is auto generated, you should also trigger the code to generate the product number and item id.

when I click the button for the first time all fields are saved and cleared but when I try for the second time record is not be
ing save, I am geting an error (Cannot create a record in Product number (EcoResProductIdentifier). Product number: 150193.
The record already exists.)

Are you assigning the new product after clearing the values? Start looking at, \Forms\EcoResProductCreate\Methods\write


I stuck in this case , could you be more specific on how to assign the new product after clearing the values.


Try by calling, initNumberSequences method after creating new record and clearing the values.
If you still see the issue have a look at, \Forms\EcoResProductCreate\Methods\setProductNumber