This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Pass base object of process into a script

 Is there a way to pass the base object of a process into a script. For example, with a base object of Department I could pass to a script $ShortName$ and that would give me the shortname in the script but I address quite a few variables on the department object so I would like to pass in the department and then look at the attributes from within the script so there aren't alot of parameters to pass in. I could pass the UID and then do a look up in the database but I think this would be expensive and this script would be called many times plus the department has already been loaded by the process. Is there a way to pass the base object of a process into a script parameter? If so, what's the object type that the function would need to receive as a parameter?

Parents
  • Hi

    No, objects cannot be passed from a process to a script. But what you can do is a DB snaphot and pass it to the script. It contains all informations of the current object:

    Value = New SingleDbObjectSnapshot(Base).ToXmlString(True)

    And that's the way how you can acces the data within your script:

    Public Sub CCC_MyScriptDoSomething(ByVal dbObjectXml As String)
        Dim dbsnap As SingleDbObjectSnapshot = SingleDbObjectSnapshot.FromXml(dbObjectXml)
    	Dim objectData As String = dbsnap.GetValue("objectData").String
    	...
    	...
    	...
    End Sub

    Hope that will help you!

    -
    Regards
    Sven

Reply
  • Hi

    No, objects cannot be passed from a process to a script. But what you can do is a DB snaphot and pass it to the script. It contains all informations of the current object:

    Value = New SingleDbObjectSnapshot(Base).ToXmlString(True)

    And that's the way how you can acces the data within your script:

    Public Sub CCC_MyScriptDoSomething(ByVal dbObjectXml As String)
        Dim dbsnap As SingleDbObjectSnapshot = SingleDbObjectSnapshot.FromXml(dbObjectXml)
    	Dim objectData As String = dbsnap.GetValue("objectData").String
    	...
    	...
    	...
    End Sub

    Hope that will help you!

    -
    Regards
    Sven

Children
No Data