Calling a Codeunit from Dataport and pass a variable as rec

smnnekho
Member Posts: 3
Hi,
i do know navision (from a users point of view) quite well, but have no knowledge of C/AL whatsoever (unfortunatly)
I've written a .net application which (amongst user things) would allow the user to automatically complete components etc.
Right know this is done via a dataport (my application collects the data, provides the csv, opens a production order and calls the dataport vie a send-key shortcut for a button i put on the form. this is actually pretty failsave)
However, for "post components" i do pretty much the same thing - but i'm not really happy with the keysendstuff to post a lot of components. (though it works 90% reliably and i have some failsaves built in).
That is why i would really like to run the specific codeunit after the dataport is processed. i know WHERE and even more or less HOW to do it. What i do not know is how to pass the neccessary REC-value (Production header --> No., optionally multiple ) the importet dataport to the codeunit.
Can anybody help me? a rough hint would be nice, i'll try to digg in there myself then.
Thanks in Advance!
i do know navision (from a users point of view) quite well, but have no knowledge of C/AL whatsoever (unfortunatly)
I've written a .net application which (amongst user things) would allow the user to automatically complete components etc.
Right know this is done via a dataport (my application collects the data, provides the csv, opens a production order and calls the dataport vie a send-key shortcut for a button i put on the form. this is actually pretty failsave)
However, for "post components" i do pretty much the same thing - but i'm not really happy with the keysendstuff to post a lot of components. (though it works 90% reliably and i have some failsaves built in).
That is why i would really like to run the specific codeunit after the dataport is processed. i know WHERE and even more or less HOW to do it. What i do not know is how to pass the neccessary REC-value (Production header --> No., optionally multiple ) the importet dataport to the codeunit.
Can anybody help me? a rough hint would be nice, i'll try to digg in there myself then.
Thanks in Advance!
0
Comments
-
A rough example on how to do this :-
Create a function in the codeunit that has the production order as a parameter.
In that use the passed in parameter to get the production order and do your stuff.
Call this function from the dataport (perhaps one for each order).Sleep on it... The best solutions come at 2am0 -
prototyper wrote:A rough example on how to do this :-
Create a function in the codeunit that has the production order as a parameter.
In that use the passed in parameter to get the production order and do your stuff.
Call this function from the dataport (perhaps one for each order).
i cannot change the codeunit (and if i could i wouldn't be able to do it properly (; )
but the codeunit already has the parameter.
My question is a) how to pass the parameter with the codunit.run command (i guess i have to declare a global variable with type record?)
b) how to tell the dataport to use the appropriate fields from the imported data for the codeunit parameter.0 -
smnnekho wrote:My question is a) how to pass the parameter with the codunit.run command (i guess i have to declare a global variable with type record?)smnnekho wrote:b) how to tell the dataport to use the appropriate fields from the imported data for the codeunit parameter."Money is likewise the greatest chance and the greatest scourge of mankind."0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions