AssistEdit - Probleme mit Vorbelegung Felder

18. September 2009 12:02

Hallo Zusammen,

ich habe ein Problem mit der Vorbelegung von Feldern einer Tabelle, deren Form über Tabelle A über einen AssistEdit aufgerufen wird.

Folgender Hintergrund:

Tabelle A)
Felder Code Code 20
Nr. Code 20
Verbund Code 20 (TR. auf Tabelle B.Verbund Where Code=Code,Nr.=Nr.)

Tabelle B) Code Code 20
Nr. Code 20
Verbund Code 20


Wenn in der Form auf AssistEdit geklickt wird, soll Tabelle B) mit den bereits in Tabelle A) vorhandenen Werten Code und Nr. vorbelegt werden, was ich bekomme ist eine komplett leere Form. Rufe ich das ganze über Lookup auf, so erfolgt eine Vorbelegung.

TRs auf Formebene existieren keine.


Im OnAssistEdit von Verbund in Tabelle A) wird die Form für Tabelle B) aufgerufen mit

if Form.runmodal(Form::<FormID>)=Action::LookupOk then;


Jetzt habe ich irgendwo folgendes gefunden:

Table relationships should not be define on a form level anyway, and lookup code should also not be programmed on the form, unless it is a situation that is unique for that particular form. Generally speaking, when you define a table relationship, it is on a table level, and the same relationship should exist on every form for that table. If you define the relationship on form 1, then form 2 will not have the same relationship, and you can have bad results. now if the relationship is set on a table level, it will behave the same way on every form, without having to change any of them.

What is important to know, is that as soon as you add any local variables, or any C/AL code (even comment lines, even a blank line with nothing on it) in the assistedit or lookup triggers on the form, that breaks the relationship set in the table.


Weiss allmählich nicht mehr weiter. Kann mir irgendjemand einen Tipp geben?


Danke.

Re: AssistEdit - Probleme mit Vorbelegung Felder

18. September 2009 12:07

Abgesehen davon, dass ich den ganzen Vorgang (was, warum) nicht ganz verstehe -

laha2108 hat geschrieben:Wenn in der Form auf AssistEdit geklickt wird, soll Tabelle B) mit den bereits in Tabelle A) vorhandenen Werten Code und Nr. vorbelegt werden, was ich bekomme ist eine komplett leere Form. Rufe ich das ganze über Lookup auf, so erfolgt eine Vorbelegung.
- warum arbeitest du nicht ausschließlich mit dem Lookup? Wozu die Programmierung des OnAssistEdit?