cancel
Showing results for 
Search instead for 
Did you mean: 

Calculated fields and the java API

Former Member
0 Kudos

Hi

I was writing some code to add a records to the master table in my MDM repository using the JAVA API.

Some how the records are in but all my calculated fields are not executed.

do i need to do somthing special in order to execute the calculated fields?

Thanks

Noam

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Noam,

You might have to call the following method.

RefreshCalculatedFields(<tablename>,<integer array of record id's>) method of the CatalogData class.

You can take the return value of the AddRecord method which is the record id.

Build an integer array with that id and pass that array as an arguement to the RefreshCalculatedFields();

It does the same functionality as the recalculate in MDM Data Manager(Select a record which has a Calculated field->right click->reclaculate).

Let me know if you need additional information.

Thanks and Regards

Subbu

Former Member
0 Kudos

Hi Subbu

What type of API version you are using?

i don't have this Method under CatalogData class

the only related method is

CatalogRefreshCalculatedFields(RepositoryTag) - Method in class a2i.generated.CMSrvClient

Thanks

Noam

Former Member
0 Kudos

Hi Noam,

I am using MDM 5.5 SP3 Patch level 2.

These methods are available from SP3 Patch level 1 onwards. Probably you might be using SP3 or the lower versions.

a2i.common.CatalogData class has the following 2 methods.

RefreshCalculatedFields

public void RefreshCalculatedFields(java.lang.String table,

int[] recordIDs)

throws StringExceptionRe-calculate all calculated fields for the given records.

Parameters:

table - the table name

recordIDs - the list of record IDs

Throws:

StringException - such as a loss of connection to the server.

-


RefreshCalculatedFields

public void RefreshCalculatedFields(int tableID,

int[] recordIDs)

throws StringExceptionRe-calculate all calculated fields for the given records.

Parameters:

tableID - the table ID

recordIDs - the list of record IDs

Throws:

StringException - such as a loss of connection to the server.

Thanks and Regards

Subbu

Former Member
0 Kudos

Hi Subbu

Great, i have update the API and now i can see the functions.

I am using the AddRecordCommand to add a batch of records.

The problem is that this method does not give in return on the execute any reference to the list of added IDs.

I can see that there is one method on the CommandErrorArray that have protected function CreateArrayObject that this one may ave return the new objects but its protected.

Do you have any idea how i can get the IDs of the new add records when using the AddRecordCommand?

Thanks

Noam

Former Member
0 Kudos

Hi,

What steps are you following to add Bulk records into a table using the AddRecordsCommand.

Based on the steps I could figure out where you can get the ID's.

Thanks and Regards

Subbu