Example #1
0
        public virtual InventoryAllocDetEnq.ItemPlanWithExtraInfo[] UnwrapAndGroup(PXResultset <InventoryAllocDetEnq.INItemPlan> records, UnwrapAndGroupDelegate baseMethod)
        {
            InventoryAllocDetEnq.ItemPlanWithExtraInfo[] result = baseMethod(records);

            foreach (InventoryAllocDetEnq.ItemPlanWithExtraInfo item in result)
            {
                if (item.RefEntity == null && item.ItemPlan.RefEntityType == typeof(FS.FSServiceOrder).FullName)
                {
                    FS.FSServiceOrder fsServiceOrderRow = PXSelect <FS.FSServiceOrder, Where <FS.FSServiceOrder.noteID, Equal <Required <FS.FSServiceOrder.noteID> > > > .Select(Base, item.ItemPlan.RefNoteID);

                    item.RefEntity = new FSServiceOrder {
                        SrvOrdType = fsServiceOrderRow.SrvOrdType, RefNbr = fsServiceOrderRow.RefNbr, NoteID = fsServiceOrderRow.NoteID
                    };
                }
            }

            return(result);
        }
        public virtual InventoryAllocDetEnq.ItemPlanWithExtraInfo[] UnwrapAndGroup(PXResultset <InventoryAllocDetEnq.INItemPlan> records, UnwrapAndGroupDelegate baseMethod)
        {
            InventoryAllocDetEnq.ItemPlanWithExtraInfo[] result = baseMethod(records);

            foreach (InventoryAllocDetEnq.ItemPlanWithExtraInfo item in result)
            {
                Note note = item.Note;
                if (item.RefEntity == null && (note.GraphType.Substring(14) == IN.QtyAllocDocType.FSServiceOrder ||
                                               note.GraphType.Substring(14) == IN.QtyAllocDocType.FSAppointment))
                {
                    FS.FSServiceOrder fsServiceOrderRow = PXSelect <FS.FSServiceOrder, Where <FS.FSServiceOrder.noteID, Equal <Required <FS.FSServiceOrder.noteID> > > > .Select(Base, item.Note.NoteID);

                    item.RefEntity = new FSServiceOrder {
                        SrvOrdType = fsServiceOrderRow.SrvOrdType, RefNbr = fsServiceOrderRow.RefNbr, NoteID = fsServiceOrderRow.NoteID
                    };
                }
            }

            return(result);
        }