Delegate A/S

Config

Sets up all the necessary variables and functions to be used for the other scripts.

1: 
2: 
3: 
4: 
5: 
6: 
#r @"bin\Microsoft.Xrm.Sdk.dll"
#r @"bin\Delegate.Daxif.dll"
open System
open Microsoft.Xrm.Sdk.Client
open DG.Daxif
open DG.Daxif.Common.Utility

CRM Environment Setup

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
21: 
22: 
23: 
24: 
25: 
26: 
27: 
28: 
29: 
30: 
31: 
32: 
33: 
34: 
35: 
// Prompts the developer for a username and password the first time a script is run.
// It then stores these credentials in a local .daxif-file.
let creds = Credentials.FromKey("UserCreds")

// If you want to store login credentials directly in code, instead of in a local file, 
// replace the above line with the following
//let creds = Credentials.Create("usr", "pwd")

module Env =
  let dev = 
    Environment.Create(
      name = "Development",
      url = "https://mydev.crm4.dynamics.com/XRMServices/2011/Organization.svc",
      ap = AuthenticationProviderType.OnlineFederation,
      creds = creds,
      args = fsi.CommandLineArgs
    )
  
  let test = 
    Environment.Create(
      name = "Test",
      url = "https://mytest.crm4.dynamics.com/XRMServices/2011/Organization.svc",
      ap = AuthenticationProviderType.OnlineFederation,
      creds = creds,
      args = fsi.CommandLineArgs
    )

  let prod = 
    Environment.Create(
      name = "Production",
      url = "https://myprod.crm4.dynamics.com/XRMServices/2011/Organization.svc",
      ap = AuthenticationProviderType.OnlineFederation,
      creds = creds,
      args = fsi.CommandLineArgs
    )

CRM Solution Setup

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
module SolutionInfo =
  let name = @"XrmSolution"
  let displayName = @"XrmSolution"

module PublisherInfo =
  let prefix = @"dg"
  let name = @"delegateas"
  let displayName = @"Delegate A/S"

Path and project setup

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
21: 
22: 
23: 
24: 
25: 
26: 
27: 
28: 
29: 
30: 
31: 
32: 
33: 
34: 
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__

module Path =
  let daxifRoot = __SOURCE_DIRECTORY__
  let solutionRoot = daxifRoot ++ @"..\.."
  let toolsFolder = daxifRoot ++ @".."
  
  let webResourceProject = solutionRoot ++ @"WebResources"
  let webResourceFolder = 
    webResourceProject ++ @"src" ++ (sprintf "%s_%s" PublisherInfo.prefix SolutionInfo.name)


  /// Path information used by the SolutionPackager scripts
  module SolutionPack =
    let projName = "SolutionBlueprint"
    let projFolder = solutionRoot ++ projName
    let xmlMappingFile = projFolder ++ (sprintf "%s.xml" SolutionInfo.name)
    let customizationsFolder = projFolder ++ @"customizations"
    let projFile = projFolder ++ (sprintf @"%s.csproj" projName)

  /// Paths Daxif uses to store/load files
  module Daxif =
    let crmSolutionsFolder = daxifRoot ++ "solutions"
    let unmanagedSolution = crmSolutionsFolder ++ (sprintf "%s.zip" SolutionInfo.name)
    let managedSolution = crmSolutionsFolder ++ (sprintf "%s_managed.zip" SolutionInfo.name)

    let translationsFolder = daxifRoot ++ "translations"
    let metadataFolder = daxifRoot ++ "metadata"
    let dataFolder = daxifRoot ++ "data"
    let stateFolder = daxifRoot ++ "state"
    let associationsFolder = daxifRoot ++ "associations"
    let mappingFolder = daxifRoot ++ "mapping"
    let importedFolder = daxifRoot ++ "imported"
  
namespace System
namespace Microsoft
namespace Microsoft.Xrm
namespace Microsoft.Xrm.Sdk
namespace Microsoft.Xrm.Sdk.Client
namespace DG
namespace DG.Daxif
namespace DG.Daxif.Common
module Utility

