cancel
Showing results for 
Search instead for 
Did you mean: 

Set qualified multivalue-lookup table Value to main table through Java API

Former Member
0 Kudos

Hello together,

I have some trouble with a qualified multivalue lookup table and the Java API: I am currently not able to create a main-table record with a value for this qualified table using the Java API.

My scenario looks as follows:

Main Table: 'Person' [has a name, address and so on]

Qualified Lookup: 'CleansingCase' => lookup-table= 'CleansingCases':

- display field: 'Search Pattern' => Lookup Field to 'Search Patterns' table

- qualifier: 'Group' => Lookup Field to 'Groups' table

My program correctly fills the subtables 'Search Patterns' and 'Groups'. Also, the CleansingCases table was filled.

What I want to do now is to update an existing entry from the main table by assigning an Entry from the CleansingCase table. But unfortunately, I only receive a "StringException: ModifyQualifiedLinks error"

It would really be great if there was somebody out there who can help me...

Some of my coding:


QualifiedLinkArray qualifiedLinkArray = new QualifiedLinkArray();
QualifiedLink qualifiedLink = new QualifiedLink();

qualifiedLink.GetQualifiers().Add(new A2iField("Group"));
qualifiedLinkArray.Add(qualifiedLink);

int recID = <maintable-recordId> ;
int changeStamp = <maintable-record-ChangeStamp> ;

catalog.AddQualifiedLinks(<table>, "CleansingCase", recID, qualifiedLinkArray, changeStamp );

I am more than happy to provide more information if needed

Thanks in advance,

Martin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Martin,

QualifiedLinkArray qualifiedLinkArray = new QualifiedLinkArray();

QualifiedLink qualifiedLink = new QualifiedLink();

//set non-qualifier

//get the record id of the lookup table for the non qualifier

<b>int lookupRecordID = getRecordID(<Lookup table name>,<Lookup DF>,<value>);

qualifiedLink.SetLookupID(lookupRecordID);</b> //set qualifier value

//in your case for qualifier Group

<b>int groupRecId = getRecordID(<Group Table>,<Group Table DF name>,<value>);

Value val = new Value(groupRecId);

A2iField field1 = new A2iField(<FieldName>,val);</b>

qualifiedLink.GetQualifiers().Add(field1);

qualifiedLinkArray.Add(qualifiedLink);

// get the main table record id for which you want to add a qualified record

int recordId = getRecordID(<Main Table Name>, <Display Field>,<Value>);

int changeStamp = getChangeStamp(<Main Table Name>, recordId);

catalog.AddQualifiedLinks(<Main Table>, <Qualified Field Name in Main Table>, recordId,qualifiedLinkArray, changeStamp);

Hope this helps, Let me know if you need additional information.

Thanks and Regards

Subbu

Former Member
0 Kudos

Hi Subbu,

Even I have got the same error. I'm working on the standard repository SP3_VENDOR so that it will be easier to understand my scenario.

Main table --> Vendors. Field in the Vendors --> Phone Number. Qualified look-up table --> Phone Numbers.

Now, Phone Numbers table has 5 qualifies field

1. Telephone

2. Standard No.

3. Sequence No.

4. Extension

5. Complete No.

and non-qualifier field --> Country.

Hope the scenario is clear.

I have found out both the record ID for "Vendors" and "Phone Numbers" and changestamp for the main table record.

But after the same procedure suggested by you, I'm getting "StringException: ModifyQualifiedLinks error".

Code snippet,

<b>QualifiedLinkArray qualifiedLinkArray = new QualifiedLinkArray();

QualifiedLink qualifiedLink = new QualifiedLink();

//set non-qualifier

//get the record id of the lookup table for the non qualifier

int lookupRecordID = getRecordID(<Lookup table name>,<Lookup DF>,<value>);

qualifiedLink.SetLookupID(lookupRecordID); //set qualifier value</b>

//for all qualifier fields

<b>Value val = new Value(rec_value);

A2iField field1 = new A2iField(<FieldName>,val);

qualifiedLink.GetQualifiers().Add(field1); </b>

and then the addition to Array and catalogdata.AddQualifiedLinks();

I would like to ask if values for all the qualifier fields needs to be specified(none of them are "required" field). Am I doing something wrong here.

Please suggest,

Thanks and Regards,

Mausam

Answers (1)

Answers (1)

Former Member
0 Kudos

Helloo Martin,

were you able to resolve this issue ?

Thanks,

Vinit