Is it possible to mark object by code?

SolmyrSolmyr Member Posts: 51
if I run such code:
Object@1000 : Record 2000000001;

Object.SETRANGE(Type,Object.Type::Form);
Object.SETRANGE(ID,90000);
Object.FINDFIRST;
Object.MARK(TRUE);
Object.Modified := FALSE;
Object.MODIFY;

the Form 90000 will have modified flag set to "No" but won't be marked in object designer. is it possible to mark objects by code? maybe with some additional automation?
I found this post, the "report to mark all licensed objects" looks like what I'm looking for, but link is dead...
Oleg Dovgalenko

Comments

  • DaveTDaveT Member Posts: 1,039
    Hi Solmyr,

    You will not be able to mark them is the object designer form but you can create a seperate list form of you own. What are you tring to acheive?
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • ara3nara3n Member Posts: 9,256
    If you are want to do it in object designer, you can create a filter and display that filter.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • SolmyrSolmyr Member Posts: 51
    DaveT wrote:
    What are you tring to acheive?
    Hi,
    I have a text file with NAV objects. the aim is mark the objects which are in the text file in the object designer. I've done it before through setting modified flag to true, then adding filter Modified = Yes. but now it's not applicable, because I have to save modified state as it was. of course I can set date or time to some unique value and add filter, but it would be nice to use marks.
    Oleg Dovgalenko
  • ara3nara3n Member Posts: 9,256
    you can use the compile field
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Timo_LässerTimo_Lässer Member Posts: 481
    Or use the "Version List".

    I have created some reports, which mark objects based on...
    ... objects in a fob/fbk file
    ... objects in a txt file (NAV Compare Tool required)
    ... text files in a folder of your file system
    ... object list in an Excel Sheet (based on copy/paste from Object Designer or Import Worksheet)

    With this reports you can choose, how you want to mark the objects:
    - Set Modify flag
    - Set Date
    - Set Time
    - Add a char at the beginning of the Version List

    The website is in german but the downloadable objects include DEU and ENU language.
    Timo Lässer
    Microsoft Dynamics NAV Developer since 1997
    MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
  • SolmyrSolmyr Member Posts: 51
    I've found easy solution to mark objects by code. It can be achieved via WinShell automation.
    Simple function to mark particular object:
    Parameters:
    Var	Name	  DataType	Subtype	Length
    No	pType  Option	        		
    No	pID	  Integer   
    
    Locals:
    Name	        DataType	Subtype	Length
    Counter	Integer		
    StrNo	        Text		                50
    
    CREATE(lvWinShell);          		
    lvWinShell.SendKeys('+{F12}');
    CASE pType OF
      pType::Table:
        lvWinShell.SendKeys('%b');
      pType::Form:
        lvWinShell.SendKeys('%m');
      pType::Report:
        lvWinShell.SendKeys('%p');
      pType::Dataport:
        lvWinShell.SendKeys('%o');
      pType::Codeunit:
        lvWinShell.SendKeys('%c');
    END;
    lvWinShell.SendKeys('{LEFT}');
    lvWinShell.SendKeys('{LEFT}');
    lvWinShell.SendKeys('{LEFT}');
    lvWinShell.SendKeys('{LEFT}');
    lvWinShell.SendKeys('{LEFT}');
    lvWinShell.SendKeys('{LEFT}');
    lvWinShell.SendKeys('{RIGHT}');
    lvWinShell.SendKeys('^F');
    StrNo := FORMAT(pID);
    FOR Counter := 1 TO STRLEN(StrNo) DO
      lvWinShell.SendKeys(FORMAT(StrNo[Counter]));
    lvWinShell.SendKeys('{ENTER}');
    lvWinShell.SendKeys('^{F1}');
    CLEAR(lvWinShell);
    
    It's not the best way but it works :)
    Oleg Dovgalenko
  • androjdazandrojdaz Member Posts: 20
    Solmyr wrote:
    if I run such code:
    Object@1000 : Record 2000000001;
    
    Object.SETRANGE(Type,Object.Type::Form);
    Object.SETRANGE(ID,90000);
    Object.FINDFIRST;
    Object.MARK(TRUE);
    Object.Modified := FALSE;
    Object.MODIFY;
    

    the Form 90000 will have modified flag set to "No" but won't be marked in object designer. is it possible to mark objects by code? maybe with some additional automation?
    I found this post, the "report to mark all licensed objects" looks like what I'm looking for, but link is dead...
    Remove Modified flag from all table objects:

    Object.RESET;
    Object.SETRANGE(Type, Object.Type::Table);
    Object.MODIFYALL(Modified, FALSE, TRUE);
    That's what she said!
Sign In or Register to comment.