very desperate with getting field content

Hello everybody ! I’m reallly desperate. Heres my problem: I put a command button on a normal form (ID 30,Item), from which a push action calls myCodeunit. How do I get now the content of e.g. “No.” from the form “Item Card” in myCodeunit ? CurrentForm.GETRECORD(Item); only doesn’t work, Item.“No.” will be empty. It only works like this: CurrentForm.RUNMODAL; CurrentForm.GETRECORD(Item); but then every time when I press my new command button, the form “Item card” window opens again. Who can help me ??? Thx in advance…

Why don’t you just set the property TableNo of myCodeunit to “Item”? Then you could call your codunit from the Item Card simply with this statement: [Ok] := Codeunit.RUN(, Rec); Thus, in your codeunit you have all info you need!?

Thanks stryk, but … I think it doesn’t work. I want to get the current “No.” the user selected (is currently seen on screen). Any other idea ? Sascha

Just an FYI this is a good post for the beginners forum…[^]

Better descriped: I want to get the current “No.” the user selected on the FORM !!! Thanx so much…

I think Joergen’s suggestion should work, did you try it? This is a pretty basic Navision feature, unless I am missing something?

The current “No.” is just a you type. If MyCodeunit has a function you can use MyCodeunit.Function(“No.”); But if MyCodeunit is to be called with a ItemRec in the Run trigger you can use the RunObject property from the menuitem and use no code, because this is Navision Default.

Thank you Mark, now I’ve got it … …with function call (But nevertheless, sometimes Navision is strange: I worked on the problem, some hours, I couldn’t manage it. Navision behaved strange ! Then I closed it and start it again: Everything was o.k…?!) Thanks to all … Sascha

No offence - but perhaps it was error 40 [8D]