Custom Dynamics 365 CRM Integration in Business Central

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ย. 2024

ความคิดเห็น • 83

  • @daryobahar8405
    @daryobahar8405 11 หลายเดือนก่อน

    Hi Erik, this video was very useful for me. Thank you for making such videos showing ways that otherwise would be very difficult to find. Thank you again.

  • @aramadan66
    @aramadan66 3 ปีที่แล้ว

    Hi Erik, this is one of he most valuable Video I found anyway about custom integration!
    I'm tryin to map the 'Document date field' to new field in custom field in CRM ''Invoice Date' within 'Sales Invoice Header' table
    Not sure what I'm missing, here is my code unit:
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"CDS Setup Defaults", 'OnAfterResetConfiguration', '', true, true)]
    local procedure HandleOnAfterResetConfiguration(CDSConnectionSetup: Record "CDS Connection Setup")
    var
    IntegrationFieldMapping: Record "Integration Field Mapping";
    crmInvoice: Record "CRM Invoice";
    bcInvoice: Record "Sales Invoice Header";
    begin
    InsertIntegrationFieldMapping(
    IntegrationFieldMapping,
    bcInvoice.FieldNo("Document Date"),
    crmInvoice.FieldNo("new_invoicedate"),
    IntegrationFieldMapping.Direction::ToIntegrationTable,
    '', true, false);
    end;

    • @Hougaard
      @Hougaard  3 ปีที่แล้ว +1

      That code excerpt seems to be incomplete? Are you following this guide: docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/administration/administration-custom-cds-integration ?

    • @aramadan66
      @aramadan66 3 ปีที่แล้ว

      @@Hougaard Thanks, I managed to make it work but the Document date from BC goes to CRM as UTC date.
      Example: Date in BC 2021-09-01 showing in CRM as 2021-08-31

    • @Hougaard
      @Hougaard  3 ปีที่แล้ว

      A date field in BC does not have a timezone, so it's important that the field you replicate to is the same.

  • @nav2031
    @nav2031 3 หลายเดือนก่อน

    Hi, Erik Thanks for the video. Is there a way to map fields with table relation? When I try to do this on version 24 It gives this error: "The field Item No. must not have a relationship with another table." How to sync data on such fields?

  • @ВалерійЛуцьо-и6о
    @ВалерійЛуцьо-и6о ปีที่แล้ว

    Hi, Erik!
    Thanks for your work, you share really important knowldge and you do it in a way that everything is clear (at least for me personally=). A also have a question about tables with TableType = 'CRM'; Do they store data in SQL? And also can I subscribe to their Trigger Events (like OnAfterInsertEvent)? I'd really apperciate your answer!

    • @Hougaard
      @Hougaard  ปีที่แล้ว +1

      Not stored, triggers are only called when you do stuff, not if someone inserts a record from CRM.

  • @plymouthfop
    @plymouthfop 3 ปีที่แล้ว

    Wow, thank you! Is there something you can point to to show how you would do something the opposite way, so the sales team can get information about current jobs, and/or maybe the customers' unpaid balance, etc?

    • @Hougaard
      @Hougaard  3 ปีที่แล้ว

      Virutal entities do also exist on the Dynamics 365 CE side.appsource.microsoft.com/en-us/product/dynamics-365/microsoftdynsmb.businesscentral_virtualentity?tab=overview

  • @aramadan66
    @aramadan66 3 ปีที่แล้ว

    Just want to say you are awesome!

  • @vectork5865
    @vectork5865 3 ปีที่แล้ว

    Good Stuff!! Thanks a Mill, Eric!

  • @iamabdullahzafar
    @iamabdullahzafar 2 ปีที่แล้ว

    Hi Erik,
    Thank you for such a great video,
    Do you have any idea about integrating choices column type with business central? I have integrated Option/Lookup it worked fine, but not sure about choices, especially Bi-directional syncronization.
    Best Regards

    • @Hougaard
      @Hougaard  2 ปีที่แล้ว

      Single choice should map to option fields

    • @iamabdullahzafar
      @iamabdullahzafar 2 ปีที่แล้ว

      @@Hougaard what if we have multiple choice?

  • @henryverheij6945
    @henryverheij6945 2 ปีที่แล้ว

    Hi Erik,
    thanks a lot for this video.
    I have a question about solving this warning. Do you need to continue until all warnings are solved or is it sufficient to only fix them on the table you actually want to integrate with?
    If you want to fix all warnings then we'll finally end up with all tables. Nice but maybe not necessary?

    • @Hougaard
      @Hougaard  2 ปีที่แล้ว

      No, just do the tables you need and leave the rest.

  • @raulsaez9393
    @raulsaez9393 3 ปีที่แล้ว

    Hi Erik, this works like a charm on sandbox, but I´ve a further issue when trying to install the app on the BC production environment, it is given me an error stating that lot of field id´s are outside the 50000..99999 range, but the thing is the id´s are given by the Altpgen.exe tool when creating the al proxy table from customer or contact CRM tables. Do you know how to fix that?
    Thanks in advance!

  • @GeekUpdates
    @GeekUpdates ปีที่แล้ว

    How can i connect Sales Header to CRM Invoice?

  • @ashuqullah557
    @ashuqullah557 2 ปีที่แล้ว

    Thanks Erik for the hard work however I'm new to BC development but learned a lot from you, I really appreciated. I have a question, I want to integrate the "Item Variant" table from Business Central to CRM custom entity, Can you please guide me trough the steps. I want to link the custom CRM "Product Variant" entity to products to pull out data from Business Center Item Variant table. Thanks

    • @Hougaard
      @Hougaard  2 ปีที่แล้ว +1

      But that's kinda what this video is about?

    • @ashuqullah557
      @ashuqullah557 2 ปีที่แล้ว

      @@Hougaard Actually my requirement is somehow the reverse of this tutorial, an existing field from Business center for exmple " External Document No" to custom field "icd_external doc" in CRM. How to add the "External Document No" to 'Integration Field Mapping List'.
      Please guide me through the steps, Thanks

  • @Chris-id1vy
    @Chris-id1vy 4 หลายเดือนก่อน

    Hi Erik, could you may give an advice for a good architectural approach to connect several BC environments (different localisations) with 1 global CRM instance? for me it is not 100% clear how all of this is intended to be. Kind regards, Christoph

    • @Hougaard
      @Hougaard  4 หลายเดือนก่อน

      That's gonna break :)

    • @Chris-id1vy
      @Chris-id1vy 4 หลายเดือนก่อน

      How do you mean that?

    • @Hougaard
      @Hougaard  4 หลายเดือนก่อน

      @@Chris-id1vy THe integration doesn't understand splitting a single CRM instance between multiple Business Central instances. We have tried it several times, and data get messed up and intertwined between business central instances. Not a pretty sight.

    • @Chris-id1vy
      @Chris-id1vy 4 หลายเดือนก่อน

      Do you think that will change in future? Do you have any recommendation? So would the intendet setup be to have 1 crm per country (like in bc) and consolidate the customers afterwards in the datawarehouse?

    • @Chris-id1vy
      @Chris-id1vy 4 หลายเดือนก่อน

      Or Individual interface development not using the Integration?

  • @heimdaldk
    @heimdaldk 4 ปีที่แล้ว +1

    Do you have triggers on the CRM Tables? etc. OnModify, to detect changes made in CRM from BC.

    • @Hougaard
      @Hougaard  4 ปีที่แล้ว +2

      You do have trigger yes, but they will of course only be triggered from BC, not if the record is changed in CRM.
      But the OnValidate, OnInsert,OnModify,OnDelete works normally from the BC side.
      I should have shown that, thanks for asking!!

    • @babalolaomotayomiganiyu8540
      @babalolaomotayomiganiyu8540 3 ปีที่แล้ว

      @@Hougaard Thanks for this But I have tries to call function in the OnInsert trigger but noting happened. I mean when the record is inserted from CRM?

    • @Hougaard
      @Hougaard  3 ปีที่แล้ว

      @@babalolaomotayomiganiyu8540 OnInsert is only called if you do .INSERT() from BC, not from CRM.

    • @babalolaomotayomiganiyu8540
      @babalolaomotayomiganiyu8540 3 ปีที่แล้ว

      @@Hougaard I have a client that doesn't want to be managing the customer creation scheduling via Job queue. They want me to create the customer as soon as its inserted from CRM. Any idea how I can handle that? Thanks

    • @Hougaard
      @Hougaard  3 ปีที่แล้ว

      @@babalolaomotayomiganiyu8540 You gotta look into webhook docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/use-webhooks?view=op-9-1

  • @abhishekdasgupta5580
    @abhishekdasgupta5580 ปีที่แล้ว

    Hi Erik,
    Thanks for this important video!
    I'm currently working on the BC-CE integration. I have a column on the CE side in the Accounts table which is lookup type (having a custom table on the CE side) and I would like sync this column value to BC Customer Entity. I have added the same column in CRM Account extension table in BC with Data type=Text and I put the exactly ExternalName & ExternalType=String but while syncing the Customer from CE to BC this column is not getting populated. It means on the CE side the field type is lookup but on the BC side the data type is text (string)...is there any problem? do I need to create any transformation rules or do I have to use the same data type which is Lookup on the BC side as well?
    Thanks in advance!

    • @Hougaard
      @Hougaard  ปีที่แล้ว

      You also need the table the lookup goes to

    • @abhishekdasgupta5580
      @abhishekdasgupta5580 ปีที่แล้ว

      @@Hougaard Thanks Erik! Do I need to sync the new table data to BC as well? Or it’s just table relation purpose?

  • @mra119
    @mra119 ปีที่แล้ว

    Have you come across any 3rd party tools to handle integration between CRM & BC to make it easier for front-end users to manage integration fields & tables?
    Love your channel!!

    • @Hougaard
      @Hougaard  ปีที่แล้ว +2

      There's a few, they all suck in my opinion.

    • @mra119
      @mra119 ปีที่แล้ว

      @Hougaard thanks. I'm not a fan of standard connector too. 😂

    • @nahearnd3658
      @nahearnd3658 ปีที่แล้ว

      @@Hougaard What's their biggest drawbacks usually?

  • @mirashenouda
    @mirashenouda ปีที่แล้ว

    Hi Eryk, I came into an issue while using the power automate connector and trying to update a customer record using update record and using the standard API but the Mobile no. Is not exposed any ideas why?

    • @Hougaard
      @Hougaard  ปีที่แล้ว

      Because Microsoft didn't add that field to the API endpoint. You'll have to expose your own endpoint with the fields you need instead.. Perhaps use the Simple Object Designer if you don't want to write AL ( www.hougaard.com/designer )

    • @mirashenouda
      @mirashenouda ปีที่แล้ว

      @@Hougaard okay that makes sense, I have another issue you might be able to guide me in which direction to look ..we have extended the customer table and page and API already by adding a new field using AL, in power automate I can see the new field and on the API but whenever I query the API it returns Resource not found for segment and the new extended table

  • @hugo_alves
    @hugo_alves 2 ปีที่แล้ว

    Hi Erik, me again
    would you have a hint on how to integrate these tables that are actually Option/Choice on CRM side?
    I want to create Paym Methods on BC and synch them ToIntegration, but it is not working. It does not even generate Synch Job Log.

    • @Hougaard
      @Hougaard  2 ปีที่แล้ว

      There's a standard way of extending that now...

  • @babalolaomotayomiganiyu8540
    @babalolaomotayomiganiyu8540 3 ปีที่แล้ว

    Does OnAfterInsertEvent Trigger or any other trigger work on this TableType?

    • @Hougaard
      @Hougaard  3 ปีที่แล้ว +1

      Only if the users are inserting a record from a Business Central page.

  • @troelsbjerregaard1477
    @troelsbjerregaard1477 2 ปีที่แล้ว

    This is awesome! I have tried this out, but when it comes to option members, in the accounts table from CRM, I have some fields where the option members in CRM contains spaces, but in the accounts table generated with PowerShell all the spaces are removed. Do you have any idea as to why this is happening? Thanks.

    • @Hougaard
      @Hougaard  2 ปีที่แล้ว

      Just fix it manually in the file afterward :)

    • @troelsbjerregaard1477
      @troelsbjerregaard1477 2 ปีที่แล้ว

      @@Hougaard Yeah, thats what I have been doing, but wanted to make it a little easier to maintain.

  • @hugo_alves
    @hugo_alves 2 ปีที่แล้ว

    Hi Erik,
    i am integrating Country List from BC (Lookup) to CRM (free text).
    One step is to create the Country Table in Dataverse (4-5 fields, easy).
    What if it was a huge table with tens of fields? Should we create it manually?
    Any chance to copy the existing structure from BC to Dataverse just as you've shown with altpgen.exe?
    Thanks 👍

    • @Hougaard
      @Hougaard  2 ปีที่แล้ว

      If you expose the country table as an API, then you can use that as a virtual table in CRM.

  • @Charan9120
    @Charan9120 3 ปีที่แล้ว

    How can I map account Id to a customer no field for a custom table, do I need to include in field mappings

    • @Hougaard
      @Hougaard  3 ปีที่แล้ว

      Customer No. is already mapped into the Statistics entity.

  • @meshayabbas
    @meshayabbas 3 ปีที่แล้ว

    Hello, thank you for creating this video! Could you please let me know how can I by pass this Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'altpgen, Version=6.1.5.53653, Culture=neutral, PublicKeyToken=xxx' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A) ---> System.Security.SecurityException: Strong name validation failed. (Exception from HRESULT: 0x8013141A)

    • @Hougaard
      @Hougaard  3 ปีที่แล้ว +1

      Make these changes to your registration
      reg DELETE "HKLM\Software\Microsoft\StrongName\Verification" /f
      reg ADD "HKLM\Software\Microsoft\StrongName\Verification\*,*" /f
      reg DELETE "HKLM\Software\Wow6432Node\Microsoft\StrongName\Verification" /f
      reg ADD "HKLM\Software\Wow6432Node\Microsoft\StrongName\Verification\*,*" /f

  • @vlorahamitaga4452
    @vlorahamitaga4452 2 ปีที่แล้ว

    Hi Erik Thanks for this video I want to now how is possible to do field mapping with Field "Type" from Item to msdyn_fieldserviceproducttype field in CRM Product Table. They have different option values. And It doesn't work properly. I need Direction::ToIntegrationtable. Please write If you have any Idea how to do this.

    • @Hougaard
      @Hougaard  2 ปีที่แล้ว

      Then you might need to extend the table and perhaps the enum...

    • @vlorahamitaga4452
      @vlorahamitaga4452 2 ปีที่แล้ว

      @@Hougaard In BC field Type in Item is enum and has those values value(0; "Inventory") ,value(1; "Service") ,value(2; "Non-Inventory") ,whereas field msdyn_fieldserviceproducttype in" CRM Product" Table is option with those values OptionMembers = " ",Inventory,"Non-Inventory",Labour;OptionOrdinalValues = -1, 690970000, 690970001, 690970002;.
      I need to sync those field and send data from BC to CE. When I type Inventory in BC to send value Inventory in CE(Noninventory - Noninventory and Service-Labor) the option values are different between two fields.( fields don't have the exact matching labels and values)
      I did field mapping but it doesn't work properly.

  • @tabaicanking3701
    @tabaicanking3701 2 ปีที่แล้ว

    Hi do you have a course for new comers in AL programming. Paid course ofcoz

    • @Hougaard
      @Hougaard  2 ปีที่แล้ว

      No, but all the videos are free

    • @tabaicanking3701
      @tabaicanking3701 2 ปีที่แล้ว

      @@Hougaard can you make one and put it on Udemy, I will be the first to buy

  • @Ashish___Sharma
    @Ashish___Sharma 3 ปีที่แล้ว

    Hi Erik, Good Stuff, I have quick one, Please assist, Is it possible to Integrate One Instance of CRM (with Base Currency USD) with Multiple Instance of BC having different LCY Code (EUR, GBP, CAD) in General Ledger Setup using Dataverse. If yes, then please share how it is possible.

    • @Hougaard
      @Hougaard  3 ปีที่แล้ว

      Only if you temporarily change the local lcy code before connecting.

    • @Ashish___Sharma
      @Ashish___Sharma 3 ปีที่แล้ว

      @@Hougaard great, that's what I did... hopefully no issues or surprises after that...

    • @Hougaard
      @Hougaard  3 ปีที่แล้ว

      @@Ashish___Sharmacustomer statistics will be messed up (in CRM)

    • @Ashish___Sharma
      @Ashish___Sharma 3 ปีที่แล้ว

      Not if we use different accounts per BC instances & while synching apply filter for currency to synch in respective environment. Plese correct me if I am wrong.

  • @vectork5865
    @vectork5865 3 ปีที่แล้ว

    Hi Again Eric, Have you tried to insert a new row in your page? I did it and the system throws the error: An error occurred when communicating with Dataverse. Detailed description: Sql error: The operation attempted to insert a duplicate value for an attribute with a unique constraint. CRM ErrorCode: -2147012606 Sql ErrorCode: -2146232060 Sql Number: 2627
    Could you tell me what I'm doing wrong, please?
    Thanks in advance
    Cheers!

    • @Hougaard
      @Hougaard  3 ปีที่แล้ว

      I think you need to call the .Insert(true) on the table separately.

    • @vectork5865
      @vectork5865 3 ปีที่แล้ว

      you mean that Insert from the Page Directly is not allowed, don't you?

    • @Hougaard
      @Hougaard  3 ปีที่แล้ว

      ... kinda :)

    • @vectork5865
      @vectork5865 3 ปีที่แล้ว

      @@Hougaard Thanks a mill!! ♥

  • @nishantupadhyay3054
    @nishantupadhyay3054 ปีที่แล้ว

    Hi Erik ,
    I hope you are doing fine , i am getting below error while authenticating Dataverse Script in powershell.
    Can you please provide your valuable inputs ?
    Script -
    C:\Users
    isha\Documents\AL\CRMDemo> \Users
    isha.vscode\extensions\ms-dynamics-smb.al-11.0.827766\bin\altpgen.exe
    -Project:"C:\Users
    isha\Documents\AL\CRMDemo"
    -packagecachepath:"C:\Users
    isha\Documents\AL\CRMDemo.vscode.alcache"
    -Serviceuri:"*****8d3f33.crm.dynamics.com"
    -Entities:Contact,Account
    -BaseId:50502
    -TableType:CDS
    Error :-
    Authenticating Dataverse using ServiceUri=*****8d3f33.crm.dynamics.com
    Authenticated.
    Retrieving entity metadata.
    System.NullReferenceException: Object reference not set to an instance of an object.
    at Microsoft.Dynamics.Nav.TableProxyGenerator.BuildContext.c__DisplayClass25_0.b__3(SourceTableExtensionTypeSymbol ao) in D:\a_work\1\s\source\Prod\Microsoft
    .Dynamics.Nav.TableProxyGenerator\BuildContext.cs:line 107
    at System.Linq.Enumerable.WhereEnumerableIterator1.ToArray() at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
    at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable1 items) at Microsoft.Dynamics.Nav.CodeAnalysis.ImmutableArrayExtensions.ToImmutableArrayOrEmpty[T](IEnumerable1 items) in D:\a_work\1\s\source\Prod\Microsoft.Dynamics.Nav.Co
    deAnalysis\Collections\ImmutableArrayExtensions.cs:line 30
    at Microsoft.Dynamics.Nav.TableProxyGenerator.BuildContext..ctor(Compilation compilation, XrmMetadataService service, ImmutableArray1 entityNames, Nullable1 tableTyp
    e, String prefix, Int32 baseId, Boolean test) in D:\a_work\1\s\source\Prod\Microsoft.Dynamics.Nav.TableProxyGenerator\BuildContext.cs:line 105
    at Microsoft.Dynamics.Nav.TableProxyGenerator.TableProxyGeneratorTool.RunCore(CompilerTextWriter consoleOutput, ErrorLogger errorLogger, CancellationToken cancellation
    Token) in D:\a_work\1\s\source\Prod\Microsoft.Dynamics.Nav.TableProxyGenerator\TableProxyGeneratorTool.cs:line 47
    at Microsoft.Dynamics.Nav.CodeAnalysis.CompilationDependentTool.Run(CompilerTextWriter consoleOutput, ErrorLogger errorLogger, CancellationToken cancellationToken) in
    D:\a_work\1\s\source\Prod\Microsoft.Dynamics.Nav.TableProxyGenerator\CompilationDependentTool.cs:line 125
    at Microsoft.Dynamics.Nav.CodeAnalysis.CompilationDependentTool.Run(CompilerTextWriter consoleOutput, CancellationToken cancellationToken) in D:\a_work\1\s\source\Pro
    d\Microsoft.Dynamics.Nav.TableProxyGenerator\CompilationDependentTool.cs:line 77
    at Microsoft.Dynamics.Nav.TableProxyGenerator.TableProxyGeneratorCommandLineTool.Run(String clientDirectory, String baseDirectory, String[] args) in D:\a_work\1\s\sou
    rce\Prod\altpgen\TableProxyGeneratorCommandLineTool.cs:line 29
    Thanks in Advance!

    • @Hougaard
      @Hougaard  ปีที่แล้ว

      Sounds like you accessing the wrong environment?

    • @nishantupadhyay3054
      @nishantupadhyay3054 ปีที่แล้ว

      @@Hougaard - Hi Erik thanks for reaching out to me problem is solved , it was alphanumeric and bad syntax thanks again