from DG.Daxif.Common
val creds : Credentials

Full name: _Config.creds
type Credentials =
  {key: string option;
   username: string option;
   password: string option;
   domain: string option;}
  member getValues : unit -> string * string * string
  static member Create : ?username:string * ?password:string * ?domain:string -> Credentials
  static member FromKey : key:string -> Credentials
  static member None : Credentials

Full name: DG.Daxif.Credentials
static member Credentials.FromKey : key:string -> Credentials
val dev : Environment

Full name: _Config.Env.dev
type Environment =
  {name: string;
   url: Uri;
   creds: Credentials option;
   ap: AuthenticationProviderType option;}
  override ToString : unit -> string
  member connect : ?logger:ConsoleLogger -> Connection
  member executeProcess : exeLocation:string * ?args:#seq<string * string> * ?urlParam:string * ?usrParam:string * ?pwdParam:string * ?apParam:string * ?dmnParam:string * ?paramToString:(string * string -> string) -> unit
  member getCreds : unit -> string * string * string
  member apToUse : AuthenticationProviderType
  static member Create : name:string * url:string * ?ap:AuthenticationProviderType * ?creds:Credentials * ?args:string [] -> Environment
  static member Get : name:string -> Environment

Full name: DG.Daxif.Environment
static member Environment.Create : name:string * url:string * ?ap:AuthenticationProviderType * ?creds:Credentials * ?args:string [] -> Environment
type AuthenticationProviderType =
  | None = 0
  | ActiveDirectory = 1
  | Federation = 2
  | LiveId = 3
  | OnlineFederation = 4

Full name: Microsoft.Xrm.Sdk.Client.AuthenticationProviderType
field AuthenticationProviderType.OnlineFederation = 4
val test : Environment

Full name: _Config.Env.test
val prod : Environment

Full name: _Config.Env.prod
val name : string

Full name: _Config.SolutionInfo.name
val displayName : string

Full name: _Config.SolutionInfo.displayName
val prefix : string

Full name: _Config.PublisherInfo.prefix
val name : string

Full name: _Config.PublisherInfo.name
val displayName : string

Full name: _Config.PublisherInfo.displayName
property Environment.CurrentDirectory: string
module Path

from _Config
val daxifRoot : string

Full name: _Config.Path.daxifRoot
val solutionRoot : string

Full name: _Config.Path.solutionRoot
val toolsFolder : string

Full name: _Config.Path.toolsFolder
val webResourceProject : string

Full name: _Config.Path.webResourceProject
val webResourceFolder : string

Full name: _Config.Path.webResourceFolder
val sprintf : format:Printf.StringFormat<'T> -> 'T

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.sprintf
module PublisherInfo

from _Config
module SolutionInfo

from _Config
val projName : string

Full name: _Config.Path.SolutionPack.projName
val projFolder : string

Full name: _Config.Path.SolutionPack.projFolder
val xmlMappingFile : string

Full name: _Config.Path.SolutionPack.xmlMappingFile
val customizationsFolder : string

Full name: _Config.Path.SolutionPack.customizationsFolder
val projFile : string

Full name: _Config.Path.SolutionPack.projFile
module Daxif

from _Config.Path


 Paths Daxif uses to store/load files
val crmSolutionsFolder : string

Full name: _Config.Path.Daxif.crmSolutionsFolder
val unmanagedSolution : string

Full name: _Config.Path.Daxif.unmanagedSolution
val managedSolution : string

Full name: _Config.Path.Daxif.managedSolution
val translationsFolder : string

Full name: _Config.Path.Daxif.translationsFolder
val metadataFolder : string

Full name: _Config.Path.Daxif.metadataFolder
val dataFolder : string

Full name: _Config.Path.Daxif.dataFolder
val stateFolder : string

Full name: _Config.Path.Daxif.stateFolder
val associationsFolder : string

Full name: _Config.Path.Daxif.associationsFolder
val mappingFolder : string

Full name: _Config.Path.Daxif.mappingFolder
val importedFolder : string

Full name: _Config.Path.Daxif.importedFolder