Skip to main content
Answer

Best method for Filtered View

  • September 26, 2023
  • 4 replies
  • 121 views

Forum|alt.badge.img+1

When in the mobile app I would like the Tasks data view in ProjectEntry to show a filtered list of tasks, but when viewed elsewhere show the full list.

I am looking for a recommendation on how to do this.

My concern is that if I modify or override the Tasks data view, then other dependent ACU code will break. Should I create a new FilteredTasks data view using a projection? Or am I missing a better option? 

 

Thanks 

Best answer by Zoltan Febert

PXGraph has an IsMobile property, you can check in in your dataview override.

 

if (Base.IsMobile)
{
//return filtered data
}
else
{
//return everything
}

 

4 replies

darylbowman
Captain II
Forum|alt.badge.img+15

I’m not aware of a way to provide an alternative experience of the same view in the mobile app vs web. I’m definitely not saying it’s not possible, but I wouldn’t know where to begin.

The only thing I can think of (which would be a lot of work, I think) would be to somehow duplicate the screen and make the modification to the duplicate screen and then customize the app to remove the original screen and replace it with the duplicated and customized screen.

The same thing could possibly be accomplished at the tab level, but I have very little experience doing this type of thing.

Hopefully someone else has a better idea.


Zoltan Febert
Jr Varsity I
Forum|alt.badge.img+3
  • Jr Varsity I
  • Answer
  • September 27, 2023

PXGraph has an IsMobile property, you can check in in your dataview override.

 

if (Base.IsMobile)
{
//return filtered data
}
else
{
//return everything
}

 


darylbowman
Captain II
Forum|alt.badge.img+15

PXGraph has an IsMobile property

Oh sweet 😎


Forum|alt.badge.img+1
  • Author
  • Varsity I
  • September 27, 2023

Okay, This worked for me

 

        [PXImport(typeof(PMProject))]
        [PXFilterable(new Type[] { })]
        [PXCopyPasteHiddenFields(new Type[]
        {
            typeof(PMTask.completedPercent),
            typeof(PMTask.endDate)
        })]
        public PXSelect<PMTask, Where<PMTask.projectID, Equal<Current<PMProject.contractID>>>> Tasks;
        public virtual IEnumerable tasks()
        {
            PXSelectBase<PMTask> sel = new PXSelect<PMTask, Where<PMTask.projectID, Equal<Current<PMProject.contractID>>>>(Base);

            if (Base.IsMobile)
            {
                sel.WhereAnd<Where<PMTask_Ext.usrConstructionTask, Equal<True>>>();
            }
            return sel.Select();
        }