• Set agent "On behalf of" automatically during installation

    By Nick Radov 2 decades ago

    One of the installation steps is to go through all the agents and manually set the "On behalf of" property. It would be nice to automate this. Does anyone know how to change that property using LotusScript?

    • RE: Set agent "On behalf of" automatically during installation

      By Alexander Khokhlov 2 decades ago

      in the mCopyDesignElementsToDatabase procedure line 113:



      ndoAgent.CopyToDatabase rndbTarget



      change to


      Set dstAgent = ndoAgent.CopyToDatabase(rndbTarget)<br/>
      



      and add following code:


      If Not dstAgent Is Nothing Then<br/>
          Call dstAgent.ReplaceItemValue(&quot;$OnBehalfOf&quot;,rndbTarget.Server)<br/>
          Call dstAgent.Save(True,False,True)<br/>
      End If<br/>
      

      You must declare dstAgent variable as NotesDocument of course



      In addition in line 18 (same procedure) produced error "Type mismatch"

      Help section of "Instr" sad: "If you specify compMethod, you must specify begin as well."

      So, thees line must be



      If Instr(1, ndoScriptLibrary.GetItemValue(mstrTitleItemName)(0), "SpamAssassin", 1) > 0 Then



      instedad of



      If Instr(ndoScriptLibrary.GetItemValue(mstrTitleItemName)(0), "SpamAssassin", 1) > 0 Then

      • Not Working :(

        By Josef Novak 2 decades ago

        If I set the property "Run on behalf of" with the method ReplaceItemValue, the agent will be corrupted :(



        If I want to open the agent with Lotus Designer, this messagebox appears:



        "This agent contains an illegally added 'On behalf' attribute. To make the agent valid, please remove it."



        I tried to sign the field $OnBehalfOf, but without success :(



        Is there other way to programatically set this field of agent?



        Thank you very much for your response.