how to change the object table from code

snyktpsnyktp Member Posts: 75
Hi All,

Do you have any idea if it’s possible to change the object table from code? I want to change version list from code...

Thank you

Answers

  • ouredpouredp Member Posts: 56
    Hello,

    I´ve already done something similar for a version check.

    Just declare the Object Table in the variable of the Report/Code Unit or Form.

    Name DataType Subtype
    Objectrec Record Object

    Variable is "Version List"
  • snyktpsnyktp Member Posts: 75
    Hello,

    This is my code;


    InputText := '';
    Window.OPEN('Enter new version text : ####1######',InputText);
    Window.INPUT(1,InputText);

    IF ObjectTbl.GET(Type,"Company Name",ID) AND (InputText <>'')THEN BEGIN
    ObjectTbl."Version List" := InputText;
    ObjectTbl.MODIFY;
    END;


    When I run this ,I get an error message. You can see it the attachement.
    Thank you
  • prabhupdeshprabhupdesh Member Posts: 49
    i think you will not be able to modify the object table in this way.
  • snyktpsnyktp Member Posts: 75
    I closed the Navision .Then I opened it. It works. Anyway there isnt any problem in my code

    Thank you all
  • kinekine Member Posts: 12,562
    The problem was, that you can change the data for Table type but not for TableData type. TableData means data in table which have no Version List etc...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • afarrafarr Member Posts: 287
    Thanks. This is exactly the information that I needed just now.
    Alastair Farrugia
Sign In or Register to comment.