diff --git a/045-Adding-your-own-rule-valadation-to-a-field-in-JCB.md b/045-Adding-your-own-rule-valadation-to-a-field-in-JCB.md index fbac004..16442f1 100644 --- a/045-Adding-your-own-rule-valadation-to-a-field-in-JCB.md +++ b/045-Adding-your-own-rule-valadation-to-a-field-in-JCB.md @@ -1,4 +1,7 @@ # ADDING YOUR OWN RULE VALIDATION TO A FIELD IN JCB -I would like to demonstrate to you [00:00:05](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m05s) how to add rules to your Model Basically to a field Adding rules to a field Uses your custom rules to Test the value Before actually You know submitting it to the database so this is a quite good feature to actually have in your component Now [00:00:32](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m32s) I'm just gonna use this Hello World Component the one we we actually Did a Hello World tutorial on and I'm gonna add a rule to one of its Fields and then Then quickly type it up And show you how to include it Ok so I've gone to admin views I'm gonna open this greeting First As the admin view we want to change the field in it I think that's used his greetings And let's add a rule That we can call something like [00:01:11](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m11s) Now we see at this time That the field attributes don't have the validation Option switch in place So We might start shipping JCB with this new validation property well not new it's Just not being added yet but if you have a version of JCB that doesn't have it set Then whatever field type you've selected you can edit the field type going here Or You could edit the field type By going to field types [00:01:47](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m47s) So this have to close out of this again And then here field types And you can select the field type that you want to add this validation to we want to do it for now just to the Text area This one And it has a filter in place I think I'm gonna add validation just underneath it So just gonna click here a plus It is adjustable It's not required it's not translatable and let's give it a little [00:02:22](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m22s) Description ok so I think we got it all set I wouldn't add a value here because If if you don't want to use it you just leave it empty And ok that's basically it let's save and closed so we've done the text area Now Let's go back to our Admin view greetings and again open that field And now we have this validate a property available to us So we can now copy it [00:02:59](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m59s) And add it in here Now we want to have a custom validation here There are built in Joomla validations as well But you can also set up a custom validation rule and this is what of form rule as its known This is what we want to demonstrate So we gonna say Let's call our rule strlen Ten So my string must be longer than 10 characters [00:03:36](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m36s) Ok I think that should do So I'm just gonna copy this again And save and close So now that we've got our validation set JCB is not yet able to well We don't have an area for you to write the rule and have it be included So the way you do this and I think it's it's efficient Is it you right up the file yourself you put it in the custom folder of JCB And you include it into the component So that it places it in the correct place You see the one thing that JCB already does for you [00:04:18](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m18s) Is that it creates a folder called rules and in the forms Every XML If we open it already has a field path And a rule path So you you can just add your rule to this Basically to this folder Which I will demostrate to you in the moment But first let's create our rule So I had it this room here so in the folder structure [00:05:14](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m14s) I'm basically in the admin area components component builder and there is this folder called custom An inside of this folder I've Now created this strlenTen file strlenTen file and then it I placed this this code here Basic J form rule nothing too fancy about it Ok let's see now that we've got our file in place We need to add it into our component So we go to the components and we open that component And we go to [00:06:03](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m03s) Settings and there adding custom files and folders We click on this component files and folders create component files and folders For this Joomla component We just click on that it's ok And here we want to add 1 file Since we've added it to that custom folder everything in at custom folder will come up as a file that you can Select So there it is that file Now the path to where we want it to place the file [00:06:38](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m38s) So in the backend of the component we go to Models Forms And we are targeting this greeting form so we opened that and we see That it has models rules So Let's copy that Now we need to remember that it is admin the admin area And then Models rules [00:07:07](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m07s) So This admin is basically the way the package is built so the target Place should be the place in Inside the package this be always the case for both folders and fields So in the Folder You want it to add it to the admin models rules folder And then you need to decide whether you want this file to be updated Now at this stage that files doesn't need any updating But hey we can change that So you can see I've just added this [00:07:41](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m41s) New licence tag to it And I've added this BOM Basically when the file gets taken It will Take this part away and replace this with your components licence and so the file will basically be Become Branded like every other file in your In your component And that [00:08:06](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m06s) Even if you use it in areas or components Other than the one you originally made it for it will just dynamically looked like it was made for it because it Add that components Data at the header of the file and even if you had the components name somewhere else in this You can actually replace it with the well-known Hash hash hash component hash hash hash and it will be placed with the component name Ok enough of that we've got our file in place You wanted to be updated And now let's compile the component and see it in action So here just tick this as yes it's the file should be updated [00:08:54](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m54s) And then save and close Also close out of a component again There's no shortcut to that file area over here that you can use We go to the compiler And we compile our component Ok it's done now let's install our component Now let's go look at the code to see what happen Ok so here is our components admin area If we open the rules we see ha there is a file it was Placed into this folder If we open that file we see ha [00:09:39](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m39s) It added our Copy notice to the header of the file And now let's also look at our XML Scroll down We see the validation is there strlen.Ten so Everything so far so good Now let's go test this So we open this component in the backend We go to greetings [00:10:10](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m10s) We click new Now as you remember We said that greetings now needs to have a length Of at least 10 Characters So let's test this So we add greeting which isn't enough and we click save And it tells us Invalid field greetings Problem [00:10:36](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m36s) There's one little change I had to make to get this to work and I realize I'll need to tell you ok let's go look at this For some reason they want this file all lowercase so I had to change strlen.Ten to the T Also in lower so let's go do this Also with the file in our custom folder Then Inside of the actual file they also want the T here to be lowercase I suppose because they are using the upper case camel rule To sort of break-up the the name Let's see ok so that was what I had to do to get it to work Now [00:11:20](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m20s) I also need to just update the component to include this file since the name is changed it will no longer know where it is So we open the component You know what Let's not open the components go directly to that file Area With the shortcut And we see it is no longer selected to a scroll down selected again and save and close That should do it Ok so now that we've fixed the little glitch which I created myself Let's go back to see this again in action [00:11:57](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m57s) And save And invalid field greetings Ok that isn't very helpful Maybe you would like to also show a custom message So that the user word least know more about what is going on here But now before we do that let's add enough values and see if that it actually saves And now it's saved excessively close So our greetings been saved and how value here is more than 10 characters So it was valid Now let's go add a custom message to our [00:12:38](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m38s) Validation Now remember whatever you do to the live version of this file Will not necessarily become part of the next compilation So adding a custom message you need to actually go back to component builder custom And to that actual file And add it in there then recompile your component and it will automatically Update the live demonstration So the other way just a test before doing it live or be you know before Adding it to the core of your component is to actually go to the live file which as we saw is [00:13:17](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m17s) here in Hello World Models Rules strlen.ten Good Now let's add our custom message in here just to test Ok We using the element and adding an attribute to the element message Field must have more than 10 characters That is one way of doing this of course there is another way Again this takes us back to JCB [00:13:47](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m47s) And we go to the field We open greetings And we look for the attribute message It doesn't have message So we need to add this attribute we'd click on field type And we scroll down I think let's place this under description So we say Message It's changeable [00:14:21](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m21s) It is translatable And it's optional so We don't make it compulsory Ok we got all set So Just save and close Now Let's add this validation sorry the message To our field Now before we save this and actually go this path let's first test our live [00:15:00](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m00s) Change we made to the file and see if that also works So in the File we added this attribute To the element And basically return false Good now let's go test this So we again open that item And we take away a few characters And click save And there we get a message that it needs more than 10 characters Ok great so that option also works very well [00:15:34](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m34s) Now lets use the other one which I suppose is more convenient Unless you are checking multiple things and you would like to give multiple error messages based on those results then this implementation is the better option but if you just got one message and it just needs to really explain to the user one issue Then using the XML path I suppose is more convenient So in our custom file we haven't added that change so Let's go and compiler component and install First we need to save and close out of this Field so that the changes be captured Then go to the compiler [00:16:20](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m20s) And compile our component Install Lets go look at the code So here in the code we see our custom message is again not showing up The XML greeting we now have this translated message here As you can see Lets go test this So again we open that field And first lets just save it the way it is [00:16:56](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m56s) Ok good it works lets take away 2 characters and save again And we get the expected message this time around that message can be translated And as well it is actually in the XML file it's not part of the actual function Ok well so I think this covers it We have now successfully added Our own validation rule to one Field within a view And we were able to include that rule into our component on compilation are using adding custom Files Thank you for watching +I would like to demonstrate to you [00:00:05](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m05s) how to add rules to your Model, basically to a Field. Adding rules to a Field, uses your custom rules to test the value before submitting it to the database. This is quite a good feature to have in your Component. [00:00:32](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h00m32s) I'm just going to use Hello World Component. The one we did a Hello World tutorial on. I'm going to add a rule to one of its Fields. Then quickly type it up and show you how to include it. I've gone to Admin Views. I'm going to open Greeting (first) as the Admin View. We want to change the Field in it. I think let us used this Greetings. [00:01:11](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m11s) Now we see at this time that the Field attributes don't have the validation option switch in place. We might start shipping JCB with this new validation property, well it is not new, it's just not being added yet, but if you have a version of JCB that doesn't have it set, then whatever Field Type you've selected you can edit the Field Type going here(green button), or you could edit the Field Type by going to Field Types. [00:01:47](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h01m47s) + +???? +Close out of Edit the Admin View again. And then Field Types in Admin View. You can select the Field Type that you want to add this validation to we want to do it for now just to the Text area This one And it has a filter in place I think I'm gonna add validation just underneath it So just gonna click here a plus It is adjustable It's not required it's not translatable and let's give it a little [00:02:22](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m22s) Description ok so I think we got it all set I wouldn't add a value here because If if you don't want to use it you just leave it empty And ok that's basically it let's save and closed so we've done the text area Now Let's go back to our Admin view greetings and again open that field And now we have this validate a property available to us So we can now copy it [00:02:59](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h02m59s) And add it in here Now we want to have a custom validation here There are built in Joomla validations as well But you can also set up a custom validation rule and this is what of form rule as its known This is what we want to demonstrate So we gonna say Let's call our rule strlen Ten So my string must be longer than 10 characters [00:03:36](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h03m36s) Ok I think that should do So I'm just gonna copy this again And save and close So now that we've got our validation set JCB is not yet able to well We don't have an area for you to write the rule and have it be included So the way you do this and I think it's it's efficient Is it you right up the file yourself you put it in the custom folder of JCB And you include it into the component So that it places it in the correct place You see the one thing that JCB already does for you [00:04:18](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h04m18s) Is that it creates a folder called rules and in the forms Every XML If we open it already has a field path And a rule path So you you can just add your rule to this Basically to this folder Which I will demostrate to you in the moment But first let's create our rule So I had it this room here so in the folder structure [00:05:14](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h05m14s) I'm basically in the admin area components component builder and there is this folder called custom An inside of this folder I've Now created this strlenTen file strlenTen file and then it I placed this this code here Basic J form rule nothing too fancy about it Ok let's see now that we've got our file in place We need to add it into our component So we go to the components and we open that component And we go to [00:06:03](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m03s) Settings and there adding custom files and folders We click on this component files and folders create component files and folders For this Joomla component We just click on that it's ok And here we want to add 1 file Since we've added it to that custom folder everything in at custom folder will come up as a file that you can Select So there it is that file Now the path to where we want it to place the file [00:06:38](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h06m38s) So in the backend of the component we go to Models Forms And we are targeting this greeting form so we opened that and we see That it has models rules So Let's copy that Now we need to remember that it is admin the admin area And then Models rules [00:07:07](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m07s) So This admin is basically the way the package is built so the target Place should be the place in Inside the package this be always the case for both folders and fields So in the Folder You want it to add it to the admin models rules folder And then you need to decide whether you want this file to be updated Now at this stage that files doesn't need any updating But hey we can change that So you can see I've just added this [00:07:41](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h07m41s) New licence tag to it And I've added this BOM Basically when the file gets taken It will Take this part away and replace this with your components licence and so the file will basically be Become Branded like every other file in your In your component And that [00:08:06](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m06s) Even if you use it in areas or components Other than the one you originally made it for it will just dynamically looked like it was made for it because it Add that components Data at the header of the file and even if you had the components name somewhere else in this You can actually replace it with the well-known Hash hash hash component hash hash hash and it will be placed with the component name Ok enough of that we've got our file in place You wanted to be updated And now let's compile the component and see it in action So here just tick this as yes it's the file should be updated [00:08:54](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h08m54s) And then save and close Also close out of a component again There's no shortcut to that file area over here that you can use We go to the compiler And we compile our component Ok it's done now let's install our component Now let's go look at the code to see what happen Ok so here is our components admin area If we open the rules we see ha there is a file it was Placed into this folder If we open that file we see ha [00:09:39](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h09m39s) It added our Copy notice to the header of the file And now let's also look at our XML Scroll down We see the validation is there strlen.Ten so Everything so far so good Now let's go test this So we open this component in the backend We go to greetings [00:10:10](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m10s) We click new Now as you remember We said that greetings now needs to have a length Of at least 10 Characters So let's test this So we add greeting which isn't enough and we click save And it tells us Invalid field greetings Problem [00:10:36](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h10m36s) There's one little change I had to make to get this to work and I realize I'll need to tell you ok let's go look at this For some reason they want this file all lowercase so I had to change strlen.Ten to the T Also in lower so let's go do this Also with the file in our custom folder Then Inside of the actual file they also want the T here to be lowercase I suppose because they are using the upper case camel rule To sort of break-up the the name Let's see ok so that was what I had to do to get it to work Now [00:11:20](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m20s) I also need to just update the component to include this file since the name is changed it will no longer know where it is So we open the component You know what Let's not open the components go directly to that file Area With the shortcut And we see it is no longer selected to a scroll down selected again and save and close That should do it Ok so now that we've fixed the little glitch which I created myself Let's go back to see this again in action [00:11:57](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m57s) And save And invalid field greetings Ok that isn't very helpful Maybe you would like to also show a custom message So that the user word least know more about what is going on here But now before we do that let's add enough values and see if that it actually saves And now it's saved excessively close So our greetings been saved and how value here is more than 10 characters So it was valid Now let's go add a custom message to our [00:12:38](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h12m38s) Validation Now remember whatever you do to the live version of this file Will not necessarily become part of the next compilation So adding a custom message you need to actually go back to component builder custom And to that actual file And add it in there then recompile your component and it will automatically Update the live demonstration So the other way just a test before doing it live or be you know before Adding it to the core of your component is to actually go to the live file which as we saw is [00:13:17](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m17s) here in Hello World Models Rules strlen.ten Good Now let's add our custom message in here just to test Ok We using the element and adding an attribute to the element message Field must have more than 10 characters That is one way of doing this of course there is another way Again this takes us back to JCB [00:13:47](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m47s) And we go to the field We open greetings And we look for the attribute message It doesn't have message So we need to add this attribute we'd click on field type And we scroll down I think let's place this under description So we say Message It's changeable [00:14:21](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m21s) It is translatable And it's optional so We don't make it compulsory Ok we got all set So Just save and close Now Let's add this validation sorry the message To our field Now before we save this and actually go this path let's first test our live [00:15:00](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m00s) Change we made to the file and see if that also works So in the File we added this attribute To the element And basically return false Good now let's go test this So we again open that item And we take away a few characters And click save And there we get a message that it needs more than 10 characters Ok great so that option also works very well [00:15:34](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m34s) Now lets use the other one which I suppose is more convenient Unless you are checking multiple things and you would like to give multiple error messages based on those results then this implementation is the better option but if you just got one message and it just needs to really explain to the user one issue Then using the XML path I suppose is more convenient So in our custom file we haven't added that change so Let's go and compiler component and install First we need to save and close out of this Field so that the changes be captured Then go to the compiler [00:16:20](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m20s) And compile our component Install Lets go look at the code So here in the code we see our custom message is again not showing up The XML greeting we now have this translated message here As you can see Lets go test this So again we open that field And first lets just save it the way it is [00:16:56](https://www.youtube.com/watch?v=Z6-ggKtX35o&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m56s) Ok good it works lets take away 2 characters and save again And we get the expected message this time around that message can be translated And as well it is actually in the XML file it's not part of the actual function Ok well so I think this covers it We have now successfully added Our own validation rule to one Field within a view And we were able to include that rule into our component on compilation are using adding custom Files Thank you for watching