zoukankan      html  css  js  c++  java
  • Rename primary key by code

    Way 1:

    static void CustAccountRename(Args _args)
    {
      CustTable custTable;
      ;
    
      select firstOnly custTable
        where custTable.AccountNum == '1103';
      if (custTable.RecId)
      {
        custTable.AccountNum = '1103_';
        custTable.renamePrimaryKey();
      }
    }

    Way 2:

     1 void renamePrimaryKey(Common _common)
     2 {
     3     Common     common;
     4     FieldId    fieldId;
     5     DictTable  dictTable;
     6     DictField  dictField;
     7     ;
     8     common = _common;
     9     dictTable = new SysDictTable(common.TableId);
    10     dictField = new SysDictField(dictTable.id(), dictTable.primaryKeyField());
    11 
    12     if (isConfigurationkeyEnabled(configurationkeynum(SIG)))
    13     {
    14         SIGBaseDocument::checkAndCacheRename(common,dictField.id(),newValue);
    15     }
    16 
    17     startLengthyOperation();
    18     fieldId = dictField.id();
    19     try
    20     {
    21         ttsbegin;
    22         // CC Start
    23         CCPrimaryKey::renamePrimaryKey(common, dialogField.value(), fieldId);
    24         // CC End
    25 
    26         common.(fieldId) = dialogField.value();
    27 
    28         common.renamePrimaryKey();
    29         if (common.TableId == tablenum(UserInfo))
    30         {
    31             common.update();
    32         }
    33         ttscommit;
    34     }
    35     catch (Exception::Error)
    36     {
    37         ttsabort;
    38     }
    39 }
  • 相关阅读:
    xx
    office 2016 下载链接
    Revit 2019 下载链接
    AE cc 2019 下载链接
    Premiere Pro cc 2019 下载链接
    Photoshop cc 2019 下载链接
    百度云单机版、软件包及教程
    Visual Studio 2017 软件包及教程
    归并排序:逆序对问题
    归并排序:小和问题
  • 原文地址:https://www.cnblogs.com/Jinnchu/p/2659699.html
Copyright © 2011-2022 走看看