cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in getting the value from MultiregionValue in MDM 5.5

Former Member
0 Kudos

Hello All,

When I try to get the value from the multiregionvalue instance bu passing the regioncode as parameter,

i get the below error.

java.lang.IllegalArgumentException: Value for region code 'engUSA' was not populated or such region code is not specified for repository

my sample code.

MultiregionValue mr=modifiedRecord.getMultiregionFieldValue(status_fl);

GetRepositoryRegionListCommand regionList = new GetRepositoryRegionListCommand(connectionPool);

regionList.setRepositoryIdentifier(cmnProxyServices.repositoryIdentifier);

regionList.execute();

RegionProperties[] regions = regionList.getRegions();

if(mr.isMultiregion()){

String[] regioncodes=mr.getRegionCodes();

for(int r=0;r<regioncodes.length;r++){

StringValue sv=(StringValue)mr.getValue(regioncodes[r].toString());

for(int region=0;region<regions.length;region++){

if(regioncodes[r].equals(regions[region].getRegionCode())){

arryLstregioncode.add(regions[region].getRegionCode());

}

}

while trying to get the value i am getting the error.

mr.getValue(arryLstregioncode.get(l)).toString()

my question is it a known issue with Multiregion.getValue(String regioncode) method??

Regards

Sabarinathan

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I tried many times by passing correct regioncode to getValue method of MultiregionValue,but no luck.

MultiregionValue mr=modifiedRecord.getMultiregionFieldValue(status_fl);

mr1.getValue(regions[0].getLocale().getCountry()) //no luck

mr1.getValue(regions[0]) //no luck

mr1.getValue(regions[0].getRegionCode()) //no luck

in the java doc ,it is mentioned if we can pass the regioncode as string.

is it a known bug??

please help.

Former Member
0 Kudos

i had resolved this issue by using getRegionalStrings method

Cheers

Sabarinathan

Former Member
0 Kudos

Hi Sabarinathan,

Could you please provide the way how did you get the regionalStrings.

we are using MDM 5.5 SP06 . the method which you mentoned getRegionalStrings() is there in SP04 version it is depricated in SPO6.But we have a class MultiLingualString Class which have a method that gives RegionalString[] .

RegionalString[] getStrings() --> Returns the list of regional string.

So can you please provide your pointers that from where shoud i get the "RegionalString" is it on repository or from Record.

I tried the way whay you mentioned in this thread using MultiRegionvalue. but it is throwing following error.

"Value for region code 'engUSA' was not populated or such region code is not specified for repository "

advanced thanks ....

Regards

Ratnakar

Former Member
0 Kudos

Try to use

MdmValue mdmvalue=mr1.getValue(regions[0].getRegionCode());

StringValue strvalue=(StringValue)mdmvalue;

strvalue.toString();

print it and see

Former Member
0 Kudos

The record is printed ..

rec.getMultiregionFieldValue((FieldId)schema.getFieldId("Customers","Name_1")).getValue("endUSA);

Record{ID=R753 Fields={F22_173=99887766, F188_8246=R31, F456_41134=[Null], F475_41155={eng___=test,ungUSA=test123}, F472_41152=[Null], F473_41153=[Null], F474_41154=[Null].

regards

Ratnakar

Former Member
0 Kudos

if (customerNo != null) {

TableId tableId =

schema.getTable("Customers").getId();

//table code from upper

Search srch = new Search(tableId);

wdComponentAPI.getMessageManager().reportSuccess("Comm_Func: "+"1");

FieldId Fld1 =

schema.getFieldId(

"Customers",

"Customer");

//search parameteres1:lower

wdComponentAPI.getMessageManager().reportSuccess("Comm_Func: "+"3");

//from main (sales data)

//getting the data from the table

// lower

//wdComponentAPI.getMessageManager().reportSuccess("Comm_Func: "+"4");

ResultDefinition rd = new ResultDefinition(tableId);

wdComponentAPI.getMessageManager().reportSuccess(

"Comm_Func: " + "3");

rd.addSelectField(Fld1);

wdComponentAPI.getMessageManager().reportSuccess("Comm_Func: "+"4");

FieldSearchDimension fldDim1 = new FieldSearchDimension(Fld1);

TextSearchConstraint fldCon1 =

new TextSearchConstraint(

customerNo,TextSearchConstraint.EQUALS);

srch.addSearchItem(fldDim1, fldCon1);

wdComponentAPI.getMessageManager().reportSuccess(

"Comm_Func: " + "5");

RetrieveLimitedRecordsCommand comm =

new RetrieveLimitedRecordsCommand(

wdContext.currentContextElement().getConnectionStr());

comm.setSession(wdContext.currentContextElement().getSessionId());

comm.setRegionalLayer(RegionalLayer.ALL);

//chk it

comm.setResultDefinition(rd);

comm.setSearch(srch);

wdComponentAPI.getMessageManager().reportSuccess(

"Comm_Func: " + "6");

try {

comm.execute();

wdComponentAPI.getMessageManager().reportSuccess(

"Comm_Func: " + "7");

int totalRecord = comm.getRecords().getCount();

RecordResultSet records = comm.getRecords();

wdComponentAPI.getMessageManager().reportSuccess("Record id:"+records.getRecord(0).getId());

wdComponentAPI.getMessageManager().reportSuccess(

"Comm_Func: " + "8");

Record record = records.getRecord(0);

return record;

} catch (Exception e) {

wdComponentAPI.getMessageManager().reportException(

"Fetch record command exception:" + e.getLocalizedMessage(),

false);

http://help.sap.com/saphelp_mdm550/helpdata/en/47/9f23e5cf9e3c5ce10000000a421937/frameset.htm

Former Member
0 Kudos

Hi ,

I have created a usersession for Region data LOCAL[ANY] . We have another region English [US]. So i am reading customer record from MDM 5.5 using RetrieveLimitedCommand record. Wile record retrieval the result set should contain the data with respect to all languages instead of default language LOCAL.

I applied the RegionalLayer .ALL on the command of RetrieveLimitedRecordsCommand object like comm.setRegionalLayer(RegionalLayer.ALL). But it didnt help me to retrieve the mulilingual data on the record. Result set is giving only default language record data. If the result set hold the data for multilanguages then i can apply the MultiRedion Class for field retrieval on the record as follwing .

record.getMultiregionFieldValue("FieldId".getValue(regionCodes[0]/[1]/[n]).above you can find the code as well.

but it isworking only for one region that is defalut region LOCAL ( eng__ -> region code )..where as for English it is throwing an error that record is not populated for regionsdata "engUSA".

Can any body suggest me that did i missed out any required configuration . thanks for your valuable pointers..

Regards

Ratnakar