Options

Extra Contextual Data from Add-in

BrentNewburyBrentNewbury Member Posts: 11
edited 2012-03-28 in NAV Three Tier
Hi everyone,

I'm trying to create a .NET add-in control to Dynamics NAV 2009 SP1. This add-in will contain controls (i.e. buttons) which launch other processes or make calls to web-services, passing contextual data about the form the control is placed on. For example, if the add-in control is on a Customer Card page, when a button is clicked it will retrieve extra data about the current customer and pass it to a web-service. Another example would be, retrieving ledger data for a selected ledger entry, if my add-in control is placed on the Customer Ledger Entries page. This is just an example, but what I'm asking is (and this might be a basic question); how do I get hold of, or query, that data?

From my current add-in, all I can do is pass a single value in to the add-in, e.g. the customer "No." (by setting the SourceExpr property on the add-in control in the Object Designer).

Other API's I've come across have a large business object model and pass this information to an add-in. The API for Dynamics NAV doesn't do this, or doesn't do this in the same way.

My second question is, is there any way to install an add-in automatically and have the relevant pages, e.g. Customer Card, Vendor Card, Customer Ledger Entries, etc., altered to include my add-in, rather than having someone manually place the add-in on the page using the Object Designer? This is purely to achieve a simple install from a client perspective. What I've found so far is that I can place an assembly in the Add-ins folder, add a record to the Client Add-in table. But so far, the objects/arrangement in the Object Designer have alluded me. I think it may be stored in the BLOB Reference column of the Object table, but stored in an encrypted form. No encoding I've tried will display an image (which is the column type) or coherent plain text. This is just a huntch, as I saw no other file access from the Role Tailored Client in the Sysinternals Process Monitor when saving my customised Customer Card page.

Please feel free to tell me if you believe I'm doing anything wrong, or going about this the wrong way. Also be aware that I don't know C/AL, but accept I may need to learn it.

Thank you for any input you can provide.

Regards,

Brent Newbury

Comments

  • Options
    kinekine Member Posts: 12,562
    1) You cannot add the addin to the pages automatically, you can only export the objects into text, made the changes auomatically (somehow), import back, compile.
    2) You need to pass all info through the "one" value. But this value could be XML, thus keeping "many" values inside.
    3) For me what you described smells by "big brother" - a way to take the data from NAV and send them somewhere else... could be dangerous... :-k
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    BrentNewburyBrentNewbury Member Posts: 11
    On points 1 and 2; what mechanism or API can I employ to achieve this?
  • Options
    kinekine Member Posts: 12,562
    You cannot do it from the addin. It must be pushed into the addin, not pulled from inside.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    BrentNewburyBrentNewbury Member Posts: 11
    How would data be pushing into the add-in? Would it involve a Codeunit or XMLport? I apologise for what is probably a basic question.
  • Options
    kinekine Member Posts: 12,562
    The way is just on the developer. I recommend to study the TimeLine demo or the TreeView demo page how the data are pushed into the addins. Or you can look at my UniWPF addin demo.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    BrentNewburyBrentNewbury Member Posts: 11
    Thanks for advice kine, it's very much appreciated.
Sign In or Register to comment.