Options

Keys

manishgoyalmanishgoyal Member Posts: 52
Can we activate or deactivate keys by coding????
Manish Goyal

Comments

  • Options
    chengalasettyvsraochengalasettyvsrao Member Posts: 711
    I want to say NO.
  • Options
    AlbertvhAlbertvh Member Posts: 516
    Hi,
    You could try setting key groups and then use
    KEYGROUPDISABLE Function
    KEYGROUPENABLED Function
    Check the online help.
  • Options
    manishgoyalmanishgoyal Member Posts: 52
    no i just want to know can be activate/ deactivate keys using C/AL.
    Manish Goyal
  • Options
    AlbertvhAlbertvh Member Posts: 516
    If you don't use keygroups then the answer is No

    If you set a keygroup on let say the customer table
    Enabled	Key		         KeyGroups
    Yes	VAT Registration No        VAT
    
    in C/AL
    Customer.KEYGROUPENABLE(VAT);
    
  • Options
    ssinglassingla Member Posts: 2,973
    no i just want to know can be activate/ deactivate keys using C/AL.

    The basic question is : Why are u trying to do this?
    CA Sandeep Singla
    http://ssdynamics.co.in
  • Options
    Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    Yes, you can manipulate keys from C/AL code. Without using key groups and KEYGROUPENABLE or KEYGROUPDISABLE functions.

    Regards,
    Slawek
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • Options
    matteo_montanarimatteo_montanari Member Posts: 189
    Yes, you can manipulate keys from C/AL code. Without using key groups and KEYGROUPENABLE or KEYGROUPDISABLE functions.

    Regards,
    Slawek

    Hi

    A little example:

    KeyRec is a record of table "Key"
    KeyRec.SETRANGE(TableNo,18);
    KeyRec.FINDLAST;
    KeyRec.Enabled := TRUE;
    KeyRec.MODIFY;
    

    This example enable the last key of table "Customer".
    I think it require table designer granule (if this code is executed with a customer nav license...)

    Bye

    Matteo
    Reno Sistemi Navision Developer
Sign In or Register to comment.