- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2024 02:30 PM
Hello guys!
For a few days now I've been trying alone to overcome the error "Access to Script Include global.CEP_Client blocked from scope: x_1393966_a_a_no_0" and I still haven't succeeded.
In the record procuder, I am entering a ZIPCODE and trying to return data such as street name, neighborhood, state, city. But the mentioned error occurs.
Record producer.
I'm a beginner and this solution is part of my learning process. I've changed several things, redone all the work, read the documentation and I'm doing something wrong that I don't realize what it is. Please, can you give details, including if the code is wrong or missing something?
Catalog Cliente Scripts
Script Include
Can anyone help me?
Thanks in advance!
Phlavio
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2024 03:04 PM - edited 08-11-2024 03:04 PM
Hello,
Your CEP_Client script include isn't in the global scope? It's part of your custom application (look at your application field in second screenshot)? See the API name in your second screenshot? You'd want to use that, instead.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2024 03:04 PM - edited 08-11-2024 03:04 PM
Hello,
Your CEP_Client script include isn't in the global scope? It's part of your custom application (look at your application field in second screenshot)? See the API name in your second screenshot? You'd want to use that, instead.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2024 03:15 PM - edited 08-11-2024 03:19 PM
Hello, @Allen Andreas!
No, it is not in the global scope. Yes, it is part of my custom application. I set the Accessible from field to: all application scopes.
then, in Catalog Client Scripts Auto complete CEP onChange, in line 6, I should use?
var ga = new GlideAjax(x_1393966_a_a_no_.0.CEP_Client');
If so, I've already done it and it gives a similar error.
Phlavio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2024 05:29 PM
@Allen Andreas
I did the update as shown below:
Script Include
Catalog Cliente Scripts
I am not getting the error mentioned above.
But the fields are not filling automatically. Please, can you guide me?
Phlavio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2024 07:28 AM - edited 08-12-2024 07:29 AM
Hi @PhFranca
I'm glad my initial reply above guided you correctly to solve the issue this post was about. If you don't mind, please mark it as "Accept Solution" since that was your question and my reply answers that.
For additional assistance that goes beyond the question you initially asked, I don't believe you needed to add global to your script include. I'm unsure where you're getting that you think you need to do that, but please refrain from adding the "global" word to your API or to the script include. If you're wanting this script include to be accessible from other scopes (so available in global to other apps, etc.) then you would set the "Accessible from" field on the script include to be available to all scopes, which it already is, so you can halt using "global" and placing that within your scripts.
As far as the rest, you'd need to consider using logging and check your script include that it is in fact being called, see what your values are, and see what you're returning to your client script. Then, in the client script, consider using console or alerts to see what you're getting from the script include. All of this should be verified before you try to set field values. As an additional resource, here is a GlideAjax cheat sheet I commonly refer people to. Please check this and validate it aligns with what you're trying to do.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
