Updated 029 How to overwrite the custom fields (markdown)

Amigo 2019-07-09 11:20:22 +02:00
parent d6d695e1c5
commit be1545d6df
1 changed files with 12 additions and 7 deletions

@ -10,19 +10,24 @@ It may happen that you would prefer to use some of the default fields in a diffe
* ### Example Create_By Field In View
In this specific Job Order view, there is a field 'Created-by'. That may be opened in a new tab, there is also a field 'Created-date'. [00:02:57](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m57s) So in this field the 'Name' and 'Created_by', and 'User' is the type of field that is used. The label is 'Created by', and the user that 'Created this' is the description. [00:03:26](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m26s) That's all that is needed for a user type. Then in the Created-date, it's a calendar type. 'Created', the date, it was created, the label and some of its defaults are used.<<<<<<<<<<<<<<<,
In this specific Job Order view, there is a field 'Created-by'. That may be opened in a new tab, there is also a field 'Created-date'. [00:02:57](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m57s) So in this field the 'Name' and 'Created_by', and 'User' is the type of field that is used. The label is 'Created by', and the user that 'Created this' is the description. [00:03:26](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m26s) That's all that is needed for a user type. Then in the Created-date, it's a calendar type. 'Created', the date, it was created, the label and some of its defaults are used.
### Compiled In Code
If these values is unknown it may be seen at the compiled field.[00:03:51](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m51s) Open 'Administrator' that is the back end of the component and open the relevant component. If models is opened, there is a place called forms. When it is opened, a list of forms may be seen that correspond to the back end views that you have created. In this instance this Job Order is the one. [00:04:19](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m19s) Open the XML, double click on it and scroll down. 'Modified by' and some of its default can be seen. So this value needs to be overwritten. Then these values need to be updated or used. [00:04:45](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m45s)
These values, if you don't know them, you can actually go and look at the compiled [00:03:51](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m51s) field. So in the back end of your component, open administrator, components, then the relevant component. You would open models and then there is a place called forms, you would open it. And you'd see a list of forms that correspond to the back end views that you've created. Now in our case this job order is the one. [00:04:19](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m19s) You will obviously open the XML. Double click on it, scrolling down. You can look at modified by, and some of its default. So you going to overwrite this value. Then you need to update or use these values. Make sure this is the only part you shouldn't change, if you change it, [00:04:45](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m45s) we won't know that you're trying to overwrite one of the default fields because it uses the name as the identifier. Back in editing the field. We basically created the fields that was the first part. Close them again.
NB. This is the only part that should not be changed, if it is changed, it will not be known if a attempt has been made to override one of the default fields because it uses the name as the identifier. Back in Editing the field, the fields that were created was the first part. Close them again.
### Adding The Fields
We would like any normal, any other field, [00:05:08](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m08s) we simply go to fields, we added those fields. There's the created-date and there is the created-by. We add both to be shown, and also the position and how it should be treated. We set it was be in the left tab of the 15th. [00:05:37](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m37s)
When any other field is needed simply go to fields (if 'Settings' is selected in Editing the Admin view) then those fields can be added. [00:05:08](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m08s) There's the 'Created-date' and there is the 'Created-by'. Both is added to be shown, and also the position and how it should be treated. It had been set in the 'left tab' of the '15th'. [00:05:37](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m37s)
### Adding In Tabs(default 15 tab)
The other thing, if you would like the fields to display in the same place as before, in the edit view, then you would add it to the 15th tab. I reckoned that its very unlikely that somebody would create so many tabs.
Now what is a tab? If you would to go to the view, then this is tab 1 this tab 2 3 4 5 and 6(see video). Since publishing can really vary. [00:06:14](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m14s) It wasn't making any sense to me that I would targeted in any way directly as the 5th of the 4th. So I took a very high number 15. If you select the number 15, it will add these two fields in the same place it would if it had to build it for you. But if for some reason you say no I want to also display the field in a different tab, you could click and put in the 3rd tab, you click save, [00:06:53](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m53s) then you compile the components, install it. You will see 1, 2, 3, it's in the third tab, it's showing up. That's all you had to do as they had to say and what tab you would like it now to display. If you go here(publishing) you would see the create date no longer shows in the publish tab. Its only created by that shows up here. It literally moves the field to a different tab, [00:07:24](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m24s) as well as displays the field in the list view. Simply because you added the fields here(see video), you set that you wanted to display and you added to the third tab. I'm going to move it back to 15. Which is the tab number if you wanted to be in its default place. I click save and then save there, compile this, install it. [00:08:03](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m03s) Basically updating the component. Refresh the page, if we go to where it was, it's no longer showing there(documents), it's not showing there(production), It is not showing there(stock list), it's back in published in the correct place. That's where it will be set if you don't overwrite it. Using the 15th tab as the the target puts it's in default place. If you use another tab number, it removes it from its default place, and puts it where you have assigned it to be placed. That is how you can overwrite the custom added fields, fields of a back end view. [00:08:49](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m49s) I hope that will be very helpful.
If you would like the fields to be displayed in the same place as before, in the Edit view, then add it to the '15th' tab. It very unlikely that somebody would create so many tabs.
Now what is a tab? If you would to go to the view, then this is tab 1 this tab 2 3 4 5 and 6(see video). Since publishing may vary. [00:06:14](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m14s) It wasn't making any sense to me that I would
It does not make sense to target it in any way directly as the 5th of the 4th. So a very high number 15 is chosen. If number 15 is selected, it will add these two fields in the same place it would if it had to build it for you. But if for some reason the field should be displayed in a different tab, it may be selected and put in the 3rd tab and saved. [00:06:53](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m53s) Compile the components and install it. Then 1, 2, 3, will appear in the third tab. Then indicate in what tab you would like it now to display. So the 'Create' date no longer shows in the publish tab. It is only created by what shows up here(See video).[00:07:24](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m24s) The field gets moved to a different tab, and displays the field in the List view as well. Simply because the fields were added(see video) and set to be displayed and to be added to the third tab. It is moved back to number 15 which is its default place. Save it, compile and install it. [00:08:03](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m03s)<<<<<<<<<<<
Basically updating the component. Refresh the page, if we go to where it was, it's no longer showing there(documents), it's not showing there(production), It is not showing there(stock list), it's back in published in the correct place. That's where it will be set if you don't overwrite it. Using the 15th tab as the the target puts it's in default place. If you use another tab number, it removes it from its default place, and puts it where you have assigned it to be placed. That is how you can overwrite the custom added fields, fields of a back end view. [00:08:49](https://www.youtube.com/watch?v=FHQfIhWHYyQ&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m49s) I hope that will be very helpful.