Notifications
Announcements
No record found.
Hi All,
I am trying to connect to D365 using Script Task but I'm having this kind of error
This is the blog I followed. Any ideas?
*This post is locked for comments
We're not able to see the error you are receiving. Could you re-paste it or send an email directly to our support team - support@kingswaysoft.com - so we may take a closer look?
Thank you,
KingswaySoft
Please post the error or fix screenshot so we can see what the error is?
Hi,
Thanks for your reply.
This is my code:
var connMgr = (CrmConnection)this.Dts.Connections["Database"].AcquireConnection(null);
and this is my error:
Unable to cast COM object of type 'System.__ComObject' to class type 'KingswaySoft.IntegrationToolkit.DynamicsCrm.CrmConnection'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.
Can you please confirm your CRM connection manager's name is indeed "Database" (which doesn't really make sense)?
Hi Daniel,
Thanks for your correction. This is the actual error and code.
Code:
var connMgr = (CrmConnection)this.Dts.Connections["DynamicsCRM"].AcquireConnection(null);
Error:
Unable to cast object of type 'System.String' to type 'KingswaySoft.IntegrationToolkit.DynamicsCrm.CrmConnection'.
I would suggest you refer back to bullet point #12 in the blog post again. The way that you are doing is for a version prior to our v7 release, which I don't think is the version that you are using.
I followed this blog and you're correct, I'm using the wrong script. Thank you very much.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2