web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :

Liquid error: Value cannot be null. Parameter name: key  Profile Picture Liquid error: Value cannot be null. Parameter name: key Community member

Comments

*This post is locked for comments

  • Community Member Profile Picture Community Member
    Posted at

    Hi All

    We got the same requirement to edit the system fields,

    When i googled found your post and  it is very usefull.

    but however your logic  works till the execution(seen by debugging) only(records getting updated), once the execution is over those field values are changing back to the original values.

    if any one knows how to prevent this

    let me know.

    thanks in advance.

    Murali

  • Community Member Profile Picture Community Member
    Posted at

    You cannot update a system field once the record is been inserted in to table. You can only overwrite the values of system field at the time of insert only.

    Search the text "overwriteSystemfields(true);" in AOT, you would find that all standard code available is at the insertion only.

  • Community Member Profile Picture Community Member
    Posted at

    Hi Anonymous,

    Write your code in class and in the end add the below line

    "CodeAccessPermission::revertAssert();"

    and then set the class property "Run on -> Server".

    Then call the particular method from the job or anywhere else. It will not throw any error like "Request for the permission of type 'OverwriteSystemfieldsPermission' failed".

  • Community Member Profile Picture Community Member
    Posted at

    Dear Sasha

    i my code is below but do not updating created By

    ttsbegin;

                       New OverwriteSystemFieldsPermission().assert();

                       pmsTable.overwriteSystemfields(true);

                       pmsTable.ManagerId  = positionTable.ReportingPersonId();

                       pmsTable.ManagerName  = positionTable.ReportingPersonName();

                       pmsTable.(fieldnum(pmsTable,createdBy))  = SysCompanyUserInfo::emplId2UserId(positionTable.ReportingPersonId());

                       pmsTable.doUpdate();

                       pmsTable.overwriteSystemfields(false);

                       //pmsTable.update();

                       ttscommit;

                       CodeAccessPermission::revertAssert();

  • Community Member Profile Picture Community Member
    Posted at

    I've tried this on the LedgerJournalTrans table but got the following error even if I assert permission, any idea what I've done wrong? Request for the permission of type 'OverwriteSystemfieldsPermission' failed. (S)\Classes\OverwriteSystemfieldsPermission\demand (S)\Classes\xRecord\overwriteSystemfields

  • Community Member Profile Picture Community Member
    Posted at

    Pessoal, Saiu uma publicação que achei interessante no blog do Sasha onde mostra como subrescrever um