AL icon indicating copy to clipboard operation
AL copied to clipboard

Adding a new fieldgorup in base table

Open carlosyuwono opened this issue 7 years ago • 10 comments

When trying to add brick fieldgroup to a base table that does not have an existing fieldgroup, the compiler is throwing an error "The FieldGroup 'Brick' is not found in the target."

When testing an a table with an default brick field group ie. customer table , I am not getting the error.

Here is my code

tableextension 50001 "MyItemCrossReference" extends "Item Cross Reference" { fieldgroups {

    addlast(Brick; "Cross-Reference No.")
    {
    }
}

}

  • AL Langauge: 2.1.79379
  • Business Central: CA Dynamics NAV 13.3 (27233)

carlosyuwono avatar Jan 29 '19 07:01 carlosyuwono

Hi @carlosyuwono, thank you for reporting the issue. In a table extension object the addlast keyword is used to add new fields to the existing fieldgroup, defined for the table object. It is not possible to create new field group in a table extension object. For more information regarding fieldgroups please refer the doc: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-field-groups

AndreyKorepanov avatar Jan 29 '19 10:01 AndreyKorepanov

will this feature be added on the future release ?

carlosyuwono avatar Jan 29 '19 14:01 carlosyuwono

@carlosyuwono, I do not think so, this feature is not on our task pool.

AndreyKorepanov avatar Jan 29 '19 15:01 AndreyKorepanov

AndreyKorepanov, about "It is not possible to create new field group in a table extension object." - I open the link which you sent and can read "A field group in table or table extension objects defines the fields to display in a drop-down control on pages that use the table and fields that display when these pages are shown in the tile view."

  1. based on the information from this page I wrote:
tableextension 23071641 "PaymentMethodExt" extends "Payment Method"
{
    fields
    {
        field(23071641; "Export Payment Method"; Code[10]) { }
    }

    fieldgroups
    {
        fieldgroup(Dropdown; "Export Payment Method") { }
        addlast(Brick; "Export Payment Method") { }
    }
}

and VSC shows me the error in line "fieldgroups": "Syntax error, '}' expected [AL0104] (13,5)"

  1. I delete the line "fieldgroup(Dropdown; "Export Payment Method") {}" and we have 1 line with "addlast(Brick; "Export Payment Method") {} " only, but an error the same. And again, based on info from page I just want to extend current fieldgroup Brick (not add, but extend), which you can see for table "Payment Method". But I received an error "The FieldGroup 'Brick' is not found in the target." additionally!
  • 1 more line with long list of objects+[AL0198] (13,5)"

Example from "your page":

tableextension 50100 CustomerExercise extends Customer
{
    fields
    {
        field(50100); "V02Max"; Decimal) { }
    }
   
    fieldgroups
    {
        addlast(DropDown; V02Max) { }
    }
}

### what is wrong with either my code, or VSC or MS Doc?

RedFoxUA avatar Jan 31 '19 21:01 RedFoxUA

I do not think so, this feature is not on our task pool.

Could you explain the point - is the functionality which we can read on official MS pages is "out of scope"? May be your team do not want to fix this REAL BUG?

RedFoxUA avatar Jan 31 '19 21:01 RedFoxUA

Tagging issue #4393 In this, as they're related. Either would be a solution.

JeremyVyska avatar Apr 08 '19 08:04 JeremyVyska

@AndreyKorepanov why is this ticket closed? we need this. How do we re-open this ticket please ?

It's not even an enhancement. this is something that was possible before, so it is a bug/lack of basic functionality.

AbsolutelyFreeWeb avatar Jun 13 '19 22:06 AbsolutelyFreeWeb

@AndreyKorepanov why is this ticket closed? we need this. How do we re-open this ticket please ?

It's not even an enhancement. this is something that was possible before, so it is a bug/lack of basic functionality.

We also need this. There are a lot of tables even in the Base App that do not have the FieldGroup.

miljance avatar Mar 24 '20 13:03 miljance

HI I agree this should be available to create new FieldGroups in AL extensions. When can we expect it?

ghost avatar Mar 24 '20 13:03 ghost

Just spent 15 minutes setting up a page/lookup combination to get around what should have been a 2 minute mod.

eric-silverw-com avatar Apr 16 '20 01:04 eric-silverw-com