QPR Knowledge Base

Change Persons in Charge for Certain Elements

Hide Navigation Pane

Change Persons in Charge for Certain Elements

Previous topic Next topic No expanding text in this topic  

Change Persons in Charge for Certain Elements

Previous topic Next topic JavaScript is required for expanding text Mail us feedback on this topic!  

Comments (...)

<QPR_SCRIPT_FILE language = vbscript>

Option Explicit

 

Sub Main()

 

 Dim oModel

 Dim SCError

 

   SCError=SCApplication.Authenticate("qpr", "demo","")

   IF SCError <> 0 then Exit Sub 'SCApplication.GetErrorMessage(SCError) could be called

   SCError=SCApplication.OpenModel("Dentorex Group Scorecard", oModel)

   if SCError <> 0 then Exit Sub

 

 Dim Elements 'array of name, id, symbol, scId, scsymbol

 Dim InCharge

 Dim I

 

   SCError=oModel.GetElements("ELEMENT", Elements)

   if SCError <> 0 then Exit Sub

   For I = Lbound(Elements,2) + 1 to Ubound(Elements,2) 'first row has headers

 

     SCError=oModel.GetProperty(Elements(I,1), "InCharge", InCharge)

     If SCError <> 0 then Exit For

     If InCharge="John Smith" then

       SCError=oModel.SetProperty(Elements(I,1), "InCharge", 1) 'User ID must be used here

       If SCError <> 0 then Exit For

     End If

   Next

 

End Sub

Comments (...)