Hi,
I am trying to generate excel document by using the a!exportDataStoreEntityToCsv(). Below is my code snippet:
load( local!exportDocId, local!errorMessage, { if( isnull(local!exportDocId), a!linkField( labelPosition: "COLLAPSED", links:a!dynamicLink( Label: "Export Inactive Users Details to Excel", saveinto:{ a!exportDataStoreEntityToCsv( entity: cons!VW_EPMT_EWR, selection: a!querySelection( columns:{ a!queryColumn( field: "ewr_number" ), a!queryColumn( field: "name" ), a!queryColumn( field: "active" ) } ), documentName: "EWR Grid Record Data", saveInFolder: cons!EWR_FOLDER, onSuccess: a!save( local!exportDocId, fv!newDocument ), onError: a!save( local!errorMessage, "Error in Exporting File" ) ) } ) ), {} ), if( not(isnull(local!exportDocId)), a!linkField( links:a!documentDownloadLink( Label:"Download Excel File", document: local!exportDocId ) ), a!textField( value:local!errorMessage, readonly:true ) ) })
Now when i am clicking on the link in design interface, it gives the below error:
Interface Definition: Expression evaluation error: An error occurred while executing a smart service: Error accessing data store entity: VW_EPMT_EWR. Please contact a system administrator for additional details. (APNX-1-4505-026).
Could anyone please help me out by identifying the mistake. Any help will be appreciated.
Thanks,
Anandita
Discussion posts and replies are publicly visible
Is there any more information in the logs? Usually the application server logs are a good place to start troubleshooting.
Hi Anandita,
I have a similar scenario here and I tested your code using my data store, it is working just fine.
Perhaps you should check the fields names in the queryColumns it should match the CDT instead the Table.
Regards,
Acacio B.
Hi Acacio B,
I cross checked my field names they are similar to the ones in CDT but still getting the error.
Also, I tried using another CDT which is working as expected an the excel is getting downloaded too.
Here, I presume the view is holding a large set of data and hence taking time to fetch it, resulting in that error. Now if that is the real problem then I am not sure how to fix that. Could you please suggest?
Have you considered the possibility to move the Excel generation to a Process Model? You could replace the linkfield for a startProcessLink and try to achieve the same result but using the Smart Service instead the function.
That is the way how I'm doing my exports:
You could try at least to create a test Process Model and check if it run without errors.
There could be 2 possibilities:
1) Check all the Field name as per the CDT ..would suggest copy and paste from there esp: ewr_number
2) I see you are trying to fetch data but based on which filter value are you trying to get.
Starting Excel in safe mode. Disabling COM add-ins. Disabling Excel add-ins. Moving files from startup folders used by Excel.Click File > Options > Add-ins.Select COM Add-ins, and click Go.Clear all the checkboxes in the list, and click OK.Close and restart Excel in normal mode (not in safe mode).
Will