cancel
Showing results for 
Search instead for 
Did you mean: 

Add records, using categories and attributes Java API

Former Member
0 Kudos

Hello everyone:

I need to create a new record, but it has both fields and attributes. I know that I need to create the record first:

// assume the fields are already in place, as well as connection:

A2iFields fields = new A2iFields();

id= mdmConnector.AddRecord("Materials", fields, 0, 0);

but I have not found a way to fill not only the fields, but also the attributes, as the Materials table has a Category field, with this, having some specific attributes related to each category.

Any ideas?

Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You must first create the record, specifying the category, and then add attributes using the UpdateRecordAttributes method. Here's the javadoc for it.

public int UpdateRecordAttributes(java.lang.String table,

java.lang.String field, int recordID, AtributeValueExArray modifiedAttributes, int inChangeStamp) throws StringException

Updates attribute values for the specified record.

Parameters:

table - the table name.

field - the taxonomy field in the specified table.

recordID - record ID of record whose attributes are to be modified.

modifiedAttributes - the list containing name/value pairs of attributes to be updated.

inChangeStamp - the last known change stamp of the record.

Returns: the new change stamp.

Throws: StringException - such as a loss of connection to the server

Hope this helps,

Richard