2

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.

Konrad Viltersten
  • 36,151
  • 76
  • 250
  • 438

1 Answers1

0

When in doubt, ask the user instead of trying to guess: you might unwillingly break something if your assumption is wrong.

Some more thoughts:

  • Online vs. On-Premise has limitations which might break functionalities. If you need things to work on both, focus on Online. In other words, if it works Online, it works On-Premise, but if it works On-Premise it might not work Online.
  • CRM 2011 provides many many innovations when compared to 4.0, code should really be branched so you stick to old-style in one project and leverage all the new features in another one. Solutions management alone is worth dropping 4.0 support altogether.
Alex
  • 23,004
  • 4
  • 39
  • 73
  • This particular solution, as you might have guessed by my modest formulation, is a very basic one. I only fetch marketing lists and the contacts belonging to them. I'm convinced that this particular functionality has been available in (almost) all the installations of CRM Dynamics. :) Does that affect your answer? (Very good pointers, by the way. I'll keep them in mind.) – Konrad Viltersten Sep 14 '12 at 13:37