Salesforce

DNSet (Magic xpa 4.x)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

DNSet (Magic xpa 4.x)

Sets the value of a property in a .NET Assembly object. This function is used to update a data member, property or array cell.

Syntax:

DNSet (property, value)

Parameters:

property: The .NET field, data member, property or array cell to set its value.

value: The required value of the property. You can also use a native Magic xpa function in the value parameter.

The value parameter must be of the same attribute as the property parameter.

Returns:

The value set.

Examples:

DNSet(A,DotNet.System.Drawing.Font('Arial', 10))

Suppose A is a .NET variable of type System.Drawing.Font, this will set its value to Arial with size 10. This is equivalent to updating A with DotNet.System.Drawing.Font('Arial', 10)

DNSet(A.Font, DotNet.System.Drawing.Font('Arial', 10))

Suppose A is a .NET variable that has a property of Font, this will set its value to Arial with size 10.

DNSet(A.myIntProp, 7)

Suppose A is a field of some .NET type that has an integer property named myIntProp. This will set the value of myIntProp to 7.

DNSet(A[3], 'hello')

Suppose A is of type System.String[]. This will set the fourth cell of A with the value 'hello'.

DNSet(DotNet.Calculator.CalculatorsCount,0)

Suppose CalculatorsCount is a static data member of the class DotNet.Calculator. This will set its value to 0.

Note:

There are two ways to set the value of a .NET field either by using the Update operation or the DNSet() function. The only way to set the value of a data member, property, or array cell is by using the DNSet() function.

Platform specific:

This function is not supported for mobile devices.

Exceptions:

This function is not supported in Web Client tasks.

See also:

How Do I Change the Properties of a .NET Object?

Dot Net Tutorial sample project

Reference
Attachment 
Attachment