Activate certain column?

Hi All! i’ve got a form with a subform. My Problem is the following: if the user inserts a new record in the subform by pressing F3 or moving the pointer below the last record then a certain column should be activated. I’ve tried it with Currform.Linenumber.ACTIVATE in the OnNewRecord-Trigger of the subform, but this gives an internal error 101 in module 60 at calling the mainform without any records in the subform. Any solution out there? Thanks in advance, Frank

Are you sure you want to activate the linenumber? I just ask as this is usually a hidden field and activating a hidden field means trouble. The OnNewRecord trigger is not the right place as this trigger is being called before the record exists. Use “OnAfterGetRecord” instead and make sure that the record exists:

if linenumber <> 0 then

------- With best regards from Switzerland Marcus Fabian

Hi Marcus, Many thanks for your reply! It is not the Navision-Standard-field Linenumber,so it is not a hidden one. It’s a new field which is filled with 1,2,3,… and so on. The OnAfterGetRecord Trigger does not work! In this case the field is activated when i move on an existing record. But i want to move the curcor automatically into this field only when a new record is insert. Any other solution out there in the wide world? Frank

On the Sub form us the OnNewRecord trigger. This is fired when the users presses F3 or goes past the las record. Paul Baxter

OnNewRecord allways activeted first primary key field. So if your is in primary key: Hide, or setfilters (PopulateAllFields = YES) on all primary key fields before your field. If not: Fill primary key fields, insert rec & activete your field. don’t forget delete this rec if no data inputed. Do you think that activate is worth it?

Thanks Paul, but this is the Solution which i’ve tried first, described above and brigns an error. Greeting, Frank

Thanks Dalius, thats it! And I think its not worth it, but one Customer wants this function. I will ask him once again if he really needs this function. Greeting, Frank

Do you checked sales lines sub form? There was set property DelayedInsert to Yes. In this way activate works on new rec.

Hi Dalius, In my Subform the DelayedInsert-Property is set to Yes. Greetings, Frank