-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Models custom fields preloaded with data #2608
Comments
We've talked about 'default values' in custom fields before, but this is the first proposal that makes enough sense to me. I was thinking about how many "U" a particular rack server is - and if you put in, say, a Dell xyz server, that will always be 5U. If you could use the fieldset to say "Rack Server", but then within the Dell xyz server model, you could say "Default height in U: 5" that would really help going forward. And then when you're looking at the individual asset, you still see how many U it is. For implementation, I think you don't need anything crazy or high-performance or denormalized or anything - it could just be as simple as:
I'm not sure we'd need the Code-wise, it'd probably be something like: // in Model class -
function default_values()
{
return $this->belongsToMany('CustomFields')->withPivot('default_value');
} That would be a little clunky when you're walking through the custom fields to pluck out the defaults, so you might want to make a helper - //also in Model class?
function default_array()
{
$results=[];
foreach($this->default_values() AS $custom_field) {
$results[$custom_field->id]=$custom_field->pivot('default_value');
}
} Then when you're trying to generate default values in a |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions! |
Hello, |
This would be very useful for me as well. I have custom fields for things like what OEM OS license comes with the machine - it's almost always going to be the same for a particular model. So the option to set a default would be a time saver. |
This feature would be amazing! Please add! I don't know if this is exactly the same thing as I need, but I would like the default values for a custom field to be for list fields as well as text and tied to a specific asset model rather than every single asset that uses that field. Thanks! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions! |
me too |
I think it would be good to have the possibility to fill the "standard" values of the custom fields you apply to a new "model" when you are creating the model, so later when you assign that model those values are already written.
Can be a really time saver when you need to add multiple items of the same model.
For an example, think about new computers for the office, all the same boxes and the same model, and you need to store the ram, storage and processor they have (for later exports to excel), so you create the custom fields, the custom group and assign it to the model, but later you need to fill it up for every new asset you make, what i am asking for is the same as this, but filling it up only one time in the model creation, so later when you create the asset its already filled.
And latter, if you buy more of that model and the specs had changed (very usual with pc models) you can just simply change it on the model so all new ones have the new values.
I think i have explained myself good, tell me if any more info is needed.
P.D: i know we have the "components", but i dont find it useful in the case i explained before.
The text was updated successfully, but these errors were encountered: