Class Trust
The class accepts a pre-defined set of Trust attributes, four of them are required: Name, Authority, CustomerId, Type, the ID will be generated automatically; The Description and SourceTrustID are optional.
- Name: The trust name.
- Description: The description of the trust.
- CustomerId: The ID of the customer this trust belongs to.
- Authority: The user's surname
- Type: The name of the trust type. Although in the actual trust object, it refers the trust type by ID, when the users gives the trust type, they give the trust type name, and the system will translate it into a system trust type ID.
- SourceTrustID: The system trust ID in the original source.
Defined in: trust.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Trust(properties)
Constructs an instance of the Trust class based on passed-in properties.
|
Method Attributes | Method Name and Description |
---|---|
elide()
Deletes an existing trust.
|
|
<static> |
Trust.find(params)
Finds the trust(s) with the same attributes as the passed-in filter.
|
Retrieves all the accounts that are currently associated with this trust.
|
|
Checks whether a trust object is current or not.
|
|
<static> |
Trust.isSupported()
Checks whether the Trust API is supported or not.
|
save()
The save methods saves the trust object synchronously.
|
Class Detail
Trust(properties)
Constructs an instance of the Trust class based on passed-in properties.
- Parameters:
- {Hash} properties
- Initial properties (JSON notation) to define trust
Method Detail
elide()
Deletes an existing trust. The actual trust object is never physically deleted from the database, it is
actually flagged as not-current in the system. After it's deleted, a trust can not be associated with
an account any more.
<static>
{Trust[]}
Trust.find(params)
Finds the trust(s) with the same attributes as the passed-in filter.
All attributes are matched as with an AND operator. You can pass in a string in JSON
notation or a prototype Trust object.
Example:
var myTrusts = Trust.find({Name: "Developer"});
- Parameters:
- {JSON} params
- notation of the trust attributes
- Throws:
- {String}
- Throws an string exception describing the error.
- Returns:
- {Trust[]} Returns an array of Trusts found. Only trusts that are currently active will be returned. The array could be of size 0 if no trusts match the search criteria.
{Account[]}
getAccounts()
Retrieves all the accounts that are currently associated with this trust. If no accounts are
attached, an empty array ([]) will be returned.
- Returns:
- {Account[]} Returns an array of accounts.
{Boolean}
isCurrent()
Checks whether a trust object is current or not.
- Returns:
- {Boolean} returns true when the trust is current.
<static>
{Boolean}
Trust.isSupported()
Checks whether the Trust API is supported or not.
- Returns:
- {Boolean}
{Boolan}
save()
The save methods saves the trust object synchronously.
Example:
var trust1 = new Trust({ Name:"Developer", Authority:"SAP", Description:"SAP Role", Type:"Role", CustomerId:"345" }); trust1.save();
- Throws:
- {String}
- Throws an string exception describing the error.
- Returns:
- {Boolan} Result