1. Hiding button Delete in record detail

    Artikel: AN0002457Aktualisiert: 27.04.2021
    Die vorgegebene Sprachenversion vom Artikeltext wird angezeigt, weil es kein Text von der ausgewählten Sprache und Version gibt.

    In order to hide button Delete in a record detail set the property OGEditOptions.EnabledDelete in the script for record detail (tab Scripts in the detail of the given class).

    Following example hides button Delete except for cases where the user has role it-architect or when user created the record and column release_approver is not filled in.

    function OnAfterBinding()
    {
      if (!OG.IsNull(OGDataRowId))
      {
        var dr = OG.DataRow.GetDataById(OGClassDef.Id, OGDataRowId);

        OGEditOptions.EnabledDelete =
          dr['creator'] == OG.Person.GetLoginPerson().Account & dr['release_approver'] =='' ||
          OG.Person.IsUserInRoleByCode('it-architect');
      }
    }

     

×