Advertisement
Guest User

Untitled

a guest
Aug 20th, 2014
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. LookupTableCreationInformation linfo = new LookupTableCreationInformation();
  2. linfo.Id = new Guid();
  3. linfo.Name = "Test 01";
  4. linfo.SortOrder = LookupTableSortOrder.Ascending;
  5.  
  6. LookupMask mask = new LookupMask();
  7. mask.Length = 2;
  8. mask.MaskType = LookupTableMaskSequence.CHARACTERS;
  9. mask.Separator = ".";
  10.  
  11. LookupMask mask2 = new LookupMask();
  12. mask2.Length = 5;
  13. mask2.MaskType = LookupTableMaskSequence.CHARACTERS;
  14. mask2.Separator = ".";
  15.  
  16.  
  17. LookupEntryCreationInformation LCntCrInf = new LookupEntryCreationInformation();
  18. LCntCrInf.Description = "Test";
  19. var id = new Guid();
  20. LCntCrInf.Id = id;
  21. LCntCrInf.Value = new LookupEntryValue();
  22. LCntCrInf.Value.TextValue = "Aa";
  23.  
  24. LookupEntryCreationInformation EntryInfo2 = new LookupEntryCreationInformation();
  25. EntryInfo2.Value = new LookupEntryValue();
  26. EntryInfo2.Value.TextValue = "Bb";
  27. EntryInfo2.ParentId = id;
  28. EntryInfo2.Description ="level2";
  29. EntryInfo2.Id = new Guid();
  30.  
  31. List<LookupEntryCreationInformation> lcreInfo = new List<LookupEntryCreationInformation>();
  32. List<LookupMask> lmaskCreIf = new List<LookupMask>();
  33.  
  34. lmaskCreIf.Add(mask);
  35. lmaskCreIf.Add(mask2);
  36.  
  37. lcreInfo.Add(LCntCrInf);
  38. lcreInfo.Add(EntryInfo2);
  39.  
  40. linfo.Masks = lmaskCreIf;
  41. linfo.Entries = lcreInfo;
  42.  
  43. ctx.LookupTables.Update();
  44. ctx.ExecuteQuery();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement