(I'm sure) An easy NAV Addin question

daborgdaborg Member Posts: 54
edited 2012-08-10 in NAV Three Tier
I am developing a NAV Addin for a sales demo using a Telerik WinForms RadChart control. I have created a page and linked the addin control to the "No." field. My question is, inside of my Visual Studio code, how do I reference that "No." field value so that I can pass it to the chart for filtering? I'm fine with the chart side of things, I just don't know how to reference the value of "No.".

Thanks.

(I apologize ahead of time for this extremely newb question :P )

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Have you already checked out this blog?

    http://blogs.msdn.com/b/cabeln/

    Most information that you need should be there.
  • matttraxmatttrax Member Posts: 2,309
    You need to raise a control addin event from your .NET code. That will call the OnControlAddIn trigger where you can pass some values, like XML, back to the .NET code. MSDN has some examples of how to do this if I remember correctly.
  • daborgdaborg Member Posts: 54
    Perhaps I should provide some more info.

    Basically what I have is a list page and a factbox. The factbox contains my chart addin. What I would like is for the chart to update as the user selects a record in the list. The NAV side is set up fine so my factbox is linked to the list just fine. I created a simple "label addin" using one of the samples I found and I verified that the label does show the field value as expected when selecting different values from the NAV list page.

    My problem is when I change my addin to be the chart, I cannot get it to update when the different records are selected from the list. Any idea how I go about doing that? Unfortunately my .NET knowledge is probably close to "next to none" so if someone could provide help "as dumbed down as possible that'd be great.
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Make your factbox bound to the same table as the list, and link them
  • daborgdaborg Member Posts: 54
    Make your factbox bound to the same table as the list, and link them

    Yes I have this working already. My fact box is correctly linked and in fact if my adding on the fact box page is just a simple label or text box, then it updates fine. I think the issue I'm having here is that my control (a Telerik RadChart) is not a simple control. I'm wondering how I get the chart to refresh itself when the user selects records on the list. Using an old school method of message boxes, my "CreateAddin" procedure seems to be called only once when the page initially opens. I kind of understand that it paints the control once when the page opens and at that point afterwards it just needs refreshing maybe!? It's the refreshing part that escapes me right now. ](*,)
  • matttraxmatttrax Member Posts: 2,309
    That is correct. OnAfterGetRecord does not fire when you click from record to record in the RTC. The SubformLink property works when it is a simple page to factbox link, but not a "real" add-in.

    Take a look at the Enhanced Notes add-in I wrote in the download section. Page 50000 is written around this fact and has work arounds for it, albeit semi-complicated.
  • KarlRhodesKarlRhodes Member Posts: 37
    On a semi related point. I too am trying to use Telerik controls in an RTC add-in control.

    I have rebuilt the Telerik source code so its specific to my DLL (set the OemAssemblyName in the Telerik source etc) and have copied my dll and the Telerik DLLs i compiled into the add-in folder on my test laptop, but I still get the error..

    "Could not locate the add-in library for 'MyControl;PublicKeyToken=BlahBlahBlah'.

    The Telerik DLLs I've copied are

    TelerikCommon.dll
    Telerik.WinControls.dll
    Telerik.WinControls.UI.dll
    Telerik.WinControls.UI.Design.dll
    Telerik.WinControls.Scheduler.dll

    My Control needs external configuration etc so it has a config file - mycontrol.dll.config - which I have also copied across, as well as the mycontrol.pdb and mycontrol.xmlserializers.dll files just to make sure I have everything...

    Does anyone have any ideas as to why I'm getting this error still?
  • KarlRhodesKarlRhodes Member Posts: 37
    Ok, so I'm getting somewhere...

    When registering your add-in dll, you also need to register any related dlls. I have added the Telerik dlls into the Control Add-in table and its started working.

    As for needing to have a config file. I've just created my own xml file and reference this. Not sure why I never thought of it before.
  • deV.chdeV.ch Member Posts: 543
    That's weird because you don't need to register dependency dll's in the addin table, but i think the addin importer made by Christian has problems with dependency dll's
    But i rely on 3d party assemblies too, but i haven't registered them in nav. What i do is i manually create the entries without the register tool.
    For deployment to the customer i use a dataport from which i export the entries and import them to the customer db.
  • KarlRhodesKarlRhodes Member Posts: 37
    Indeed!!

    I've confirmed this though by removing the dependant DLLs from the control add-in table and it stops working again.
Sign In or Register to comment.