Dynamics CRM - Upload Attachment
Declaration
<AMDYNAMICSCRM ACTIVITY="upload_attachment" SOURCE="text" MIMETYPE="text" ENTITY="text" ID="text" RESULTVARIABLE="text" PROTOCOL="text (options)" SERVER="text" USERNAME="text" PASSWORD="text(encrypted)" DOMAIN="text" ORGANIZATION="text" AUTODISCOVER="yes/no" DISCOVERYURI="text" ORGANIZATIONURI="text" HOMEREALMURI="text" AUTHTYPE="text (options)" TIMOUT="number" PROXYTYPE="text (options)" PROXYSERVER="text" PROXYPORT="number" PROXYUSERNAME="text" PROXYPASSWORD="text (encrypted)" />
Description
Uploads an attachment to an annotation entity instance and populates an existing variable with the annotation ID.
Practical Usage
Commonly used for attaching notes to records. A note can be attached to multiple objects, including other notes.
Connection Parameters
Property |
Type |
Required |
Default |
Markup |
Description |
---|---|---|---|---|---|
Connection |
|
|
|
|
Indicates where Dynamics CRM user credentials, connection properties and other preferences should originate from. This is a design mode parameter used only during task construction and configuration, thus, comprises no markup. The available options are:
|
Session |
Text |
Yes if connection is session-based |
DynamicsCrmSession1 |
SESSION="DynamicsCrmSession1" |
The name of an existing session to attach this activity to. This parameter is active only if the Connection parameter is set to Session. The default session name is 'DynamicsCrmSession1'. |
Server (protocol) |
Text (options) |
Yes |
HTTPS |
|
Specifies the protocol used to connect to the Dynamics CRM server. The URL can be HTTP or HTTPS and the port is optional if it is HTTP over port 80 or HTTPS over port 443. The available options are:
|
Server |
Text |
Yes |
(Empty) |
|
The
URL or IP address of the Dynamics CRM server to establish a connection
with. If entering a URL, the port is optional if it is http over
port 80 or https over port 443. (e.g., crm-server:port). The
server URL is typically in the format http://crm-server:port/organization-name Or for Microsoft Dynamics CRM Online: https://organization-name.crm.dynamics.com |
Username or Windows Live ID |
Text |
Yes |
(Empty) |
|
The usename of the service account that is used to connect using AD, SPLA, or Passport authentication types. The format for this is specific to the authentication type: domain\username for AD and SPLA authentication types and a Windows Live ID for Passport authentication. |
Password |
Text |
Yes |
(Empty) |
PASSWORD="encrypted" |
The password of the service account that is used to connect using AD, SPLA, or Passport authentication. |
Domain name (optional) |
Text |
No |
(Empty) |
DOMAIN="netauto.com" |
The name of the domain that will verify user credentials (optional). |
Organization name |
Text |
Yes |
(Empty) |
ORGANIZATION="Network Automation" |
The name of the organization associated with the account. To query organization names and Dynamics CRM server URIs that exist on the system, click the font-size: 8pt; font-weight: bold;">Discover button. |
Microsoft Office 365 |
Yes/No |
No |
No |
OFFICE365="YES" |
If set to YES, connection will be established via Office365 account. Set this option to YES if using Microsoft Dynamics CRM Online through Microsoft Outlook. Set to NO by default. |
Auto discover |
Yes/No |
No |
No |
AUTODISCOVER="YES" |
Auto-discovery helps you detect where the Dynamics CRM components are installed, whether locally or remotely. If set to YES, will use CrmDiscoveryService to obtain a name and URL endpoint for a target organization (set to NO by default). The CrmDiscoveryService Web service is accessed through a global URL of an on-premise Microsoft Dynamics CRM server. Each Microsoft Dynamics CRM server hosts the CrmDiscoveryService Web service, which is located here: http://<server:port>/MSCRMServices/2007/AD/CrmDiscoveryService.asm. NOTE: Setting this parameter to YES inactivates various settings. |
Discovery URI |
Text |
No |
(Empty) |
DISCOVERYURI=" |
The Discovery URL used by your site if you are connecting to a Microsoft Dynamics CRM Online organization. To connect to Microsoft Dynamics CRM Online, the discovery service is first hit to retrieve a passport authentication ticket. This ticket indicates that a Live ID user is, in fact, authenticated to use the Microsoft Dynamics CRM Online instance. |
Organization URI |
Text |
No |
(Empty) |
ORGANIZATIONURI=" |
The URL of the organization service. If the Auto discover parameter is set to YES, this parameter becomes inactive. |
Home realm URI |
Text |
No |
(Empty) |
HOMEREALMURI=" |
The URL of the home realm. This is the address of the identity provider. If the Auto discover parameter is set to YES, this parameter becomes inactive. |
Authentication type |
Text (options) |
No |
LiveID |
|
The type of authentication used to connect to the Dynamics CRM server. If the Auto discover parameter is set to YES, this parameter becomes inactive. The available options are:
|
Timeout (seconds) |
Number |
No |
120 |
TIMEOUT="120" |
The total amount of time (in seconds) to allow for a synchronous connection request to the CRM server to complete. If this value is surpassed, a timeout error will occur. The default value is 120 seconds (3 minutes). |
Proxy type |
Text (options) |
No |
System default |
|
The type of proxy in which to connect to. The available options are:
|
Use authentication |
|
|
|
|
If enabled, specifies that the proxy requires authentication before granting access to resources. If disabled (default), specifies that no authentication is required. This is a visual mode parameter only used during design time, therefore, it contains no properties or markup. This parameter is active only if the Proxy Type parameter is set to HTTP. |
Proxy server |
Text |
Yes if proxy type is HTTP |
(Empty) |
PROXYSERVER="proxy.server.com" |
The hostname or IP address of the proxy server to connect to. This parameter is active only if the Proxy type parameter is set to HTTP. |
Proxy port |
Number |
No |
808 |
PROXYPORT="1028" |
The port that should be used to connect to the proxy server. The default value is 808. This parameter is active only if the Proxy type parameter is set to HTTP. |
Proxy username |
Text |
No |
(Empty) |
PROXYUSER="username" |
The username used to authenticate connection with the proxy server (if required). This parameter is active only if the Proxy type parameter is set to HTTP. |
Proxy password |
Text |
No |
(Empty) |
PROXYPWD="encrypted" |
The password used to authenticate connection with the proxy server (if required). This parameter is active only if the Proxy type parameter is set to HTTP. |
Attachment Parameters
Property |
Type |
Required |
Default |
Markup |
Description |
---|---|---|---|---|---|
Attachment file |
Text |
Yes |
(Empty) |
SOURCE="C:\temp\DTDCheck.xml" |
The path and filename of the attachment to upload. |
Mime type (optional) |
Text |
No |
(Empty) |
MIMETYPE="text" |
The MIME type of the attachment to upload. |
Entity logical name (e.g., account) |
Text |
Yes |
(Empty) |
ENTITY="account" |
The logical name of the entity in which to upload the attachment to. |
Entity ID |
Text |
Yes |
(Empty) |
ID="accountid" |
The ID of the entity in which to upload the attachment to. |
Populate variable with attachment ID |
Text |
Yes |
(Empty) |
COLUMNS="name,ownerid" |
The name of an existing variable to populate with the attachment ID. |
Description tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.
Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)
On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)
Examples
The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.
Description: A sample task that uses the 'Upload attachment' activity to upload a .xml file to the specified entity.
<AMVARIABLE NAME="theVar" /> <AMDYNAMICSCRM ACTIVITY="create_session" PROTOCOL="http" SERVER="209.223.157.106" USERNAME="administrator" PASSWORD="AM2gvUWJwwypS+Z9QcnFzL2L9z1QydMMsQpaME" DOMAIN="netautoinc" ORGANIZATION="netautodyn" AUTODISCOVER="no" DISCOVERYURI="http://209.223.157.106/XRMServices/2011/Discovery.svc" ORGANIZATIONURI="http://dynamicscrm2011/netautodyn/XRMServices/2011/Organization.svc" AUTHTYPE="ActiveDirectory" SESSION="DynamicsCrmSession1" /> <AMDYNAMICSCRM ACTIVITY="upload_attachment" SESSION="DynamicsCrmSession1" SOURCE="C:\Users\Administrator\Desktop\DTDCheck.xml" MIMETYPE="text" ENTITY="account" ID="test.accountid" RESULTVARIABLE="theVar" /> <AMDYNAMICSCRM ACTIVITY="end_session" SESSION="DynamicsCrmSession1" />