Control addin - partial update

WildcardWildcard Posts: 26Member
Hello,

I have an addin with to have an interactive image on a page. It worked well and I wanted to change one of the trigger.
Like adding a parameter on a event ... The parameter is not shown on the trigger on the page.

After I just changed the name without the parameter (like the version that was ok before). The new name does not appear but the change in the function is working. The publication of the events does not work.

I remove everything .zip, code in nav, dll and in the control addin. Redo everything but nothing change. I'm I missing something ?

Thanks


Wildcard

Answers

  • Tony_NCDTony_NCD Posts: 5Member
    If I understand you correctly, you created a control add-in and subsequently made a change to the control's code but it doesn't appear to be updating in the C/AL codes, however, the changes do appear in the function of the control that you modified, correct?
  • WildcardWildcard Posts: 26Member
    the triggers in the page are not changed (I deleted the control addin, made it completely new somewhere in another page) but the changes I do in the control addin are visible

    For example I just changed the event name in the control addin (no change in NAV), i add an alert('test') and I receive the alert

    Everything is updated, execpt the event ...
  • Tony_NCDTony_NCD Posts: 5Member
    This is by design. The way to refresh the codes in NAV, which is kind of bad, but you have to remove and add the control back in. The easiest way to do that is to go to the Properties window, look for the ControlAddIn property, cut out out the value, hit enter, and NAV will ask you to confirm. Choose Yes and this will wipe out all existing codes that are generated by this add-in. Go back and paste the value back in. When you go back into the C/AL Editor, you'll see the new functions or parameters that you added to your add-in.

    The bad thing about this is that all your codes, the ones that you've written in NAV, in the add-in's code blocks, will be lost. To circumvent that, create a function, which can even be the same name, then reference that function from the control add-in's code. For example, I have an add-in that exposes a method called DownloadLink. This shows up as ControlName::Method. Instead of adding NAV codes to this method, I create a NAV method with the same parameters and pass this parameter over. This way, when I have to refresh, the only thing I need to do is add the DownLoad(...); line back in.

    NAVCoreLiveLinks::DownloadLink(url : Text;saveAsFile : Text)
    DownloadLink(url, saveAsFile);
Sign In or Register to comment.