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

Unable to query due to FORMAT #78

Open
ndemers6201 opened this issue Sep 22, 2022 · 3 comments
Open

Unable to query due to FORMAT #78

ndemers6201 opened this issue Sep 22, 2022 · 3 comments

Comments

@ndemers6201
Copy link

I created a grid based on Opportunity and want to display a custom Account field
Account.Credit_Limit__c (which is a field type of Currency)

But the query created by this tool uses FORMAT(Account.Credit_Limit__c) with the alias Account.Credit_Limit__cFormatted

I believe this alias is the issue because when I run the entire query in developer console, I get this error:
invalid alias: Account.Credit_Limit__cFormatted

The entire query is here:
SELECT Account.Name,Name,Amount,FORMAT(Amount) AmountFormatted,tolabel(StageName),Account.Credit_Limit_Notes__c,Account.Credit_Limit__c,FORMAT(Account.Credit_Limit__c) Account.Credit_Limit__cFormatted FROM Opportunity WHERE Account.Credit_Limit_Notes__c = 'Notes for testing' ORDER BY Id ASC NULLS FIRST limit 10 offset 0

QUESTION: How can I define this field within the grid Account.Credit_Limit__c so that the query does not format and alias in the SOQL? I cannot change the field type on the Account object itself.

@jackdmcgrady
Copy link

Experiencing the same issue. Interested in whether you found a solution?

@jackdmcgrady
Copy link

We've identified the cause to be that the code is trying to leave the dot notation for the spanning field in the variable used to create the alias in SOQL. This character is not allowed.
image

Updating the above solves part of the issue. Data now flows to the sdg and it's visible in debug but the field renders as blank. So it seems there is still another part requiring update for this scenario to allow it to render in the component.

@triestelaporte
Copy link

triestelaporte commented May 5, 2023

[EDIT]

I found my issue, this thread clued me in. I need to use the same inline function and alias on currency fields or the front end won't find them.

Example: FORMAT(Amount) AmountFormatted

[ORIGINAL]I have a simpler scenario using an Apex Data Provider. I think it's probably related though, as the results are the same.

In the provider I return a list of Opps with the Amount field. The column is defined as CURRENCY, and the column outputs on the data grid, but with blank values in every cell.

I can see the column definition in the debug, along with the field value in the returned data. If I change the column to DOUBLE it outputs fine, but without any currency formatting.

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

3 participants