Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReportExtension prefixes not working in columns when ObjectNamePrefix contains a space #263

Open
deerware opened this issue Sep 5, 2022 · 6 comments

Comments

@deerware
Copy link

deerware commented Sep 5, 2022

Hi,

Our ObjectNamePrefix contains a space, because we need to distinguish our global and customer projects, our current settings are:

"CRS.ObjectNamePrefix": "ART CU ",
"CRS.OnSaveAlFileAction": "Rename",

A problem unfortunately comes with ReportExtensions, it does not format correctly when it comes to spaces.

column(ART_CU_Quote_SalesHeaderCaption; QuoteLbl) { }

becomes

column("ARTCU ART_CU_Quote_SalesHeaderCaption"; QuoteLbl) { }

I could understand that, but even if we were to use the ARTCU instead of ART_CU, it still doesn't work because it doesn't recognize it's own formatting and just loops around, and the name is changed with each save, like so:

// After 2nd save
column(ARTCUART_CU_Quote_SalesHeaderCaption; QuoteLbl) { }

// After 3rd save
column("ARTCU ARTCUART_CU_Quote_SalesHeaderCaption"; QuoteLbl) { }

// After 4th save
column(ARTCUARTCUART_CU_Quote_SalesHeaderCaption; QuoteLbl) { }

// After 5th save
column("ARTCU ARTCUARTCUART_CU_Quote_SalesHeaderCaption"; QuoteLbl) { }

// And so on..

I would propose that multiple accepted prefixes could be set, with the default being the first one, or, better yet, just don't do anything if the prefix meets the requirements of AppSourceCop.json

"mandatoryAffixes": [
    "ART CU ",
    "ART_CU_"
],
@deerware deerware changed the title ReportExtension prefixes not working when ObjectNamePrefix contains a space ReportExtension prefixes not working in columns when ObjectNamePrefix contains a space Sep 5, 2022
@deerware
Copy link
Author

deerware commented Sep 5, 2022

Edit: When I changed the settings

- "CRS.ObjectNamePrefix": "ART CU ",
+ "CRS.ObjectNamePrefix": "ART CU",

It does not loop around and just keeps the same, but I still think this issue should be addressed

@TKapitan
Copy link
Contributor

It's related to this AL issue: microsoft/AL#7057

@pri-kise
Copy link
Contributor

@deerware I tried to fix this in the open pull request (#254)

Now the AppSourceCop. json would be used for reportextensions and tableextensions.
I'm still waiting for some feedback on my pull reuqest, but eventually we will get this solved.

@AbsolutelyFreeWeb
Copy link

It's also related to this, dashes are also giving errors: #272

@pri-kise
Copy link
Contributor

@deerware have you tried out the new option to provide multiple affixes in the appsourcecop.json

@deerware
Copy link
Author

@pri-kise I have just tried it. It seems to be working fine now.

Testing process:

  • in settings.json "CRS.ObjectNamePrefix" was set to a value with spaces ("ART CU ")
  • in AppSourceCop.json "mandatoryAffixes" includes the same value, and a variant without spaces ("ART CU ", "ARTCU_")
  • ✅ when saved, report columns with "ARTCU_" prefix are not changed -
  • ✅ when saved, report columns without a matching prefix get the prefix from settings.json -
    • ❌ when saved without a matching prefix, if the prefix in settings.json ends with a space, it still loops around

The looping around is a separate issue which can simply be fixed the user. The main issue is fixed.

Thank you for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants