5 Replies Latest reply on Nov 25, 2015 7:59 AM by Tiger Ken

    SetVar from API

    Tiger Ken

      try

      {

          IEdmVault7 vault2 = null;

          if (vault1 == null)

          {

            vault1 = new EdmVault5();

          }

           vault2 = (IEdmVault7)vault1;

          if (!vault1.IsLoggedIn)

          {

             vault1.LoginAuto(VaultsComboBox.Text, this.Handle.ToInt32());

          }

          IEdmFile5 aFile = default(IEdmFile5);

          IEdmFolder5 ppoRetParentFolder = null;

          aFile = vault2.GetFileFromPath(ListBox.Items[0].ToString(), out ppoRetParentFolder);

          if (!aFile.IsLocked)

          {

              aFile.LockFile(ppoRetParentFolder.ID, this.Handle.ToInt32());

                  IEdmEnumeratorVariable5 varEnum = default(IEdmEnumeratorVariable5);

              string aFileName=null;

              varEnum = aFile.GetEnumeratorVariable(aFileName);

              varEnum.SetVar("Vendor", "@", "John");

              IEdmEnumeratorVariable8 enumVariable8 = (IEdmEnumeratorVariable8)varEnum;

              enumVariable8.CloseFile(true);

              aFile.UndoLockFile(this.Handle.ToInt32());

              MessageBox.Show("SetVar Success");

              }

      }

      EPDM Version 2014,  Variable Name -->Vendor , I want to change card value -->John,

      but new data don't update to card variable, Please Help. thank you.