Use a Query Object if you have an urge for SQL in Business Central

Поділитися
Вставка
  • Опубліковано 31 січ 2025

КОМЕНТАРІ • 42

  • @arpadozsvar2129
    @arpadozsvar2129 2 роки тому +1

    Hej Erik, Thanks for your great videos which are sometimes also funny to watch. Thanks. Because you mentioned: pls make for us a video on partial records. Thanks!

  • @weinicht1953
    @weinicht1953 2 роки тому

    Loving your videos and the amount of tabs in your browser. Feeling right at Home 😅
    Thanks for your efforts, really helpful stuff!
    You just earned another sub ;)

  • @Mahmoudalgindy
    @Mahmoudalgindy 2 роки тому +1

    Thanks a lot Erik, even before watching, please make for us a video on partial records. Thanks!

  • @nickblackburn6543
    @nickblackburn6543 2 роки тому +2

    Hey Eric,
    Top man, excellent channel, thanks for sharing your knowledge.
    Please can you do a video on partial records?
    Thanks,

  • @lmsf_data-ip9gg
    @lmsf_data-ip9gg 5 місяців тому

    This is a great intro video, but is there also a way to add functionality to a query object to return all data for all companies? Not just the context you are in at the moment? I've seen CHatGPT suggest the use of DataScope=AllCompanies, but would this be able to be used in a query?

  • @tarekdemiati9991
    @tarekdemiati9991 4 місяці тому

    Great content as usual.
    I would have love to be able to use RecordRef and FieldRef inside a query, so I was wondering if it's possible to generate a query object in the fly as a text object and then execute it ?

  • @prebenborg
    @prebenborg 2 роки тому +1

    Very interesting. I met my first query challenge this week. I need to extend “Calc. Warehouse adjustment” that’s build on a query. But now I need to extend the standard bc query with a reason code field. But is that even possible? Has MS burned a bridge here?

    • @Hougaard
      @Hougaard  2 роки тому +2

      You cannot do that, there's no query extension object..

  • @plymouthfop
    @plymouthfop Рік тому

    In a Record you can use FilterGroup(-1) for an OR filter.. aka cross field filter. I need to do the same in a query.. how do I say filter (Field1 = true OR Field2 = true)?

  • @jerrycic7866
    @jerrycic7866 Рік тому

    Thank You Sir! Is there a way to implement "Cross Apply"? for example I just want to retrieve the first row from a secondary table ordered by some date column. I am trying to convert all my stored procedures and SQL views to work similarly when we migrate to the BC 365 cloud from on prem Nav.

  • @bunnyjsb
    @bunnyjsb 2 роки тому

    Hi @eric can we have any video related to performance tool kit extension or BCPT Suite

  • @ExcelObianyiscoarts
    @ExcelObianyiscoarts Місяць тому

    Hi Erik. Is there a way we can use the query to update a record in another table? So after opening the query and we select a record, can we use that record to update another table?

  • @kf5ydu
    @kf5ydu Рік тому

    Hi Erik,
    As always your videos are incredible. I was wondering if there is a way to do something similar to a union in sql, where you can combine multiple similar datasets. An example would be a combined list of sales invoice and credit memo lines. I’m thinking the only way to do this might be some sort of conditional join on the item ledger based on the document number series if that is possible?

    • @Hougaard
      @Hougaard  Рік тому +1

      From Customer Ledger Entries would probably be best.

  • @YRALPROGRAMMERWOMAN
    @YRALPROGRAMMERWOMAN 2 роки тому

    Hello Erick
    One question is that I need to make a range in a query that only shows me a range of specific rows. For example, I need it to show me from 1 to 20,000 and from 20,000 to 4,000. The range must be with the rows. thank you very much for your help

    • @Hougaard
      @Hougaard  2 роки тому

      You can set filters on the elements.

  • @brianhubbard251
    @brianhubbard251 Рік тому

    Hi Erik, Have you tried adding an extension column to a query at version 23? It's busted.

  • @sureshbhat6937
    @sureshbhat6937 2 роки тому

    Hey Erik -
    Is there any way to see the resulting SQL statement for the above query, what I mean is SELECT SH FIELDS ... and so on anywhere in AL or any other place where it stores the SQL statement.

  • @navnav3134
    @navnav3134 2 роки тому

    Dear Eric,
    Is there any method to get the company logo and add it to the email body?
    For example: when you make a video on send attachements by email, we need also to add company logo in the email body.
    Best Regards,
    Nav

    • @Hougaard
      @Hougaard  2 роки тому +1

      Embed the image bits in the src parameter

    • @navnav3134
      @navnav3134 2 роки тому

      Dear @@Hougaard As you know in business central, if we use embed src img file we need to put the path of the image which is saved on the server, but what if the user try to send the email from his own side. the picture will not appear since it is saved on the server.
      Any idea how to solve this issue?
      For email: I am using Email Item record.
      Best Regards,
      Nav

    • @Hougaard
      @Hougaard  2 роки тому +1

      @@navnav3134 no, you can embed base64 image in the src parameter

  • @dmichalopoulos4239
    @dmichalopoulos4239 4 місяці тому

    Query object needs Work from microsoft , they blocked access to SQL and we cant even union or distinct and many other sql features when will microsoft update that object?!

    • @Hougaard
      @Hougaard  4 місяці тому

      What work are you missing?

  • @spidione1
    @spidione1 2 роки тому

    Right /left join doesn't have same behavior as t sql
    Does this have been fixed in latest version?

    • @mauriciovillatoro9361
      @mauriciovillatoro9361 2 роки тому

      I am having the same issue.

    • @doffo748
      @doffo748 Рік тому

      I have the same issue. LeftOuterJoin does not work. It keeps showing me only the records that are within my filter.

  • @nordniu2340
    @nordniu2340 2 роки тому

    Hi eric, thanks for your video. could you tell me the name of the al dev tools?

    • @Hougaard
      @Hougaard  2 роки тому

      That's the AZ AL Tools

  • @umarnaeem6128
    @umarnaeem6128 2 роки тому

    can we do a not exist join ?

    • @Hougaard
      @Hougaard  2 роки тому +1

      Here's your options: learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-sqljointype-property

  • @ara3n
    @ara3n 8 місяців тому

    The query objects needs to be redesigned. It was built with designer for non developer. MS needs to redesign it to write Linq queries. The current syntax / structure is horrible.

    • @Hougaard
      @Hougaard  8 місяців тому

      Why Linq? That has no place in the world of BC...

    • @ara3n
      @ara3n 8 місяців тому

      @@Hougaard I'm not sure what you mean. The goal linq and BC Query is to write a query. It's just one is easier/ faster to write than the other. For example
      var query = from header in salesHeaders
      join line in salesLines on header.OrderNo equals line.OrderNo
      select new
      {
      OrderNo = header.OrderNo, ItemNo = line.ItemNo, Quantity = line.Quantity
      };
      It's 4 lines of code