Quantcast
Channel: Project Customization and Programming forum
Viewing all articles
Browse latest Browse all 5347

CSOM Lambda filters on Task Collection

$
0
0

I would like to correct the lambda expression to filter on  thistool + " Prelim Drawings".I tried a Where but it says t.[Name] can't be ToString() I tried casting it as well (string), that ran without error but did not return the result.

Is there a trick here I've seen CAML examples that I didn't understand.

                foreach (PublishedProject pubProj in projContext.Projects)
                {
                    if (pubProj.Name == projname)
                    {            
                        projContext.Load(pubProj.Tasks, ts => ts.Include(t => t["Name"], t => t["PercentWorkComplete"]));
                        projContext.ExecuteQuery();

                        foreach (PublishedTask tsk in pubProj.Tasks)
                        {
                            if (tsk.Name != null)
                            {
                                if (tsk.Name == thistool + " Prelim Drawings")
                                {
                                    uxlblTool.Text = tsk.Name + "  - " + tsk.PercentWorkComplete.ToString() + "% Work Complete";
                                }
                            }
                        }
                    }
                }


Viewing all articles
Browse latest Browse all 5347

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>