Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problem with multiregion

Hi!

i have 2 languages on my MDM Server, English and Spanish, but i cant retrieve values from Spanish language

here is mine code to retrieve values from RecordResultSet

public void findByNomeProduto(String nome) throws CommandException{
		//BUSCAR NA TABELA
		Search search = new Search(Schema.Produtos.TABLE);
		//NO CAMPO
		FieldSearchDimension fsdMaintableType = new FieldSearchDimension(Schema.Produtos.NOME);
		//O VALOR QUE CONTAINS
		TextSearchConstraint tscTypeRoot = new TextSearchConstraint(nome, TextSearchConstraint.CONTAINS);
		
		//ADICIONA PARAMETROS NA BUSCA
		search.addSearchItem(fsdMaintableType, tscTypeRoot);
		
		//DEFINE O RETORNO
		ResultDefinition resultDefinition = getResultDefinition(Schema.Produtos.TABLE, new FieldId[]{Schema.Produtos.NOME,
																									 Schema.Produtos.CATEGORIA		
																									});
		//EXECUTA A BUSCA
		RecordResultSet res = executeSearch(search, resultDefinition);
		
		//LOOP REGIOES 
		for(int iRegions = getRegions().length;iRegions>0;iRegions--){
			RegionProperties region = getRegions()[iRegions-1];
			System.out.println(region.getName());
			//LOOP ROWS
			for(int iRows = res.getRecords().length;iRows>0;iRows--){
				Record rec = res.getRecord(iRows-1);
				
				//VERIFICAR SE EXISTE DESCRIÇÃO NO IDIOMA INFORMADO 
				
				if(rec.getMultiregionFieldValue(Schema.Produtos.NOME).containsRegion(region.getRegionCode())){
					System.out.println(rec.getMultiregionFieldValue(Schema.Produtos.NOME).getValue(region.getRegionCode()));
				}else{	
					System.out.println(rec.getFieldValue(Schema.Produtos.NOME));
				}
				System.out.println(getTaxonomyDescription(rec,Schema.Produtos.TABLE,Schema.Produtos.CATEGORIA_PROPERTIES));
				
			}
		}
		
	}

when in this line "if(rec.getMultiregionFieldValue(Schema.Produtos.NOME).containsRegion(region.getRegionCode()))" and tha language is Spanish it didi'nt enter on the if clause!

i dont undestand it because i know i have spanish description on the mdm server and i can see it by Data Manager !!!

Can anyone helpme please ?

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question