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

Read field value in event receiver

$
0
0

Is it possible to read value of field in project server event receiver before and after saving?

I have registered OnUpdating and OnUpdated events and in both events I get the same value ("after" value) and I have code:

public override void OnUpdated(PSLib.PSContextInfo contextInfo, ProjectPostUpdatedEventArgs e)
        {
            //base.OnUpdated(contextInfo, e);

            try
            {
                Guid tGuid = new Guid("634c1355-e045-432b-89a6-8dac883b164f ");
                for (int i = 0; i < e.ProjectDataSet.ProjectCustomFields.Count; i++)
                {
                    if (e.ProjectDataSet.ProjectCustomFields[i].MD_PROP_UID == tGuid)
                    {
                        string value = e.ProjectDataSet.ProjectCustomFields[i].CODE_VALUE.ToString();
                        break;
                    }
                }
            }
            catch (Exception)
            {
            }
            
        }

        public override void OnUpdating(PSLib.PSContextInfo contextInfo, ProjectPreEventArgs e)
        {
            //base.OnUpdating(contextInfo, e);

            Guid tGuid = new Guid("634c1355-e045-432b-89a6-8dac883b164f ");
            for (int i = 0; i < e.ProjectDataSet.ProjectCustomFields.Count; i++)
            {
                if (e.ProjectDataSet.ProjectCustomFields[i].MD_PROP_UID == tGuid)
                {
                    string value = e.ProjectDataSet.ProjectCustomFields[i].CODE_VALUE.ToString();
                    break;
                }
            }
        }

I would like to see the change in that field.


Viewing all articles
Browse latest Browse all 5347

Trending Articles



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