Is there a way to pass variable of Record (or RecordRef) type as a parameter to method of .NET object?
Asked
Active
Viewed 192 times
2
-
But how do you want it to appear on .NET side — as an object with fields as properties? – sergeyol Jul 06 '17 at 18:13
-
@sergeyol yes as datatable or something – Mak Sim Jul 06 '17 at 19:33
-
I don't think this would be possible... Though, it'd be nice if it was automatically (and well) cast just like Stream/InStream/OutStream, etc. – Jake Edwards Jul 06 '17 at 23:55
-
Have a chat with Vjeko (http://vjeko.com/) - he is the guy who knows the most about .NET + NAV – azatoth Jul 10 '17 at 15:04
1 Answers
1
In theory it is not possible pass like datatable or something else. What you can do is to create a public class in .NET that is visible in NAV, complete the data of that class and pass the .NET class as a parameter with the data in the NAV table.
For example table 18 (Customer) you can create a .NET class with the same structure, call this class in NAV code, complete the data in NAV and then pass this class with the same fields data as table 18 to .NET
If you need pass a parameter multiples registers of the same table create a Array of this .NET class perform a loop, assing the values and pass one by one to .NET
I made a code similar to the one I told you about and it works correctly.

Jonathan Bravetti
- 2,228
- 2
- 15
- 29