Pregunta

Estoy tratando de agregar un conjunto jerárquico de las entradas de búsqueda a una tabla de búsqueda.Pero todas las entradas vienen en un solo nivel.Estoy usando un modelo de objeto cliente administrado para el mismo.¿Cómo implito la indentación?

            LookupTableCreationInformation linfo = new LookupTableCreationInformation();
            linfo.Id = Guid.NewGuid();
            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 = ".";


            LookupEntryCreationInformfation LCntCrInf = new LookupEntryCreationInformation();
            LCntCrInf.Description = "Test";
            var id = Guid.NewGuid();
            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 = Guid.NewGuid();

            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();

En el código, estoy agregando dos máscaras, y luego dos entradas.Estoy asignando al ID de Padres de la segunda entrada, el ID de la primera entrada.

no parece funcionar.

¿Fue útil?

Solución

que parecía funcionar bien para mí:

prueba de búsqueda

Solo tuve que agregar lo siguiente para agregar la tabla: ctx.lookurrupables.add (LINFO);

Licenciado bajo: CC-BY-SA con atribución
scroll top