Class NSBLOBAgent
Collection of all services that work with binary objects (BLOBS). For example, images and documents.
Syntax
Examples
NSBLOBAgent agent;
agent.callMethod(arg1, arg2);
Constructors
NSBLOBAgent()
Initializes a new instance of the NSBLOBAgent class.
Introduced or updated in version: 7
Declaration
NSBLOBAgent
Examples
NSBLOBAgent agent;
agent.callMethod(arg1, arg2);
Methods
ChangeContactImage(Integer,Integer)
Changes the contact image link.
Introduced or updated in version: 7
Declaration
Void ChangeContactImage(Integer contactId, Integer blobId)
Parameters
Type | Name | Description |
---|---|---|
Integer | contactId | The contact the image is linked to |
Integer | blobId | The Binary object ID. |
Returns
Type | Description |
---|---|
Void |
Remarks
If the Binary object ID is 0, any image link is removed from the contact.
ChangePersonImage(Integer,Integer)
Introduced or updated in version: 7
Declaration
Void ChangePersonImage(Integer personId, Integer blobId)
Parameters
Type | Name | Description |
---|---|---|
Integer | personId | The person the image is linked to |
Integer | blobId | The Binary object ID. |
Returns
Type | Description |
---|---|
Void |
Remarks
If the Binary object ID is 0, any image link is removed from the person.
ChangeProductImage(Integer,Integer)
Changes the project image link.
Introduced or updated in version: 7.5
Declaration
Void ChangeProductImage(Integer productId, Integer blobId)
Parameters
Type | Name | Description |
---|---|---|
Integer | productId | The project the image is linked to |
Integer | blobId | The Binary object Id. |
Returns
Type | Description |
---|---|
Void |
Remarks
If the Binary object ID is 0, any image link is removed from the project.
ChangeProjectImage(Integer,Integer)
Changes the project image link.
Introduced or updated in version: 7
Declaration
Void ChangeProjectImage(Integer projectId, Integer blobId)
Parameters
Type | Name | Description |
---|---|---|
Integer | projectId | |
Integer | blobId | The Binary object Id. |
Returns
Type | Description |
---|---|
Void |
Remarks
If the Binary object ID is 0, any image link is removed from the project.
CleanupBatchTask(Integer)
Removes the binary objects linked to the batch task, the links themselves and the batch task.
Introduced or updated in version: 7
Declaration
Void CleanupBatchTask(Integer batchTaskId)
Parameters
Type | Name | Description |
---|---|---|
Integer | batchTaskId |
Returns
Type | Description |
---|---|
Void |
CreateDefaultBlobEntity()
Sets default values into a new NSBlobEntity.
Introduced or updated in version: 7
Declaration
NSBlobEntity CreateDefaultBlobEntity()
Returns
Type | Description |
---|---|
NSBlobEntity | New BlobEntity with default values. |
Remarks
NetServer calculates default values (for example Country) on the entity, which is required when creating/storing a new instance.
Examples
NSBLOBAgent agent;
NSBlobEntity thing = agent.CreateDefaultBlobEntity();
thing = agent.SaveBlobEntity(thing);
DeleteBlobEntity(Integer)
Deletes the NSBlobEntity
Introduced or updated in version: 7
Declaration
Void DeleteBlobEntity(Integer blobEntity)
Parameters
Type | Name | Description |
---|---|---|
Integer | blobEntity | The identity of the BlobEntity. |
Returns
Type | Description |
---|---|
Void |
Examples
NSBLOBAgent agent;
agent.DeleteBlobEntity(123);
GetAppData(String)
Gets a CLOB (limited to a reasonable size by the mechanics of Web Services) according to a string key; ALSO limits to the current ApplicationToken if any
Introduced or updated in version: 8.0sr3
Declaration
String GetAppData(String key)
Parameters
Type | Name | Description |
---|---|---|
String | key | The key string, less than 200 characters. Must be unique within each application. |
Returns
Type | Description |
---|---|
String | The applications value, suggested to be a JSON, XML or other readable structure. |
Examples
NSBLOBAgent agent;
String key;
String res = agent.GetAppData(key);
GetBlobEntity(Integer)
Gets an NSBlobEntity object.
Introduced or updated in version: 7
Declaration
NSBlobEntity GetBlobEntity(Integer blobEntityId)
Parameters
Type | Name | Description |
---|---|---|
Integer | blobEntityId | The identifier of the BlobEntity object. |
Returns
Type | Description |
---|---|
NSBlobEntity | BlobEntity object. |
Examples
NSBLOBAgent agent;
NSBlobEntity thing = agent.GetBlobEntity(123);
GetBlobEntityOnContact(Integer)
Gets the blob entity that represents the contact image binary object.
Introduced or updated in version: 7
Declaration
NSBlobEntity GetBlobEntityOnContact(Integer contactId)
Parameters
Type | Name | Description |
---|---|---|
Integer | contactId | The contact Id. |
Returns
Type | Description |
---|---|
NSBlobEntity | BlobEntity object. |
Examples
NSBLOBAgent agent;
Integer contactId;
NSBlobEntity res = agent.GetBlobEntityOnContact(contactId);
GetBlobEntityOnCountry(Integer)
Gets the blob entity that represents the country flag binary object.
Introduced or updated in version: 7
Declaration
NSBlobEntity GetBlobEntityOnCountry(Integer countryId)
Parameters
Type | Name | Description |
---|---|---|
Integer | countryId | The country Id. |
Returns
Type | Description |
---|---|
NSBlobEntity | BlobEntity object. |
Examples
NSBLOBAgent agent;
Integer countryId;
NSBlobEntity res = agent.GetBlobEntityOnCountry(countryId);
GetBlobEntityOnPerson(Integer)
Gets the blob entity that represents the person image binary object.
Introduced or updated in version: 7
Declaration
NSBlobEntity GetBlobEntityOnPerson(Integer personId)
Parameters
Type | Name | Description |
---|---|---|
Integer | personId | The person Id. |
Returns
Type | Description |
---|---|
NSBlobEntity | BlobEntity object. |
Examples
NSBLOBAgent agent;
Integer personId;
NSBlobEntity res = agent.GetBlobEntityOnPerson(personId);
GetBlobEntityOnProduct(Integer)
Gets the blob entity that represents the product image binary object.
Introduced or updated in version: 7.5
Declaration
NSBlobEntity GetBlobEntityOnProduct(Integer productId)
Parameters
Type | Name | Description |
---|---|---|
Integer | productId | The product Id. |
Returns
Type | Description |
---|---|
NSBlobEntity | BlobEntity object. |
Examples
NSBLOBAgent agent;
Integer productId;
NSBlobEntity res = agent.GetBlobEntityOnProduct(productId);
GetBlobEntityOnProject(Integer)
Gets the blob entity that represents the project image binary object.
Introduced or updated in version: 7
Declaration
NSBlobEntity GetBlobEntityOnProject(Integer projectId)
Parameters
Type | Name | Description |
---|---|---|
Integer | projectId | The project Id. |
Returns
Type | Description |
---|---|
NSBlobEntity | BlobEntity object. |
Examples
NSBLOBAgent agent;
Integer projectId;
NSBlobEntity res = agent.GetBlobEntityOnProject(projectId);
GetBlobStream(Integer)
Gets the binary object as a stream
Introduced or updated in version: 7
Declaration
NSStream GetBlobStream(Integer blobEntityId)
Parameters
Type | Name | Description |
---|---|---|
Integer | blobEntityId | The ID of the BLOB entity object that refers to the binary data. |
Returns
Type | Description |
---|---|
NSStream | The binary object as a Stream. |
Examples
NSBLOBAgent agent;
Integer blobEntityId;
NSStream res = agent.GetBlobStream(blobEntityId);
GetChatImageWithSize(Integer,Integer,Integer)
Returns the chat image that is displayed in chat with a specified maximum size.
Introduced or updated in version: 8.2
Declaration
NSImage GetChatImageWithSize(Integer chatTopicId, Integer width, Integer height)
Parameters
Type | Name | Description |
---|---|---|
Integer | chatTopicId | The project ID of the project the image belongs to |
Integer | width | The maximum with of the returned image. Specify <= 0 to preserve aspect ratio of existing image |
Integer | height | The maximum height of the returned image. Specify <= 0 to preserve aspect ratio of existing image. |
Returns
Type | Description |
---|---|
NSImage | The image as a System.Drawing.Image. (If the the image is returned over web services, the stream is returned as a jpeg/base64 encoded string.). |
Examples
NSBLOBAgent agent;
Integer chatTopicId;
Integer width;
Integer height;
NSImage res = agent.GetChatImageWithSize(chatTopicId, width, height);
GetContactImage(Integer)
Returns the contact image that is displayed in the CRM application.
Introduced or updated in version: 7
Declaration
NSImage GetContactImage(Integer contactId)
Parameters
Type | Name | Description |
---|---|---|
Integer | contactId | The contact ID of the person the image belongs to. |
Returns
Type | Description |
---|---|
NSImage | The image as a System.Drawing.Image. (If the the image is returned over web services, the stream is returned as a Base64 encoded string.). |
Examples
NSBLOBAgent agent;
Integer contactId;
NSImage res = agent.GetContactImage(contactId);
GetContactImageWithSize(Integer,Integer,Integer)
Returns the contact image that is displayed in the CRM application with a specified maximum size.
Introduced or updated in version: 7
Declaration
NSImage GetContactImageWithSize(Integer contactId, Integer width, Integer height)
Parameters
Type | Name | Description |
---|---|---|
Integer | contactId | The contact of the person the image belongs to. |
Integer | width | The maximum with of the returned image. Specify <= 0 to preserve aspect ratio of existing image. |
Integer | height | The maximum height of the returned image. Specify <= 0 to preserve aspect ratio of existing image. |
Returns
Type | Description |
---|---|
NSImage | The image as a System.Drawing.Image. (If the the image is returned over web services, the stream is returned as a Base64 encoded string.). |
Examples
NSBLOBAgent agent;
Integer contactId;
Integer width;
Integer height;
NSImage res = agent.GetContactImageWithSize(contactId, width, height);
GetOutputFromBatch(Integer)
Gets the output of a batchtask as a stream
Introduced or updated in version: 7
Declaration
NSStream GetOutputFromBatch(Integer batchTaskId)
Parameters
Type | Name | Description |
---|---|---|
Integer | batchTaskId |
Returns
Type | Description |
---|---|
NSStream |
Examples
NSBLOBAgent agent;
Integer batchTaskId;
NSStream res = agent.GetOutputFromBatch(batchTaskId);
GetPersonImage(Integer)
Returns the person image that is displayed in the CRM application.
Introduced or updated in version: 7
Declaration
NSImage GetPersonImage(Integer personId)
Parameters
Type | Name | Description |
---|---|---|
Integer | personId | The person ID of the person the image belongs to. |
Returns
Type | Description |
---|---|
NSImage | The image as a System.Drawing.Image. (If the the image is returned over web services, the stream is returned as a Base64 encoded string.). |
Examples
NSBLOBAgent agent;
Integer personId;
NSImage res = agent.GetPersonImage(personId);
GetPersonImageWithSize(Integer,Integer,Integer)
Returns the person image that is displayed in the CRM application with a specified maximum size.
Introduced or updated in version: 8.0sr3
Declaration
NSImage GetPersonImageWithSize(Integer personId, Integer width, Integer height)
Parameters
Type | Name | Description |
---|---|---|
Integer | personId | The person ID of the person the image belongs to. |
Integer | width | The maximum with of the returned image. Specify <= 0 to preserve aspect ratio of existing image |
Integer | height | The maximum height of the returned image. Specify <= 0 to preserve aspect ratio of existing image |
Returns
Type | Description |
---|---|
NSImage | The image as a System.Drawing.Image. (If the the image is returned over web services, the stream is returned as a Base64 encoded string.). |
Examples
NSBLOBAgent agent;
Integer personId;
Integer width;
Integer height;
NSImage res = agent.GetPersonImageWithSize(personId, width, height);
GetProductImage(Integer)
Returns the product image (rank=1) that is displayed in the CRM application.
Introduced or updated in version: 7.5
Declaration
NSImage GetProductImage(Integer productId)
Parameters
Type | Name | Description |
---|---|---|
Integer | productId | The product ID of the product the image belongs to. |
Returns
Type | Description |
---|---|
NSImage | The image as a System.Drawing.Image. (If the the image is returned over web services, the stream is returned as a Base64 encoded string.). |
Examples
NSBLOBAgent agent;
Integer productId;
NSImage res = agent.GetProductImage(productId);
GetProductThumbnail(Integer)
Returns the product thumbnail that is displayed in the CRM application.
Introduced or updated in version: 7.5
Declaration
NSImage GetProductThumbnail(Integer productId)
Parameters
Type | Name | Description |
---|---|---|
Integer | productId | The product ID of the product the thumbnail belongs to. |
Returns
Type | Description |
---|---|
NSImage | The image as a System.Drawing.Image. (If the the image is returned over web services, the stream is returned as a Base64 encoded string.). |
Examples
NSBLOBAgent agent;
Integer productId;
NSImage res = agent.GetProductThumbnail(productId);
GetProjectImage(Integer)
Returns the project image that is displayed in the CRM application.
Introduced or updated in version: 7
Declaration
NSImage GetProjectImage(Integer projectId)
Parameters
Type | Name | Description |
---|---|---|
Integer | projectId | The project ID of the project the image belongs to. |
Returns
Type | Description |
---|---|
NSImage | The image as a System.Drawing.Image. (If the the image is returned over web services, the stream is returned as a Base64 encoded string.). |
Examples
NSBLOBAgent agent;
Integer projectId;
NSImage res = agent.GetProjectImage(projectId);
GetProjectImageWithSize(Integer,Integer,Integer)
Returns the project image that is displayed in the CRM application with a specified maximum size.
Introduced or updated in version: 8.0sr3
Declaration
NSImage GetProjectImageWithSize(Integer projectId, Integer width, Integer height)
Parameters
Type | Name | Description |
---|---|---|
Integer | projectId | The project ID of the project the image belongs to. |
Integer | width | The maximum with of the returned image. Specify <= 0 to preserve aspect ratio of existing image |
Integer | height | The maximum height of the returned image. Specify <= 0 to preserve aspect ratio of existing image. |
Returns
Type | Description |
---|---|
NSImage | The image as a System.Drawing.Image. (If the the image is returned over web services, the stream is returned as a Base64 encoded string.). |
Examples
NSBLOBAgent agent;
Integer projectId;
Integer width;
Integer height;
NSImage res = agent.GetProjectImageWithSize(projectId, width, height);
GetQuoteLineImage(Integer)
Returns the quoteline image (rank=1) that is displayed in the CRM application.
Introduced or updated in version: 7.5
Declaration
NSImage GetQuoteLineImage(Integer quoteLineId)
Parameters
Type | Name | Description |
---|---|---|
Integer | quoteLineId | The product ID of the quoteline the image belongs to. |
Returns
Type | Description |
---|---|
NSImage | The image as a System.Drawing.Image. (If the the image is returned over web services, the stream is returned as a Base64 encoded string.). |
Examples
NSBLOBAgent agent;
Integer quoteLineId;
NSImage res = agent.GetQuoteLineImage(quoteLineId);
SaveBlobEntity(NSBlobEntity)
Updates the existing NSBlobEntity or creates a new NSBlobEntity if the ID parameter is 0.
Introduced or updated in version: 7
Declaration
NSBlobEntity SaveBlobEntity(NSBlobEntity blobEntity)
Parameters
Type | Name | Description |
---|---|---|
NSBlobEntity | blobEntity | The entity to save. |
Returns
Type | Description |
---|---|
NSBlobEntity | New or updated BlobEntity. |
Examples
NSBLOB agent;
NSBlobEntity thing = agent.CreateDefaultBlobEntity();
thing = agent.SaveBlobEntity(thing);
SaveImageStream(Integer,NSImage,String)
Stores an image in the database without linking it to a project or a person.
Introduced or updated in version: 7
Declaration
Integer SaveImageStream(Integer type, NSImage image, String description)
Parameters
Type | Name | Description |
---|---|---|
Integer | type | The type of the image. |
NSImage | image | Image to store |
String | description | Image description. |
Returns
Type | Description |
---|---|
Integer | The blob Id. |
Remarks
It is possible to ChangePersonImage or ChangeProjectImage to attach image later.
Examples
NSBLOBAgent agent;
Integer type;
NSImage image;
String description;
Integer res = agent.SaveImageStream(type, image, description);
SaveProjectImage(String,NSImage)
Saves a project image that is displayed in the CRM application's project image selection dialog to the database.
Introduced or updated in version: 7
Declaration
Void SaveProjectImage(String description, NSImage image)
Parameters
Type | Name | Description |
---|---|---|
String | description | |
NSImage | image | The project image (System.Drawing.Image). |
Returns
Type | Description |
---|---|
Void |
SetAppData(String,String)
Sets a CLOB (limited to a reasonable size by the mechanics of Web Services) according to a string key; ALSO limits to the current ApplicationToken if any.
Introduced or updated in version: 8.0sr3
Declaration
Void SetAppData(String key, String data)
Parameters
Type | Name | Description |
---|---|---|
String | key | The key string, less than 200 characters. Must be unique within each application. |
String | data | The applications value, suggested to be a JSON, XML or other readable structure. |
Returns
Type | Description |
---|---|
Void |
Remarks
Existing data, if any, will be overwritten. Overwrite with a blank value to delete.
Examples
NSBLOBAgent agent;
String key;
String data;
agent.SetAppData(key, data);
SetBlobStream(Integer,NSStream)
Stores a binary object from its stream
Introduced or updated in version: 7
Declaration
Void SetBlobStream(Integer blobEntityId, NSStream stream)
Parameters
Type | Name | Description |
---|---|---|
Integer | blobEntityId | ID of the BLOB entity object that the binary data should be stored to. |
NSStream | stream | The binary object as a Stream. |
Returns
Type | Description |
---|---|
Void |
SetContactImage(Integer,NSImage)
Stores the contact image that is displayed in the CRM application.
Introduced or updated in version: 7
Declaration
Void SetContactImage(Integer contactId, NSImage image)
Parameters
Type | Name | Description |
---|---|---|
Integer | contactId | The ID of the contact the image belongs to. |
NSImage | image | The project image (System.Drawing.Image). |
Returns
Type | Description |
---|---|
Void |
SetPersonImage(Integer,NSImage)
Stores the person image that is displayed in the CRM application.
Introduced or updated in version: 7
Declaration
Void SetPersonImage(Integer personId, NSImage image)
Parameters
Type | Name | Description |
---|---|---|
Integer | personId | The person ID of the person the image belongs to. |
NSImage | image | The project image (System.Drawing.Image). |
Returns
Type | Description |
---|---|
Void |
SetProductImage(Integer,NSImage)
Stores the product image that is displayed in the CRM application. The image is scaled down to max 1000x1000. This method operates only the main (rank=1) image; future extensions may support multiple images. A thumbnail of size 75x75 is also automatically set.
Introduced or updated in version: 7.5
Declaration
Void SetProductImage(Integer productId, NSImage image)
Parameters
Type | Name | Description |
---|---|---|
Integer | productId | The project ID of the product the image belongs to. |
NSImage | image | The project image (System.Drawing.Image), scaled down to no more than 1000x1000. |
Returns
Type | Description |
---|---|
Void |
SetProductThumbnail(Integer,NSImage)
Stores the product thumbnail that is displayed in the CRM application. The image is scaled down to max 200x200 pixels.
Introduced or updated in version: 7.5
Declaration
Void SetProductThumbnail(Integer productId, NSImage image)
Parameters
Type | Name | Description |
---|---|---|
Integer | productId | |
NSImage | image | The project image (System.Drawing.Image). |
Returns
Type | Description |
---|---|
Void |
SetProjectImage(Integer)
Stores the project image that is displayed in the CRM application.
Introduced or updated in version: 7
Declaration
Void SetProjectImage(Integer projectId, NSImage image)
Parameters
Type | Name | Description |
---|---|---|
Integer | projectId | The project ID of the project the image belongs to. |
NSImage | image | The project image (System.Drawing.Image). |
Returns
Type | Description |
---|---|
Void |