3 Replies Latest reply on Apr 9, 2014 6:53 PM by schutcw

    Custom Data Reference Config String Display

    schutcw

      Hello,

       

      I have been writing a custom data reference and just recently added a custom form so that the user does not have to type directly into the settings field. My configuration string is based off of key-values pairs (ex: A=value1;B=value2;C=value3). After changing an attribute's Data Reference property to the new custom data reference, the settings textbox displays "A=;B=;C=" as I expected. The form seems to work as planned but once I click "OK" the form closes and the new configuration string is not displayed right away (the settings textbox remains as 'A=;B=;C='). If I close the attribute's property window and reopen it, only then do I see the new configuration string with the appropriate values that were entered in the custom form. I guess my question is what I should do to have the new config string display right away. For the OK button onClick method of my custom form, I call AFDataReference's SaveConfigChanges() method. It obviously saves the settings correctly but does not update the configstring in the settings box for the user to see. Any ideas? Thanks for any and all comments.

        • Re: Custom Data Reference Config String Display
          Roger Palmen

          There used to be an excellent example around on vcampus, but somehow can't find it anymore. I did create custom DR's using configuration forms, and did not have the issue you described. So i expect it to be an issue somewhere in your code. Unformtunately can't give you a good pointer yet to decent documentation. Still looking.

            • Re: Custom Data Reference Config String Display
              Roger Palmen

              Finally found it. If you look at the Library - White Papers - PI AF - Implementing AF Data References - Supporting files (vcampus.osisoft.com/.../Library.aspx ), there are 3 example DR's in the ZIPfile.

               

              Looking at e.g. the ROllUp DR, there is a config form in there which works.

               

              Did you properly implement "public override string ConfigString"? That builds the configstring from the set parameters. Would be my first area of interest.

                • Re: Custom Data Reference Config String Display
                  schutcw

                  Roger,

                   

                  Many thanks for the example. I had seen the white paper before but for some reason I had never seen the actual Visual Studio Solutions. For future reference to anyone who runs into the same silly problem, I used this.clos() for my OK button in my dialog instead of setting the button's DialogResult property to OK. Silly mistake and it took me awhile to figure it out. Would've taken me much longer if you hadn't provided the example files. Thanks so much!