on 09-17-2009 11:00 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jesus and Kalyan,
Use - QualifiedLinkValue.getQualifiedLookupRecord() method that returns a Record instance.
Regards,
Vinay M.S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
I have a similar situation and hope someone answers..Just piggy backing on your thread
Thanks
Kalyan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.