{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/AL/issues/953","repository_url":"https://api.github.com/repos/Microsoft/AL","labels_url":"https://api.github.com/repos/Microsoft/AL/issues/953/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/AL/issues/953/comments","events_url":"https://api.github.com/repos/Microsoft/AL/issues/953/events","html_url":"https://github.com/Microsoft/AL/issues/953","id":275066346,"number":953,"title":"Passing Data to ControlAddin wont deploy","user":{"login":"faludigabor","id":16480091,"avatar_url":"https://avatars2.githubusercontent.com/u/16480091?v=4","gravatar_id":"","url":"https://api.github.com/users/faludigabor","html_url":"https://github.com/faludigabor","followers_url":"https://api.github.com/users/faludigabor/followers","following_url":"https://api.github.com/users/faludigabor/following{/other_user}","gists_url":"https://api.github.com/users/faludigabor/gists{/gist_id}","starred_url":"https://api.github.com/users/faludigabor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/faludigabor/subscriptions","organizations_url":"https://api.github.com/users/faludigabor/orgs","repos_url":"https://api.github.com/users/faludigabor/repos","events_url":"https://api.github.com/users/faludigabor/events{/privacy}","received_events_url":"https://api.github.com/users/faludigabor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-18T09:18:00Z","updated_at":"2017-11-18T10:35:16Z","closed_at":null,"author_association":"NONE","body":"Hi , \r\n\r\nI was just playing around w/ the controladdin feature and I get an exception i would like to call a JS method .  Is it me ? \r\n\r\n**here is the AL code** . \r\ncontroladdin TestAddIn\r\n{\r\n    \r\n    Scripts = 'js/main.js';\r\n    StartupScript = 'js/startup.js';\r\n    event DemoEvent(prop1 : text[100]);\r\n\r\n    **event getCustomerName(Name : text[100]);**\r\n}\r\n\r\n**page 50300 PageWithAddIn**\r\n{\r\n    SourceTable = \"Customer\";\r\n   \r\n    \r\n    layout\r\n    {\r\n        area(Content)\r\n        {\r\n            field(Name; Name) {\r\n             trigger OnValidate();\r\n             begin\r\n                **CurrPage.ControlName.getCustomerName(Name);**\r\n             end;\r\n            }\r\n            usercontrol(ControlName; TestAddIn)\r\n            {\r\n                \r\n\r\n                trigger DemoEvent(prop1:text[100])\r\n                begin   \r\n                    Message(prop1);\r\n                end;\r\n            }\r\n        }\r\n    }\r\n \r\n}\r\n\r\n**and the JS code :** \r\nfunction OnButtonClicked() {\r\n    var i = 1;\r\n    alert('Clicked from JS');\r\n    PassDataToNAV(new Date());\r\n\r\n\r\n}\r\n\r\nfunction PassDataToNAV(data){\r\n    Microsoft.Dynamics.NAV.InvokeExtensibilityMethod('DemoEvent', [data]);\r\n}\r\n\r\n**function getCustomerName(CustomerName){\r\n    alert('Data from NAV: ' + CustomerName);\r\n}** \r\n\r\n\r\n**Exception received:** \r\n\r\n[2017-11-18 10:11:29.93] The request for path /nav/dev/apps failed with code InternalServerError. Reason: c:\\ProgramData\\Microsoft\\Microsoft Dynamics NAV\\110\\Server\\MicrosoftDynamicsNavServer$NAV\\source\\Page\\Group120feac9f17dd9a6723bea7019c91ec7_Page50300.cs(271,17) : error CS0012: The type 'Microsoft.Azure.ActiveDirectory.GraphClient.Extensions.IEntityBase' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Azure.ActiveDirectory.GraphClient, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.\r\nc:\\ProgramData\\Microsoft\\Microsoft Dynamics NAV\\110\\Server\\MicrosoftDynamicsNavServer$NAV\\source\\Page\\Group120feac9f17dd9a6723bea7019c91ec7_Page50300.cs(271,56) : error CS1061: 'Microsoft.Dynamics.Nav.Runtime.NavDotNet' does not contain a definition for 'Invoke' and no extension method 'Invoke' accepting a first argument of type 'Microsoft.Dynamics.Nav.Runtime.NavDotNet' could be found (are you missing a using directive or an assembly reference?)\r\n\r\n\r\nthanks,\r\ngabor\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/AL/issues/comments/345433464","html_url":"https://github.com/Microsoft/AL/issues/953#issuecomment-345433464","issue_url":"https://api.github.com/repos/Microsoft/AL/issues/953","id":345433464,"user":{"login":"ajkauffmann","id":19155831,"avatar_url":"https://avatars2.githubusercontent.com/u/19155831?v=4","gravatar_id":"","url":"https://api.github.com/users/ajkauffmann","html_url":"https://github.com/ajkauffmann","followers_url":"https://api.github.com/users/ajkauffmann/followers","following_url":"https://api.github.com/users/ajkauffmann/following{/other_user}","gists_url":"https://api.github.com/users/ajkauffmann/gists{/gist_id}","starred_url":"https://api.github.com/users/ajkauffmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajkauffmann/subscriptions","organizations_url":"https://api.github.com/users/ajkauffmann/orgs","repos_url":"https://api.github.com/users/ajkauffmann/repos","events_url":"https://api.github.com/users/ajkauffmann/events{/privacy}","received_events_url":"https://api.github.com/users/ajkauffmann/received_events","type":"User","site_admin":false},"created_at":"2017-11-18T10:35:16Z","updated_at":"2017-11-18T10:35:16Z","author_association":"CONTRIBUTOR","body":"Change the line in the controladdin\r\n\r\n`event getCustomerName(Name : text[100]);`\r\n\r\nto\r\n\r\n`procedure getCustomerName(Name : text[100]);`\r\n\r\nYou controladdin code then looks like:\r\n\r\n```\r\ncontroladdin TestAddIn\r\n{\r\n  Scripts = 'js/main.js';\r\n  StartupScript = 'js/startup.js';\r\n  event DemoEvent(prop1 : text[100]);\r\n  procedure getCustomerName(Name : text[100]);\r\n}\r\n```"}}
{"actor":{"display_login":"ajkauffmann"}}