function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ca_peterson_oldca_peterson_old 

Bug report: SOSL silently fails when using an implied namespace

Hi All,

 

As salesforce doesn't seem to have an offical bug tracker or bug reporting system I don't know where else to post this.

I've found and duplicated a number of times an issue when using SOSL with an implied namespace the search fails silently.

 

For example, assuing a namespace of tst, this query would properly search:

 

List<List<SObject>> searchList = [FIND :searchText IN ALL FIELDS RETURNING
            tst__customObj__c(id, LastModifiedDate, name, tst__Description__c, tst__Status__c, tst__Subject__c, tst__Type__c, RecordType.name)];

 

While this query would properly compile, and run without exception, but always return no results, even if there are valid matches:

 

List<List<SObject>> searchList = [FIND :searchText IN ALL FIELDS RETURNING
            customObj__c(id, LastModifiedDate, name, tst__Description__c, tst__Status__c, tst__Subject__c, tst__Type__c, RecordType.name)];

 

This differs from SOQL, and as the later bugged example compiles this behavior is clearly not intended. As SOSL is already poorly documented and tricky to use this additional barrier to entry

 

A_SmithA_Smith

Are you seeing this behavior in your development org or your subscriber's org?

ca_peterson_oldca_peterson_old

Sorry for the late reply, been a crazy couple of weeks for me.

 

I'm seeing this in the development org.