Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Salesforce by (11.9k points)

When attempting to obtain the descriptions of a list of objects from salesforce using rforcecom.getObjectDescription for certain objects I get the error

Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE,  : 

  arguments imply differing number of rows: 1, 0

The error occours if I run the function within a loop or outside of it. I have not been able to find any reason why some objects work and others do not and I do not understand what the error message is trying to convey.

Does anyone know how to solve or workaround this error? If not is there a way to tell which objects will cause the error and which will not?

1 Answer

0 votes
by (32.1k points)
edited by

Hey try using the following code to solve this problem. 

library(gsubfn) # this is used for fn$indentity

account.nm <- rforcecom.getObjectDescription(session, "Account")

nm <- toString( sprintf("%s", account.nm$name))

account.query <- fn$identity( "SELECT $nm FROM Account")

Account <- rforcecom.query(session, account.query)

Become a salesforce certified administrator by going for Intellipaat’s Salesforce course!

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...