I have 2 related objects. Employee and Company. Cardinality is "Many Employees to One Company".
The Company lookup field in the Employee object has the integration code "company"
The relationship name is "R1234".
Suppose I have the following employees with their respective company ids.
Employee: "John Doe" - ID: 100 - Company ID: 200
Employee: "Sue Smith" - ID: 101 - Company ID: 201
If I run an the following 2 queries for John Doe as follows:
rbf_selectQuery("SELECT company FROM employee WHERE id = 200", 1, displayCompanyId);
rbf_getRelatedIds("R1234", 100, displayRelatedCompanyId);
Both displayCompanyId and displayRelatedCompanyId display 200 as expected.
However if run the two queries for Sue Smith then displayCompanyId shows "null" while displayRelatedCompanyId displays 201.
So essentially the rbf_selectQuery and rbf_getRelatedIds are out of sync with each other.
If I view Sue Smith or the company with ID 201 in the admin interface everything looks fine. You can see her related company as expected. In my case, this problem happens for any employee assigned to company 201.
Is this expected behavior. Why would it be inconsistent between different employees?
Release 2.1.0.3
Build Date 02/18/2014
I assume that the rbf_selectQuery() is looking for employees whose ID = 100 and not 200
Yes typo, that should be:
rbf_selectQuery("SELECT company FROM employee WHERE id = 100", 1, displayCompanyId);
Yes typo, that should be:
rbf_selectQuery("SELECT company FROM employee WHERE id = 100", 1, displayCompanyId);
You might want to create a ticket with Support if your company has already done so, as this type of issue is unlikely to get fixed with just a few instructions.
Hello everyone,
I have the same problem.
Has it been fixed?
Has a solution been found?
Best Regards,
Refaels
For fetching lookup field values for a record, it is advised to use Server-side API getRelatedIds instead of selectQuery.
selectQuery implementation is optimized to fetch field values persisted orthogonal & specific to each individual record. However for lookup field values which are basically references to other records in the system, selectQuery results may be inconsistent.
That said, for selectQuery API we have done additional corrections in Rollbase 5.1 release to ensure it retrieves the correct set of values for single cardinality lookup fields. That is when fetching single value lookup fields ( 1 side of relationship in 1:1, 1:M , M:1), selectQuery API will also return results consistent with getRelatedIds.