cancel
Showing results for 
Search instead for 
Did you mean: 

how to fetch record ID with client system as input.

Former Member
0 Kudos

Hi all

I tried fetching record ID using "GetRecordsIDbyRemoteKey()" method.This requires client system and key[] as Input.

Is their any method availaible by which we can get record ID giving only client system as input.

Regards

Swati

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello:

I believe you'd have to fetch all the records and traverse them, picking only the ones that have a keymapping in the client system you supplied.

First you need to retrieve the available client systems:


// assume a CatalogData object called mdmConnector
ClientSystemArray clientSystemsBuffer = mdmConnector.GetClientSystems();

// Unwrap them...... I just need the name
String currentClientSystem = "";	

for(int k = 0; k < clientSystemsBuffer.GetCount(); k++)
{
	currentClientSystem = ((ClientSystem)clientSystemsBuffer.GetAt(k)).GetName();
	int[] record= {recordId};
//			TODO: Catch exception if no client Systems are on MDM Rep	

	String[][] keySystems =  mdmConnector.GetKeyMapping(currentClientSystem,
table,
record, 
false);
	for(int a = 0; a < keySystems.length; a++)
		for(int b = 0; b < keySystems[a].length; b++)
			keyMappingCount++;

}// for each client system
		

A more efficient way would be to include several records on the record[] array, so you could traverse all the table faster.

Please note that you still need to manage what happens if no client systems are available, and some other possible exceptions, that's why you need to place this piece of code on a try/catch statement

I hope that helps

Alejandro