cancel
Showing results for 
Search instead for 
Did you mean: 

Insert a record in Qualified Lookup Table

Former Member
0 Kudos

Hello everyone,

I need code to insert a record in Qualified Lookup Table where the non-qualifier is a record of type Country. Other fields are qualifiers.

I tried using QualifiedLookupValue.createQualifiedLink(). However, this only helps to insert in the qualifier values, how can I insert the non-qualifier (Country) value?

Any idea?

Many thanks in advance,

Baez

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

You can try this code for Inserting a record in Qualified lookup table.

QualifiedLookupValue qualifiedLookupValue = new QualifiedLookupValue();

qualifiedLookupValue = new QualifiedLookupValue();

int l_index_no = qualifiedLookupValue.createQualifiedLink(recordidfromQualifiedtable);

qualifiedLookupValue.setQualifierFieldValue(l_index_no,

schema.getFieldId(Qualifiedtable, qualifiedfieldname),

new StringValue(value));

MainRecord.setFieldValue(schema.getFieldId(maintablename, maintablequalifiedID),

new QualifiedLookupValue(qualifiedLookupValue));

Hope thsi will work.

Thanks & Regards,

Dhanalakshmi

former_member189669
Active Participant
0 Kudos

Hi Jesus and Kalyan,

Use - QualifiedLinkValue.getQualifiedLookupRecord() method that returns a Record instance.

Regards,

Vinay M.S

Former Member
0 Kudos

Hi Gurus,

I have the above requirement of inserting a a record into qualifiedlookup.

I am not able to get the record for non-qualifier value.

Here is some of the code from samples, but not able to get the variable recIdRefPriceQual below which is a NonQualifier record.

QualifiedLookupValue qlvLookUp = new QualifiedLookupValue();

int linkId = qlvLookUp.createQualifiedLink(recIdRefPriceQual);////// I DON't KNOW HOW TO GET THIS RECORD recIdRefPriceQual and I want to update the main record with new values.

qlvLookUp.setQualifierFieldValue(linkId, schema.getField("ReferencePrices", "Currency").getId() , new LookupValue(new RecordId(recIdCurrency)));

Any ideas.

Regards

-Sai

Former Member
0 Kudos

Hi guys,

Maybe the answer comes late but i'm recently working on this and the API works for me to create and update qualifier values.

Suppose recordMain is the main record, fldQFT is the qualified lookup field in main table, fldQualifier is the qualifier field in QFT table.

To add qualifier value you can use:

QualifiedLookupValue qualifiedLookupValue = new QualifiedLookupValue();

int index = qualifiedLookupValue.createQualifiedLink(recordMain.getId());

qualifiedLookupValue.setQualifierFieldValue(index, fldQualifier, MdmValue);

recordMain.setFieldValue(fldQFT, qualifiedLookupValue);

To update qualifier value, use:

QualifiedLookupValue qualifiedLookupValue = (QualifiedLookupValue) recordMain.getFieldValue(fldQFT);

qualifiedLookupValue.setQualifierFieldValue(index, fldQualifier, MdmValue);

recordMain.setFieldValue(fldQFT, qualifiedLookupValue);

Regards,

James

Former Member
0 Kudos

I have a similar situation and hope someone answers..Just piggy backing on your thread

Thanks

Kalyan