AnsweredAssumed Answered

Error message in AF version

Question asked by Suganya_Ganesan on Sep 30, 2015
Latest reply on Sep 30, 2015 by dng

Hi All,

 

I have tried validating based on version Id but prompting error message as "cannot convert implicitly system.guid to osisoft.af.asset.afversion" Will anyone please resolve this issue??? Here is my code snippet .

 

AFElement parentAFElement = objAFDatabase.Elements["MMO"];

                                        AFElement childAFElement = parentAFElement.Elements["Meters"];

                                        AFElement myAFElement = childAFElement.Elements[meterId];

                                        DateTime dtVersion = myAFElement.Version.EffectiveDate;

                                        AFVersion versionId = myAFElement.Version.VersionID;//......GETTING ERROR HERE................////

                                        //if (myAFElement.Version.VersionID.ToString() == "2")

                                        if(versionId.ToString() =="2")

                                        {

                                            if (csvInputFileName.ToUpper().StartsWith("INCON"))

                                            {

                                                ExceptionHandling("Updated connection Mode file received before Initial Connection Mode Report", "EC17", "AC17");

                                                LogMessage(csvInputFileName, startcsvDateProcess, "", "", "", "Updated connection Mode file received before Initial Connection Mode Report");

                                            }

                                        }

Outcomes