Show / Hide Table of Contents

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.

Declaration
NSBLOBAgent
Examples
NSBLOBAgent agent;
agent.callMethod(arg1, arg2);

Methods

ChangeContactImage(Integer,Integer)

Changes the contact image link.

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.

Examples
NSBLOBAgent agent;
agent.callMethod(arg1, arg2);

ChangePersonImage(Integer,Integer)

Collection of all services that work with binary objects (BLOBS). For example, images and documents.

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.

Examples
NSBLOBAgent agent;
agent.callMethod(arg1, arg2);

ChangeProductImage(Integer,Integer)

Changes the project image link.

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.

Examples
NSBLOBAgent agent;
agent.callMethod(arg1, arg2);

ChangeProjectImage(Integer,Integer)

Changes the project image link.

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.

Examples
NSBLOBAgent agent;
agent.callMethod(arg1, arg2);

CleanupBatchTask(Integer)

Removes the binary objects linked to the batch task, the links themselves and the batch task.

Declaration
Void CleanupBatchTask(Integer batchTaskId)
Parameters
Type Name Description
Integer batchTaskId
Returns
Type Description
Void
Examples
NSBLOBAgent agent;
agent.callMethod(arg1, arg2);

CreateDefaultBlobEntity()

Sets default values into a new NSBlobEntity.

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

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

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.

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.

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.

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.

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.

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.

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

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.

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.

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.

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

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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
Examples
NSBLOBAgent agent;
agent.callMethod(arg1, arg2);

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.

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

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
Examples
NSBLOBAgent agent;
agent.callMethod(arg1, arg2);

SetContactImage(Integer,NSImage)

Stores the contact image that is displayed in the CRM application.

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
Examples
NSBLOBAgent agent;
agent.callMethod(arg1, arg2);

SetPersonImage(Integer,NSImage)

Stores the person image that is displayed in the CRM application.

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
Examples
NSBLOBAgent agent;
agent.callMethod(arg1, arg2);

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.

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
Examples
NSBLOBAgent agent;
agent.callMethod(arg1, arg2);

SetProductThumbnail(Integer,NSImage)

Stores the product thumbnail that is displayed in the CRM application. The image is scaled down to max 200x200 pixels.

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
Examples
NSBLOBAgent agent;
agent.callMethod(arg1, arg2);

SetProjectImage(Integer)

Stores the project image that is displayed in the CRM application.

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
Examples
NSBLOBAgent agent;
agent.callMethod(arg1, arg2);
In This Article
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top