Working with forms

Hi all.

I kindly request to know how you manage getting data from a form(a) to a different form(b). Both forms(a&b) have similar fields. Whats the approach of any piece of code to achieve the same? I thought of creating a function in form(a) and using this function to pass details to form(b). However my code on OnPush trigger of the function fails.

Kindly assist with ideas.

Thanks.

Hi,

You must create the funcion in the destination form. The arguments must have set the VAR bool. And the source form must has created the destination form first.

The above approach only applies of formB is being run from formA. If the forms are being called independently then use a single-instance codeunit to pass data.

Good Posting babrown, I’m just discover the single-instance property.

Thank you.

Thanks.

Yea, the two forms are independent. Only that data from formA should get to formB. How about coding in the forms and not using codeunits? This is the approach I have taken for now.

If the forms are run independently then they know nothing about each other. How did you plan to pass the data?

One form is a journal, the other is an entry form. Therefore, I expected any data I feed on the journal to be passed to the entry form, where I can eventually analyse my transactions.

Rgds.

What you are describing is 2 forms reading the same data. Not 2 forms passing information between them. What you describe is no different then the “interaction” between the Customer Card form and the Customer List form.