Jump to:

5451 Posts in 1673 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Silverstripe 3.0: Fetch a Listbox field which has not been created in database

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 222 Views
  • Neelam
    Avatar
    Community Member
    15 Posts

    Silverstripe 3.0: Fetch a Listbox field which has not been created in database Link to this post

    I have used DataExtension on Group Class and the canView() function to hide certain groups based on conditions

    But this canView is not applied to the groups listbox which is applied while editing a member/ or group drop down while adding new groups

    So I need to set the source of the list box through code

    I used

    updateCMSFields(FieldList $fields){

    $grplisting = $fields->dataFieldByName('DirectGroups'); ...

    }

    but this is not returning anything so i am not able to use $grplisting->setSource() on it....to filter the source based on the canView conditions also...

    can some one please help me out on how I can show the filtered group values in this drop down?

    Note: As far as I have observed this field is not created in the database and involves a $belongs_many_many relationship..i have also tried using $fields->fieldByName()

    222 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.