You are viewing limited content. For full access, please sign in.

Question

Question

How to set multi-value field groups with SDK

SDK
asked on August 8, 2019 Show version history

I'm trying to use the SDK to set some multi-value field groups and I'm running into some trouble.

Here's a representative sample of my code. I've tried to stay true to the sample I found in PRD319 ImportingandUpdatingwiththeSDK\Dev 302 Sample Code\Dev_302.cs.

fvc.AppendValues("Field One", new object[] { "Value One" });
fvc.AppendValues("Field Two", new object[] { "Value Two" });

var rowNums = new List<int> { 1 };
		
fvc.SetFieldRowNumbers("Field One", rowNums);
fvc.SetFieldRowNumbers("Field Two", rowNums);

doc.SetFieldValues(fvc);
doc.Save();

I can see that fvc (FieldValueCollection) is getting populated with the values, but after the save, the fields that are part of multi-value groups are empty. The rest of the standard fields that were set further up have been save appropriately. There aren't any errors thrown.

What am I missing?

This is using SDK 10.2 against LFS 10.4.1.362.

0 0

Replies

replied on August 8, 2019

Are you saying the "Value One" and "Value Two" values don't show up anywhere in the metadata after this code is run? This means your Save() call is failing, could it be an exception that is being suppressed? You can check the propval table in SQL to verify that the values made it to the database. Otherwise the code looks fine to me.

1 0
replied on August 8, 2019

My example was simplified too much, and actually did work. Somewhere higher up in my abstraction there was another layer of object being added. It's working fine now.

Thank you!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.