Use RecordRefs to create a Search App in Business Central

Поделиться
HTML-код
  • Опубликовано: 12 ноя 2024

Комментарии • 18

  • @DarrenBezzant
    @DarrenBezzant 4 года назад

    Thanks, Erik for this - It really clarifies how to use all the various Ref logic!

  •  4 года назад +1

    Great video Erik, as allways.
    I really like your videos, they are very instructive, easy going and kind of fun.
    I'm a keen of recordref and I use then a lot.
    In Visual Code, dislike C/Al, you do not need KeyRef nor FiledRef to access to key, filters, data, etc.
    I find this new way clearer and easier.
    You can do this:
    if xlRecordRef.KeyIndex(1).FieldCount 1 then
    or
    xlRecordRef.FieldIndex().SetRange(SearchText);
    and stuff like that.
    I like this way..
    Ta Erik. Keep on like this, and congratulations

    • @Hougaard
      @Hougaard  4 года назад

      Yes, you can dot together functions i AL, but from an educational perspective, it's easier to explain when actually creating the types.
      Thanks for your comment!

  • @ercanismail3893
    @ercanismail3893 4 года назад

    Great video as always. I only understood about 10% of it but I'm keen to learn more. Can't wait for the next video and thanks for sharing your knowledge

    • @Hougaard
      @Hougaard  4 года назад +1

      The concepts of RecordRefs take a few cycle to understand for people who has only worked with C/AL or AL, it's more related to C/C++ style of programming.

  • @hicamajig
    @hicamajig 4 года назад

    Using your base code and process described in the video I managed to get a version of full text working as well but it is a little rough around the edges. I look forward to the next episode to see your improvements.

  • @andreatarroni1148
    @andreatarroni1148 2 года назад

    Hi Erik,
    first of all I have to thank you for your wonderful work. I begin with AL about two years ago and I know nothing of this new language. I've learned thank to your video, I'm really gratefull to you.
    Now my question: inspired by this video I have create an app that can modify all fields of all table in the database. My app work perfectly when I use the developer license, but when I try whith client license it fails saying that the user haven't the permission. I don't want to modify prohibited table like "g/l registry", but the normal table (like vat entry). The only way I know for doing the permission to object is to manually specify permissions directly, but it's very uncomfortable.
    I have tried with permissionset, but it fails, I don't know why.
    I use BC 19.

    • @Hougaard
      @Hougaard  2 года назад

      Yes, the only way is to add permission= in the object that's doing the modifications.... and it might be a long list. Remember to send a copy of that list to your CPA.

    • @andreatarroni1148
      @andreatarroni1148 2 года назад

      @@Hougaard Thank for the reply, this wil be a long long work, but someone has tom do it :)

  • @machanick
    @machanick 4 года назад

    Thanks - I have used recordrefs with C/AL, but not the other refs. AL is adding some great additional features - I just wish they would specify the earliest BC release for each one, for those of supporting multiple on premise customers.

    • @Hougaard
      @Hougaard  4 года назад

      Everything I did in that video can be done in all versions of NAV since 2009

    • @machanick
      @machanick 4 года назад

      @@Hougaard I was thinking about the new additions to the language - specifically the text processing. I understand we can use one of the new features to replace temp tables.
      The feature you showed for automatic function creation - I did not catch your explanation - is this from a VS extension?

  • @TheDoubleH
    @TheDoubleH 4 года назад +1

    I would have used PageManagement to open the page.
    PageManagement.PageRun(RecordID);
    Granted, if You wanted to allow for a 'override' page to show, you can add the code you added.

    • @Hougaard
      @Hougaard  4 года назад

      Yeah, the page.run(0,rec) will grab a page assigned to the table, if any....

    • @TheDoubleH
      @TheDoubleH 4 года назад

      @@Hougaard True - However - page.run(0,rec) will run the list page, whereas PageManagement will run the Card page if the record is filled (which it is when using a RecordRef), or a list if you just have a filter

  • @bjarkihall2876
    @bjarkihall2876 4 года назад

    Hi, I asked MS about the undocumented Format(Rec) last year but no one has answered yet: github.com/MicrosoftDocs/dynamics365smb-devitpro-pb/issues/908
    I think this method no longer uses comma to separate (as I mentioned) but a TAB character, as you can see in the video. Since commas can be part of the field's value (but tab characters can't), replacing them would be destructive (non-reversible), which I guess is okay for this example but I thought I'd let you know!
    Spaces might also yield false positives when the results are found "between" two fields and you also might end up with a runtime error if the total string length is bigger than MAXSTRLEN and the order of the fields in the result of Format(Rec) is not yet clear to me either...and some might be skipped, like BLOBs and I don't know about flowfields.
    Thanks for the videos though, they're fun to watch and I wish I would've had these when I was starting out. :)

    • @Hougaard
      @Hougaard  4 года назад

      You're right, it was back in the old versions they returned with commas, guess that was a only auto-pilot thing :)
      Good catch!!