GoXrm

package module
v0.0.0-...-a70783c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2020 License: GPL-3.0 Imports: 9 Imported by: 2

README

GoXrm

This library has been written to reproduce Microsoft.Xrm.Sdk functions. The initial idea is to provide the same "objects" and "methods" as there is in Microsoft SDK. So that .net developpers do not arrive in a totally new world. It connects to Dynamics 365 online using the Web API, and gets identity against Azure AD. It shouldn't work with onpremise deployments.

Getting started First of all, you need to create a CrmServiceClient. You need to know the "Tenant Id" of your organization and the Application Id that you got when registering the application. Import "github.com/PierreVicente/GoXrm/Client" then use one of the NewCrmServiceClient functions The possible parameters are

  • Login Url: "https://login.microsoftonline.com" or "https://login.windows.net" work
  • Tenant Id: the id of your azure AD organization (it's a guid)
  • Client Id: the id of your registered application (it's a guid too)
  • Resource Url: the url of your Dynamics organization: https://XXXXX.crmX.dynamics.com
  • User id: use it if you want to connect as an organization user: xxxuserxxx@yyyorgyyy.onmicrosoft.com
  • Password: no need to explain
  • Secret: Means that your are connecting with an application user: this is the secret string provided by Azure AD registration

Documentation

Index

Constants

View Source
const (
	EntityRole_Referenced  = 1
	EntityRole_Referencing = 2
)

Variables

This section is empty.

Functions

func EntityToJObject

func EntityToJObject(target Entity, action string, isActivityEntity bool) string

func GetPrimaryIdAttribute

func GetPrimaryIdAttribute(entity string) string

func IsActivityEntity

func IsActivityEntity(entity string) bool

func IsNull

func IsNull(eref *EntityReference) bool

Types

type Entity

type Entity struct {
	RowVersion      int64
	Id              string
	LogicalName     string
	Attributes      map[string]interface{}
	FormattedValues map[string]string
	RelatedEntities map[RelationShip]EntityCollection
	// contains filtered or unexported fields
}

func JObjectToEntity

func JObjectToEntity(o []byte, entityName string) Entity

func NewEntity

func NewEntity(logicalName string, id string) Entity

func (*Entity) Contains

func (e *Entity) Contains(attributeName string) (interface{}, bool)

func (*Entity) GetAttributeValue

func (e *Entity) GetAttributeValue(attributeName string) (interface{}, bool)

func (*Entity) GetBool

func (e *Entity) GetBool(attribute string) bool

func (*Entity) GetDateTime

func (e *Entity) GetDateTime(attribute string) time.Time

func (*Entity) GetDec

func (e *Entity) GetDec(attribute string) float64

func (*Entity) GetEntityReference

func (e *Entity) GetEntityReference(attribute string) EntityReference

func (*Entity) GetEntityReferenceId

func (e *Entity) GetEntityReferenceId(attribute string) string

func (*Entity) GetEntityReferenceName

func (e *Entity) GetEntityReferenceName(attribute string) string

func (*Entity) GetFormattedValue

func (e *Entity) GetFormattedValue(attribute string) string

func (*Entity) GetGuid

func (e *Entity) GetGuid(attribute string) uuid.UUID

func (*Entity) GetInt

func (e *Entity) GetInt(attribute string) int64

func (*Entity) GetMoney

func (e *Entity) GetMoney(attribute string) Money

func (*Entity) GetOptionSetInt

func (e *Entity) GetOptionSetInt(attribute string) int64

func (*Entity) GetOptionSetName

func (e *Entity) GetOptionSetName(attribute string) string

func (*Entity) GetOptionSetValue

func (e *Entity) GetOptionSetValue(attribute string) OptionSetValue

func (*Entity) GetString

func (e *Entity) GetString(attribute string) string

func (*Entity) IsEntityReference

func (eptr *Entity) IsEntityReference(attribute string) (bool, string)

func (*Entity) PrimaryIdAttribute

func (e *Entity) PrimaryIdAttribute() string

func (*Entity) RemoveAttribute

func (e *Entity) RemoveAttribute(attribute string)

func (*Entity) SetBool

func (e *Entity) SetBool(attribute string, value bool)

func (*Entity) SetDateTime

func (e *Entity) SetDateTime(attribute string, value time.Time)

func (*Entity) SetDec

func (e *Entity) SetDec(attribute string, value float64)

func (*Entity) SetEntityReference

func (e *Entity) SetEntityReference(attribute string, reference EntityReference)

func (*Entity) SetGuid

func (e *Entity) SetGuid(attribute string, value uuid.UUID)

func (*Entity) SetInt

func (e *Entity) SetInt(attribute string, value int64)

func (*Entity) SetMoney

func (e *Entity) SetMoney(attribute string, value float64)

func (*Entity) SetOptionSetValue

func (e *Entity) SetOptionSetValue(attribute string, option OptionSetValue)

func (*Entity) SetString

func (e *Entity) SetString(attribute string, value string)

func (*Entity) ToEntityReference

func (e *Entity) ToEntityReference() EntityReference

type EntityCollection

type EntityCollection struct {
	EntityName                    string
	Entities                      []Entity
	MoreRecords                   bool
	PagingCookie                  string
	NextPage                      int64
	TotalRecordCount              int64
	TotalRecordCountLimitExceeded bool
}

func NewEntityCollection0

func NewEntityCollection0() EntityCollection

func NewEntityCollection2

func NewEntityCollection2(entityName string) EntityCollection

func (*EntityCollection) FillEntities

func (ec *EntityCollection) FillEntities(arr []byte)

type EntityReference

type EntityReference struct {
	Id          string
	LogicalName string
	Name        string
}

func NewEntityReference

func NewEntityReference(logicalName string, id string) EntityReference

type Money

type Money struct {
	Value float64
}

func NewMoney

func NewMoney(value float64) Money

type OptionSetValue

type OptionSetValue struct {
	Value       int64
	Description string
}

func NewOptionSetValue

func NewOptionSetValue(value int64) OptionSetValue

type OrganizationRequest

type OrganizationRequest struct {
	RequestName string
	Parameters  map[string]interface{}
}

func (*OrganizationRequest) GetRelativeUrlString

func (this *OrganizationRequest) GetRelativeUrlString() string

type OrganizationResponse

type OrganizationResponse struct {
	ResponseName  string
	RequestResult string
	Jprops        map[string]string
}

func NewOrganizationResponse

func NewOrganizationResponse() OrganizationResponse

type RelationShip

type RelationShip struct {
	EntityRole int32
	SchemaName string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL