modify ledger entry

moff2moff2 Member Posts: 9
edited 2015-06-10 in NAV Three Tier
hi all
I just curious
as long as my experience in NAV, using customer license , we can't modify posted table (e.g : Cust ledger entry)
but yesterday I discussed, someone said that several fields in cust ledger entry can be modified. such as : Due date
can someone enlighten me about this?
whatever suggestion and opinion

Thanks before

Comments

  • jglathejglathe Member Posts: 639
    Hi,

    there is a codeunit for this. "Cust. Entry - Edit". It has the permissions to do so. You can't edit it with a customer license, though.

    with best regards

    Jens
  • moff2moff2 Member Posts: 9
    jglathe wrote:
    Hi,

    there is a codeunit for this. "Cust. Entry - Edit". It has the permissions to do so. You can't edit it with a customer license, though.

    with best regards

    Jens

    hi jens,
    do you mean change this code?
    or change permission properties?
    thanks
    CustLedgEntry := Rec;
    CustLedgEntry.LOCKTABLE;
    CustLedgEntry.FIND;
    CustLedgEntry."On Hold" := "On Hold";
    CustLedgEntry."Hold LPI" := "Hold LPI";
    IF CustLedgEntry.Open THEN BEGIN
      CustLedgEntry."Due Date" := "Due Date";
      DtldCustLedgEntry.SETCURRENTKEY("Cust. Ledger Entry No.");
      DtldCustLedgEntry.SETRANGE("Cust. Ledger Entry No.",CustLedgEntry."Entry No.");
      DtldCustLedgEntry.MODIFYALL("Initial Entry Due Date","Due Date");
      CustLedgEntry."Pmt. Discount Date" := "Pmt. Discount Date";
      CustLedgEntry."Applies-to ID" := "Applies-to ID";
      CustLedgEntry.VALIDATE("Remaining Pmt. Disc. Possible","Remaining Pmt. Disc. Possible");
      CustLedgEntry."Pmt. Disc. Tolerance Date" := "Pmt. Disc. Tolerance Date";
      CustLedgEntry.VALIDATE("Max. Payment Tolerance","Max. Payment Tolerance");
      CustLedgEntry.VALIDATE("Accepted Payment Tolerance","Accepted Payment Tolerance");
      CustLedgEntry.VALIDATE("Accepted Pmt. Disc. Tolerance","Accepted Pmt. Disc. Tolerance");
      CustLedgEntry.VALIDATE("Amount to Apply","Amount to Apply");
      CustLedgEntry.VALIDATE("Applying Entry","Applying Entry");
    END;
    CustLedgEntry.MODIFY;
    Rec := CustLedgEntry;
    
  • jglathejglathe Member Posts: 639
    Hi moff2,

    you can't change the object with a customer license. Or most customer licenses, to be more precise. If the customer license has the "C/AL" granule, you can.

    with best regards

    Jens
  • moff2moff2 Member Posts: 9
    jglathe wrote:
    Hi moff2,

    you can't change the object with a customer license. Or most customer licenses, to be more precise. If the customer license has the "C/AL" granule, you can.

    with best regards

    Jens

    Jens,
    understand.
    but according to this code which is this part
    IF CustLedgEntry.Open THEN BEGIN
      CustLedgEntry."Due Date" := "Due Date";
    
    I should allow to change Due Date in this table if open = yes
    I tried but also there is an error message "you dont have the following permission on table data cust ledger entry : modify"
  • jglathejglathe Member Posts: 639
    Hi moff2,

    The code is correct. The codeunit has the permission to modify the customer ledger entry. Code in this codeunit will have the rights to do it (or anything else regarding this table, within the rights).

    with best regards

    Jens
  • moff2moff2 Member Posts: 9
    I tried the standard one
    use On Hold field
    CustLedgEntry."On Hold" := "On Hold";
    

    I cant modify it
  • satbirsatbir Member Posts: 33
    You also need permission to modify cust. ledger entry table.
  • bbrownbbrown Member Posts: 3,268
    satbir wrote:
    You also need permission to modify cust. ledger entry table.

    The object is what needs the permission to modify the object. The user is only granted "Indirect" permission.
    There are no bugs - only undocumented features.
  • moff2moff2 Member Posts: 9
    bbrown wrote:
    satbir wrote:
    You also need permission to modify cust. ledger entry table.

    The object is what needs the permission to modify the object. The user is only granted "Indirect" permission.

    does it means only from posting routines?
    if it is so.. lets say i post invoice, now this record already in cust ledger entry
    now i want to change this due date
    how do i do that?
  • bbrownbbrown Member Posts: 3,268
    moff2 wrote:
    bbrown wrote:
    satbir wrote:
    You also need permission to modify cust. ledger entry table.

    The object is what needs the permission to modify the object. The user is only granted "Indirect" permission.

    does it means only from posting routines?
    if it is so.. lets say i post invoice, now this record already in cust ledger entry
    now i want to change this due date
    how do i do that?

    Any object that needs to execute CRUD commands against a protected table would require these permissions.
    There are no bugs - only undocumented features.
Sign In or Register to comment.