Hi everyone,
I prepared c# code where I added some data and i want to get this data in NAV.
Everything is ok, when I only display this data in C# code (for example with MessageBox.Show), but when i'm trying to get this in C/AL (MESSAGE(data)) - something is wrong, because it does not work.
This is Control Add IN, so i added field on the page with this AddIn, and i'm trying to enter the c/al code in ControlAddIn trigger.
What is wrong?
Code on this screen below:
DnD = DotNet Variable with my AddIn .dll.
Drag a File And Drop - field on the page with ControlAddInProperty - add in name + add in public token.
How can I get any datas from my dotnet dll? I need this, because I have to add some information about drag and drop files to nav tables.
Code which I want to have in NAV.
public void picbox_dnd(Object sender, DragEventArgs e) { string[] filecollection = (string[])e.Data.GetData(DataFormats.FileDrop); foreach (string file in filecollection) { data = Path.GetFullPath(file); MessageBox.Show(data); } }
Thanks for any ideas!
*This post is locked for comments
Send it to abeywicrema@gmail.com
Sure, where can I send you my dll?
Can you share you dll if you do not mind. I will try locally and tell you what exactly you want to do.
Thanks, but for example: " this.RaiseControlAddInEvent(index, data);" does not work in new versions of NAV.
I read this article and I don't find solution for my issue.
Do you want maybe another ideas?
May be this will help you
[View:https://msdn.microsoft.com/en-us/library/dd983804(v=nav.90).aspx:750:50]
As per the example you do not want to write code if you have properly set all the required things.
If my answer make you to resolve your problem, please verify it by clicking Yes
Regards
Shan Abeywickrema
I only need to retrieve path of the dropped file from this DLL and add it as a text variable. Later I will use this data to upload files to BLOB.
It's not important for me, where can I get any data from this dll, but I want to do it somewhere.
That means when you try this alone with code unit. it works for you ? You need this on Page OnControlAddin trigger ?
Thanks for your reply.
I know, how to call this function, but OnControlAddIn trigger does not work.
When i am trying to do something in this trigger, (i.e. C/AL MESSAGE('x')_ and when I'm running my page this code is not displaying. I want to use this trigger, but I can't.
// As I guess this would be your Constructor Call
Dnd := Dnd.DroGDrop;
Then you need to call your method Dnd.picbox_dnd right with sending proper parameters.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156