Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Is silverstripe suitable for large CRM system


Go to End


10 Posts   4625 Views

Avatar
Mo

Community Member, 541 Posts

9 October 2013 at 4:19am

Avatar
Optic Blaze

Community Member, 190 Posts

9 October 2013 at 5:40am

- Thanks for that i have been working through the SS-Bit tutorials and found it useful.
- Found a really cool module by Uncle Cheese called Bootstrap-forms that uses the twitter bootstrap framework:
http://www.leftandmain.com/silverstripe-screencasts/2012/07/03/bootstrap-forms-for-silverstripe-3/

- The way you set up the forms are brilliant and i find it easier to apply methods to objects using this style.
- One of the cool features is the called FancyDropdown that adds a AJAX style search functionality to a drop down field. I tested it with a list of 1600 postal codes and areas and it works <b>REALLY WELL </b>

The only thing i am struggling with at the moment is populating the form with existing records so that i can update records. I.e if i want to update customer number 3 i want to be able to call something like this in the browser....mysite/customer/edit/3

Which should bring up the form populated with the customer's details.

I know the old way of doing that was something like $form->loadDataFrom($this->editform());

This is what the code looks now:

----------------------------------------------------------------------

//CREATE CUSTOMER FORM
public function CustomerForm() {
return BootstrapForm::create(
$this,
"CustomerForm",
FieldList::create(
TextField::create("Name","Name")
->addExtraClass("required"),
TextField::create("Surname","Surname"),
ChosenDropdownField::create("PostalCodesID", "Postal Addres") ///Fancy Drop down field
->setSource(PostalCode::get()->map('ID','Suburb'))
->setEmptyString('--Please Select--'))
),
BootstrapForm::loadDataFrom($this->editform())
)
}

// ADD CUSTOMER TO DATABASE
public static function AddCustomer($data, $form) {
$submission = new Customer();
$form->saveInto($submission);
$submission->write();
Controller::curr()->redirectBack();
}

}
----------------------------------------------------------------------------

- The module has excellent validation features
- You can do a horizontal layout with checkboxes and radio buttons
- Prepend and apend text to fields
- Customize different buttons to look different...eg submit button is green, delete button is red

And all of this comes out the box!

Go to Top