Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LookupTableCreationInformation linfo = new LookupTableCreationInformation();
- linfo.Id = new Guid();
- linfo.Name = "Test 01";
- linfo.SortOrder = LookupTableSortOrder.Ascending;
- LookupMask mask = new LookupMask();
- mask.Length = 2;
- mask.MaskType = LookupTableMaskSequence.CHARACTERS;
- mask.Separator = ".";
- LookupMask mask2 = new LookupMask();
- mask2.Length = 5;
- mask2.MaskType = LookupTableMaskSequence.CHARACTERS;
- mask2.Separator = ".";
- LookupEntryCreationInformation LCntCrInf = new LookupEntryCreationInformation();
- LCntCrInf.Description = "Test";
- var id = new Guid();
- LCntCrInf.Id = id;
- LCntCrInf.Value = new LookupEntryValue();
- LCntCrInf.Value.TextValue = "Aa";
- LookupEntryCreationInformation EntryInfo2 = new LookupEntryCreationInformation();
- EntryInfo2.Value = new LookupEntryValue();
- EntryInfo2.Value.TextValue = "Bb";
- EntryInfo2.ParentId = id;
- EntryInfo2.Description ="level2";
- EntryInfo2.Id = new Guid();
- List<LookupEntryCreationInformation> lcreInfo = new List<LookupEntryCreationInformation>();
- List<LookupMask> lmaskCreIf = new List<LookupMask>();
- lmaskCreIf.Add(mask);
- lmaskCreIf.Add(mask2);
- lcreInfo.Add(LCntCrInf);
- lcreInfo.Add(EntryInfo2);
- linfo.Masks = lmaskCreIf;
- linfo.Entries = lcreInfo;
- ctx.LookupTables.Update();
- ctx.ExecuteQuery();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement