Skip to Content
author's profile photo Former Member
Former Member

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

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 11, 2006 at 03:15 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on May 29, 2008 at 06:06 AM

    Helloo Martin,

    were you able to resolve this issue ?

    Thanks,

    Vinit

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.