StevenMMortimer / salesforcer

This R package connects the Salesforce APIs from R using tidy principles.
https://stevenmmortimer.github.io/salesforcer/
Other
81 stars 19 forks source link

Bulk API fails on custom objects #131

Closed EliseyGretchko closed 2 months ago

EliseyGretchko commented 3 months ago

Issue description

I work with a large database in my org (+/- 500 000 records) and tried to query data from a custom object using the Bulk API. The error as seen in the reprex suggest that either the object does not exist, or the user does not have permission to view it.

However, the same exact SOQL expression using different API's did return results, so I rule out the fail of finding the object due to misspelling of the object name. Furthermore, as I'm able to retrieve data using different API methods, I doubt that I don't have the right permission to view the data.

I don't have a lot of technical knowledge about Salesforce and the custom objects in our org. So I am not sure if there are any object-specific settings or parameters that could be the culprit of this issue. But I do suspect that the issue may be with something in the object settings as the query works fine on other non-custom objects.

I tried to look through the Salesforce documentation of Bulk 1.0 and 2.0, but could not immediately find anything of interest that may relate to this issue.

If any of you have encountered something similar before, or have any further suggestions where to look into, please let me know.

Thank you in advance

reprex

Note:

## Custom object with Bulk 2.0
sf_query("SELECT Id FROM studie__c ", object_name = "studie__c", api_type = "Bulk 2.0", verbose = TRUE)
#> Error: The supplied object name (studie__c) does not exist or the user does not have permission to view

Session Info

R version 4.4.1 (2024-06-14)
Platform: aarch64-apple-darwin23.4.0
Running under: macOS Sonoma 14.5

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /opt/homebrew/Cellar/r/4.4.1/lib/R/lib/libRlapack.dylib;  LAPACK version 3.12.0

locale:
[1] nl_BE.UTF-8/nl_BE.UTF-8/nl_BE.UTF-8/C/nl_BE.UTF-8/nl_BE.UTF-8

time zone: Europe/Brussels
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] clipr_0.8.0       reprex_2.1.1      salesforcer_1.0.1

loaded via a namespace (and not attached):
 [1] anytime_0.3.9     xfun_0.45         remotes_2.5.0     htmlwidgets_1.6.4 devtools_2.4.5    rlist_0.4.6.2     processx_3.8.4   
 [8] callr_3.7.6       tzdb_0.4.0        vctrs_0.6.5       tools_4.4.1       ps_1.7.7          generics_0.1.3    curl_5.2.1       
[15] parallel_4.4.1    tibble_3.2.1      fansi_1.0.6       pacman_0.5.1      pkgconfig_2.0.3   data.table_1.15.4 lifecycle_1.0.4  
[22] stringr_1.5.1     compiler_4.4.1    httpuv_1.6.15     usethis_3.0.0     htmltools_0.5.8.1 yaml_2.3.9        urlchecker_1.0.1 
[29] pillar_1.9.0      later_1.3.2       crayon_1.5.3      ellipsis_0.3.2    openssl_2.2.0     cachem_1.1.0      sessioninfo_1.2.2
[36] mime_0.12         tidyselect_1.2.1  zip_2.3.1         digest_0.6.36     stringi_1.8.4     dplyr_1.1.4       purrr_1.0.2      
[43] fastmap_1.2.0     cli_3.6.3         magrittr_2.0.3    base64enc_0.1-3   XML_3.99-0.17     pkgbuild_1.4.4    utf8_1.2.4       
[50] readr_2.1.5       withr_3.0.0       promises_1.3.0    bit64_4.0.5       lubridate_1.9.3   timechange_0.3.0  rmarkdown_2.27   
[57] httr_1.4.7        bit_4.0.5         askpass_1.2.0     hms_1.1.3         memoise_2.0.1     shiny_1.9.0       evaluate_0.24.0  
[64] knitr_1.48        miniUI_0.1.1.1    profvis_0.3.8     rlang_1.1.4       Rcpp_1.0.12       xtable_1.8-4      glue_1.7.0       
[71] xml2_1.3.6        pkgload_1.4.0     rstudioapi_0.16.0 vroom_1.6.5       jsonlite_1.8.8    R6_2.5.1          fs_1.6.4         
EliseyGretchko commented 2 months ago

Problem is org specific