Call a configuration parameter in Synchronization editor

Hello,

I have a configuration parameter:

Custom\LDAP\DefaultValues\gidNumber, which has a value.

My goal is to call it only from the Synchronization Editor.

I created a new property (script property) and tried the following code to call it:

  • getconfigparam: Connection.GetConfigParm
  • sql: Connection.GetSingleProperty
  • Script Library: I tried something there as well.

However, I always encounter an error, even when I try adding imports.

I think that what I tried might not be possible.

I went through some documentation but didn’t find anything useful.

Is there a way to do this from the Synchronization Editor?

The goal is to get the value from a config parameter without using a column.

Thanks

  • Hi,

    These are my notes on this:

    Create a sync project scripted variable that gets it's value from a config parm

    Create a variable then use the convert button - looks like a scroll of paper.

     Now click 'Edit'

    The script code looks like this:

    Dim Test As String = args.QueryDatabase(Connection.SystemQuery _

                                    .From("DialogConfigParm") _

                                    .Select("Value") _

                                    .Filter("Fullpath='Custom\Test'")) _

                                    .Result.First.GetValue("Value").AsString

    return Test

    Or:

    return args.QueryDatabase(Connection.SystemQuery.From("DialogConfigParm").Select("Value").Filter("Fullpath='<Fullpath to ConfigParm>'")).Result.First.GetValue("Value").AsString

    This gets the value from the config parm and puts it in the sync project variable - at startup.

    Then in a scripted vrt attribute you can do this for example:

    Dim Test As String = VariableSet("Test")        'gets the value from the variable Test

    If Test.ToUpperInvariant.Contains($somecolumn$.ToUpperInvariant.ToString) Then

                return true

    Else

                return false

    End If

    Or in a scripted property the code would look like this.

    Imports VI.Projector.Connection Dim configparm = SystemObject.Connection.QueryObject(SystemQuery _ .From("DialogConfigParm") _ .Select("Value") _ .Filter("Fullpath='<Fullpath to ConfigParm>'") _ ).Result.First.GetValue("Value").AsString Return configparm 

    In this case you would need to 'stick' DialogConfigParm in the shrink schema process or you'll get an error.

    HTH, Barry.