on 03-27-2009 5:57 PM
I have add TextBlobRecord row to the Text Block Table, and now I would like to add the row reference
to the anothe table filed which has type Lookup [Text Block].
How to do this, and which MmdValue type should I use?
recordEx.setFieldValue(schema.getFieldId("MDM_BUSINESS_PARTNERS", "ADDRESS"), ? );
Hi,
You have to use LookupValue type.first you need to get record id from Text Blocks table and has to create instance of LookupValue. ....Please see the code below.....
RecordId recordId = new RecordId("R1");
MdmValue mdmValue = new LookupValue(recordId);
record.setFieldValue("Field Id",mdmValue);
Hope it helps..........
Regards,
Veeru.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sergey,
You may use the below code for creating a record in Text Blocks table and then attach it to main table as we do for Lookup values.
CreateRecordCommand objCreateRecordCommand = new CreateRecordCommand(objConnectionManager.getConnectionAccessor());
TextBlobRecord objTextBlobRecord = RecordFactory.createEmptyTextRecord(new TableId(strTextBlockTableId));
objTextBlobRecord.setBinary(objBinaryValue);
objTextBlobRecord.setDataGroupId(new GroupNodeId(1));
objTextBlobRecord.setDescription(new StringValue("Attached file reference"));
objTextBlobRecord.setDataSize(new StringValue(fileBuf.length+""));
objTextBlobRecord.setHasThumbnail(new StringValue("false"));
objTextBlobRecord.setName(new StringValue(strUploadFileName));
objTextBlobRecord.setCode(strUploadFileName);
objTextBlobRecord.setOriginalName(new StringValue(strUploadFileName));
objTextBlobRecord.setSource(new LookupValue(new RecordId(1)));
objCreateRecordCommand.setRecord(objTextBlobRecord);
objCreateRecordCommand.setSession(strUserSessionId);
try
{
objCreateRecordCommand.execute();
}
catch (CommandException e)
{
throw e;
}
Hope this helps!!
Cheers,
Arafat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.