web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

type matching DotNet argument

(0) ShareShare
ReportReport
Posted on by 10

Please see the code below.

.Net expect `List<BCLibrary.Contact>`, but I am not sure how to specify it in AL.

Any help appreciated. Thanks

bsr.


```
dotnet
{
assembly(BCLibrary)
{
type(BCLibrary.BCRouteManager; BCRouteManager) { }
type(BCLibrary.Contact; Contact) { }
type(BCLibrary.UploadContactResponse; UploadResponse) { }
}

// assembly(mscorlib)
// {
// type("System.Collections.Generic.List`1"; "List_Of_T") { }
// }
}

codeunit 50100 WrapperCodeunit
{
procedure UploadContacts(Contacts: Record Customer)
var
BCRouteManager: DotNet BCRouteManager;
Customer: Record Customer;
ContactL: DotNet Contact;
ListL: DotNet List_Of_T;
Response: DotNet UploadResponse;

begin
BCRouteManager := BCRouteManager.BCRouteManager();

CreateContact(0, customer.Name, customer.Address, ContactL);
ListL.Add(ContactL);

Response := BCRouteManager.UploadContact('TODO', ListL) //TODO:
// ListL --> Argument 2: cannot convert from 'DotNet "System.Collections.Generic.List<System.Object>"' to 'DotNet "System.Collections.Generic.List<BCLibrary.Contact>"


end;
}


```

I have the same question (0)
  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: type matching DotNet argument

    Hello,

    We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist. If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    dynamicsuser.net/.../developers

    I will open this up to the community in case they have something to add.

    Thanks.

  • bsr203 Profile Picture
    10 on at
    RE: type matching DotNet argument

    Hello Marco,

    Thank you for pointing to the right forum. I have issues accessing both

    Is yammer is internal Microsoft forum. I never used yammer,  it say it is for organizations and it asked for work email. Though I provided mine, never got an invite.

    dynamicsuser.net/.../developers is not accessible. Do you mean

    www.dynamicsuser.net/.../14

    I am new to the platform and thanks again for your help. Please let me know what is this form mainly for?

    Thanks

    bsr.

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: type matching DotNet argument

    Hello,

    That is a bummer, I think you run into this issue:

    www.microsoftpartnercommunity.com/.../27131

    Anyway, I am working for Microsoft support and the message is that we are not resourced to provide development type of support via community.

    This community which is also led by partners / MVP's may be able to assist you.

    And thank you for providing me the correct link to the other forum. It seems that I am sharing an old link for which I need to apologize.

    Thank you so much.

  • bsr203 Profile Picture
    10 on at
    RE: type matching DotNet argument

    Hello,

    thank you for the time to respond to me. I do understand the limitation to provide support and will reach out to other avenues.

    Thanks

    Bsr.

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: type matching DotNet argument

    No problem. Usually there are MVP's / partner that give it a try and respond to you in this forum. Note that we also have the Ready To Go program:

    docs.microsoft.com/.../readiness-ready-to-go

    There is also a different Yammer group listed, maybe that one is OK and provides you with that required email.

    Hope someone in this forum will give you that answer you are looking for.

    Thank.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,069 Moderator on at
    RE: type matching DotNet argument

    You can find some samples here that might help you:

    docs.microsoft.com/.../devenv-get-started-call-dotnet-from-al

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,351

#2
Sumit Singh Profile Picture

Sumit Singh 2,072

#3
YUN ZHU Profile Picture

YUN ZHU 1,807 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans