AL icon indicating copy to clipboard operation
AL copied to clipboard

"The type or method 'AddAttachment' cannot be used for 'Extension' development" even if it is external

Open rishiaurrishabh opened this issue 8 years ago • 5 comments

Hi ,

I am trying to use SMTP.Addachment function in AL Extension 2.0 but it is throwing an error : "message": "The type or method 'AddAttachment' cannot be used for 'Extension' development.",

image

when i see it in development environment of my sandbox then it is showing this function as external

image

strange thing is that it only happens when I create a new package using my sandbox but if I copy and paste a package from NAV 2018 and link it with same sandbox then it works.

rishiaurrishabh avatar Jul 18 '18 04:07 rishiaurrishabh

When I'm opening my sandbox C/Side Dev Environment I can see that the function "AddAttachment" is internal.

In NAV 2018 the function was external.

When you copy and paste a package from NAV 2018 you are referencing to the wrong symbols, when creating a new package you are using the symbols of the BC sandbox.

Conclusion: Always keep your symbols up2date 😄

dNsl9r avatar Jul 18 '18 06:07 dNsl9r

@dNsl9r , even after downloading symbols it doesn't show any error on that work space :smiley: . the build of my sandbox has Addattachment function as External. I do understand one thing that the new build has this function as internal but then it should not be conflicting with my extension as I haven't taken that image from docker yet. Though it will make sense when it will show that error on deploying extension at business central but it should not give me this error for my container where I don't have that codebase.

image

rishiaurrishabh avatar Jul 18 '18 06:07 rishiaurrishabh

The function is Internal on the latest BC builds so you should not use it anymore:) Whether you see a compiler error or not depends on which exact symbols you have downloaded locally and it looks correct based on your description/screenshots.

StanislawStempin avatar Jul 24 '18 08:07 StanislawStempin

Thanks @StanislawStempin ....I got a workaround for it so closing the issue.

rishiaurrishabh avatar Jul 24 '18 08:07 rishiaurrishabh

Hi, what was the work around for this ?

kapoorsidhant avatar Sep 17 '18 07:09 kapoorsidhant