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

Fix GetTableUrl for DataPerCompany=false #2303

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pri-kise
Copy link
Contributor

@pri-kise pri-kise commented Nov 4, 2024

Summary

Fix GetTableUrl for Tables with DataPerCompany=false

Work Item(s)

Fixes #2262

Fixes AB#557526

@pri-kise pri-kise requested a review from a team as a code owner November 4, 2024 15:16
@github-actions github-actions bot added AL: System Application From Fork Pull request is coming from a fork labels Nov 4, 2024
@JesperSchulz JesperSchulz added Integration GitHub request for Integration area Linked Issue is linked to a Azure Boards work item labels Nov 14, 2024
@github-actions github-actions bot added this to the Version 26.0 milestone Nov 14, 2024
@JesperSchulz JesperSchulz self-assigned this Nov 15, 2024
begin
if Company = '' then
TableMetadata.Get(TableNo);
if not TableMetadata.DataPerCompany then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if Company is blank and the data is per company? Why cannot we always replace the blank company name with the current company?

This will also slow down the code since we will load the table metadata, which can be slow on the first call. I'm not sure how slow it is after the first call.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't help.

The only thing that would help is to try a Company.Get(Company) to know if the Company text that was passed to the procedure is a valid company name.

I could then remove the check for the DataPerCompany.

if not CompanyRecord.Get(Company) then 
    Company := CompanyName(); 

Copy link
Contributor

@nikolakukrika nikolakukrika Nov 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pri-kise If the company exist or not is a caller's responsibility to determine. This code should not fix it. If you ask for a non-existing company URL, you should get what you ask.

If we have a problem with blank company name, why cannot we replace it with current company? We know that it exists.

Also keep in mind, we can open a bug for a platform to fix GetURL if we have issues with it.
The system could easily be generating the links to the external environment - we generate the first part and then the part is replaced. We need to be careful with our assumptions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is not the Blank Company Name.

The problem is Company with the value of the label.

CrossCompanyDataLbl: Label '(Cross-Company Data)'

I can change the code to check for the label CrossCompanyDataLbl.
....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AL: System Application From Fork Pull request is coming from a fork Integration GitHub request for Integration area Linked Issue is linked to a Azure Boards work item
Projects
None yet
3 participants