Topic by Baljeet Singh
Content
Hi
I am trying to get custom fields from Account object. I tired by both ROQL and find method. ROQL is not displaying any custom fields. I am using find ()
$search = 1,2,3,4
$account = RNCPHP\Account::find("Account.CustomFields.c.badge_number IN ($search)");
It is printing the main array output but when I tried to get custom field values then it display error message
Not Allowed: Cannot perform requested function or action
Here is output which I got using find() Array ( [0] => RightNow\Connect\v1_2\Account Object ( [ID] => [LookupName] => [CreatedTime] => [UpdatedTime] => [AccountHierarchy] => [Attributes] => [Country] => [CustomFields] => [DisplayName] => [DisplayOrder] => [EmailNotification] => [Emails] => [Login] => [Manager] => [Name] => [NameFurigana] => [NewPassword] => [NotificationPending] => [PasswordExpirationTime] => [Phones] => [Profile] => [SalesSettings] => [ServiceSettings] => [Signature] => [StaffGroup] => ) [1] => RightNow\Connect\v1_2\Account Object ( [ID] => [LookupName] => [CreatedTime] => [UpdatedTime] => [AccountHierarchy] => [Attributes] => [Country] => [CustomFields] => [DisplayName] => [DisplayOrder] => [EmailNotification] => [Emails] => [Login] => [Manager] => [Name] => [NameFurigana] => [NewPassword] => [NotificationPending] => [PasswordExpirationTime] => [Phones] => [Profile] => [SalesSettings] => [ServiceSettings] => [Signature] => [StaffGroup] => ) )
ROQL Query
$query = RNCPHP\ROQL::query("SELECT * FROM Account
WHERE Account.CustomFields.c.badge_number IN ($search) ORDER BY ID ASC" )->next();
while($account = $query->next())
{
$name = $account['LookupName'];
}
ROQL output
Array ( [ID] => 1034 [LookupName] => Scott Turner [CreatedTime] => [UpdatedTime] => [Country] => 1 [DisplayName] => Scott Turner [DisplayOrder] => 101 [EmailNotification] => [Login] => scott.turner [Manager] => [NotificationPending] => 0 [PasswordExpirationTime] => 2016-08-07T04:00:00Z [Profile] => 3 [Signature] => [StaffGroup] => 100040 )
There is no custom field column in this output.
Any one has an idea how to get custom field values for Account object using ROQL.
I find the similar issue on this post
http://communities.rightnow.com/posts/08b2b38565
Is it product defect ?
Thanks!!
Baljeet Singh