How to make my life easier?

zeninolegzeninoleg Member Posts: 236
Hi, everybody
I have a question. When I use C/AL Symbol Menu I do not want Navision to insert the record name, I want only a Field Name.
For instance, when I write SalesHeader.SETRANGE and I want to select a field to put in brackets I do not want to happen following SalesHeader.SETRANGE(SalesHeader."No."... I want SalesHeader.SETRANGE("No."...
Now I just delet the Record name after the insertion, but I am lazzzzzy!
Is there a hotkey that I have to press to insert just the field name?

Well, I guess the more you work the lazier you get!
Best Regards,
Oleg

Comments

  • SteveOSteveO Member Posts: 164
    You can use the Symbol List before you even type SETRANGE.

    eg.

    press F5 and choose SalesHeader."No."
    Put the cursor after the . and type SETRANGE(

    I don't know if it is any quicker, put that's the order I've always done it in 8)
    This isn't a signature, I type this at the bottom of every message
  • zeninolegzeninoleg Member Posts: 236
    Yep, that is what I do now, but this does not work for the typing field name for the AfterGetRecord trigger(or any other dataitem triggers in the report) or for the
    WITH SalesHeader DO BEGIN
    ..
    END;
    :-k
    Best Regards,
    Oleg
  • DenSterDenSter Member Posts: 8,307
    So don't type WITH SalesHeader DO BEGIN and use the symbol menu for all the fields, that will save you the typing of the WITH statement, and it will make your life a lot easier so you don't have to delete those pesky record variable names :)
  • zeninolegzeninoleg Member Posts: 236
    I LIKE THAT!
    :lol::lol::lol::lol::lol::lol::lol::lol::lol::lol::lol::lol:
    Best Regards,
    Oleg
  • DenSterDenSter Member Posts: 8,307
  • Alex_ChowAlex_Chow Member Posts: 5,063
    DenSter wrote:
    So don't type WITH SalesHeader DO BEGIN and use the symbol menu for all the fields, that will save you the typing of the WITH statement, and it will make your life a lot easier so you don't have to delete those pesky record variable names :)

    Yeah, but this (to me) makes the code looks really messy..

    Just an opinion... moving along... :whistle:
  • kinekine Member Posts: 12,562
    Yeah, but this (to me) makes the code looks really messy..

    For me the code with WITH statement is much more unreadable than without it, and in many cases, when you use WITH, you have troubles with mixing fields from Rec, from record variable used in WITH and global and local variables (if you use same names... :-). When you look into code, you do not need to jump to the beginning to know, from which record you are using the values... ;-)

    Of course, this is just my opinion and I know, that others are using that and it is better for them... 8)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • DenSterDenSter Member Posts: 8,307
    I HATE the WITH statement, especially when the code is more than one page. I much more prefer to have the variable name right with the field name, that is much easier for me to read.
Sign In or Register to comment.