Finally, I've finished creating the Add-On that does exactly what I want in exactly the way I want. Only one issue remains. At the moment the software goes to organization and uses credential that are statically hard coded into the program.
I have a hunch that some of my customers might name their organization something else than "Hazaa Inc. #1-5", they could be called something else than "CRMK.local\Konrad" and there's a chance that they even choose a different password than me (although "abc123" is apparently fairly common).
So, here's the issue - how do I make my solution general?
I believe that as long as I get the right input to the code below, I'll be done.
using (OrganizationServiceProxy proxy
= new OrganizationServiceProxy(
organizationUri,
homeRealmUri,
credentials,
deviceCredentials))
The current log-in string I copied by hand from "Settings" in the CRM Dynamics but it won't suffice here. I need to obtain it dynamically and programmatically. Moreover, even if I learn the name of the organization, I need to determine if it's a CRM 4.0 or CRM 2011, if we're talking On-Line/Premiss what the user name and password are etc.
Is it a better solution to simply ask for that information to be provided by the user or would it be recommended to do that auto-magically (as far as the user experiences it)? This is my first time so most of stuff feels scary and confusing. I've seen some code examples but that led me back to scary & confused very quickly.
EDIT:
I've followed this code but I simply don't get it. E.g. ServerConnection
I don't even know where to find. I tried adding references to the different Xrm
and Crm
packages in the SDK but it's more of a trial-and-horror than actual development. It feels like I'm missing something (fairly) obvious.