Mar 26, 2024 12:48
We should probably approach this from a different direction. What is the intended purpose of what you're trying to do?
Mar 26, 2024 07:19
Integer h3index = 'h1,h2,h3'.split(',').indexOf('h3') is such an example. Again, when you're in a collection, the string is truncated by toString. Use JSON.serialize or some other means.
Mar 26, 2024 07:19
Just as I said--you need to serialize/String.join in order to get all the values out. Trying using JSON.serialize to get the values you expect.
Mar 26, 2024 07:19
Yes, you're debugging a List<Object>. This appears to trigger the problem as described in the original answer. If you JSON.serialize(a), the data appears as complete.
Mar 26, 2024 07:19
You're going to need to show real code, not pseudo-code. The behavior you're describing is what you'd get if you use toString() on a list, not a list of elements.
Mar 26, 2024 07:19
@JPM Splitting the string creates a List<String>, which is why the list is truncated. If you want the entire thing, you need to join it back together.
Mar 26, 2024 07:19
toString on lists automatically truncate after a number of values. See linked answer.
 
Apr 26, 2023 19:08
@MicheleKleinhomer I'm glad I could help. Good luck with the project.
Apr 26, 2023 17:40
@MicheleKleinhomer In case you downloaded the old version, check that link again. I accidentally did the thin you did before where there was a folder inside the ZIP. Should work now.
Apr 26, 2023 17:28
@MicheleKleinhomer Salesforce's Content Security Policy prohibits loading third-party resources, particularly JavaScript files. So, you need to make everything local in order for it to work. I've taken the liberty of fixing the files for you. https://drive.google.com/file/d/15KaJ8BqVPySKcxJPp4A9CyY1yJzlOekd/view?usp=sharing
Note that this is kind of a large file as is, so make sure you trim out any files you don't need for the app. It's currently 4.2MB of the allowed 5MB for a static resource. Alternatively, you can put the fonts in one static resource, and put the remaining code in the oth
Apr 26, 2023 16:44
@MicheleKleinhomer Sure, I'll be happy to take a look for you.
Apr 20, 2023 18:51
@MicheleKleinhomer Great!
Apr 20, 2023 18:43
Rename Hafu.html to index.html, and zip that file; make sure it is at the top-level of the zip.
Apr 20, 2023 18:42
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
    <lightning:container src="{!$Resource.Hafu+'/index.html'}"></lightning:container>
</aura:component>
Apr 20, 2023 18:42
```
Apr 20, 2023 18:42
@MicheleKleinhomer I did some research. The base html file must be index.html, not anything else, or you get a 403 error. Here's what I got working...
Apr 20, 2023 18:23
It may be case-sensitive, make sure you match capitalization correctly.
Apr 20, 2023 18:21
@MicheleKleinhomer Okay, so your html file in the root of the ZIP. You wrote $Resource.Hafu + '/Hafu/Hafu.html', but it should have been just $Rsource.Hafu + '/Hafu.html'.
Apr 20, 2023 18:14
@MicheleKleinhomer That said, if you're able, send me the zip file and I should be able to spot the problem.
Apr 20, 2023 18:14
@MicheleKleinhomer Make sure you edit your question, and not the answer. I'll be happy to take a look at it with you.
Apr 20, 2023 18:14
@MicheleKleinhomer It should be compatible with both security models. I haven't tried it in Experience Builder, though. Are you having trouble getting it to work?
 
Feb 3, 2023 19:55
Are you getting an Apex debug log when the Salesforce Developer Window is open?
Feb 3, 2023 19:50
@FrostyNah I just noticed the comment. I'll leave this open for a bit if you need more help. But just changing the parameter should probably be enough.
Feb 3, 2023 18:55
@FrostyNah Yes, if it's a numeric value as such, you need to either convert it to a string in the JS, or change the Apex code to accept an Integer or Decimal.
Feb 3, 2023 18:55
@FrostyNah You need to add a Remote Site Setting to authorize access to that URL. It should be the domain name (without the path), e.g. https://app.test.com/
Feb 3, 2023 18:55
@FrostyNah Yes, exactly.
Feb 3, 2023 18:55
@FrostyNah My example uses a named credential; you can set this up in Setup | Named Credentials. Or, if you want, you can just use the endpoint directly if you prefer.
Feb 3, 2023 18:55
@FrostyNah Did you add a Remote Site? Try opening the Salesforce Developer Console and see if your Apex is running. You can also set a debug point in handleFormSubmit as handleFormSubmit(event) { debugger; ... open the F12 Developer Console and step through the event as it runs.
Feb 3, 2023 18:55
@FrostyNah That's already in the Apex code I wrote. When validationResult.success is false, you should have a message on what happened. How you display the error is up to you. Maybe show a toast?
Feb 3, 2023 18:55
@FrostyNah Seeing "nothing" isn't much of a surprise in your current state of code. You need to add error handling (the part where I wrote // display an error here. Also, once the form saves successfully, .submit(fields), you'll have to take action if you're expecting the user to be navigated somewhere. You can use the onsuccess event to do that. I don't think you've done anything wrong, it's just incomplete at this point.
Feb 3, 2023 18:55
@FrostyNah it's probably a small typo somewhere. We all do it from time to time. Can you edit your question to include all your new/changed code?
 
Oct 22, 2022 07:01
Good night, enjoy!
Oct 22, 2022 07:01
Glad I could help :D
Oct 22, 2022 07:01
Yeah, no problem.
Oct 22, 2022 06:59
I don't write it directly because spiders like to spam me.
Oct 22, 2022 06:59
brianmfear at gmail
Oct 22, 2022 06:58
But it shouldn't be harmful.
Oct 22, 2022 06:58
Ah, cool. Yeah, you don't need to deserialize if that's all you're returning.
Oct 22, 2022 06:57
fields.RecordTypeId = this.recordType.Id? But if it's working, I wouldn't mess with it.
Oct 22, 2022 06:56
You probably meant:
Oct 22, 2022 06:56
The RecordTypeId should be an Id value.
Oct 22, 2022 06:56
` fields.RecordTypeId = JSON.stringify(this.recordType.data);`
Oct 22, 2022 06:56
Everything looks mostly okay, except:
Oct 22, 2022 06:54
Sure, a moment, please.
Oct 22, 2022 06:50
Yeah, I have a bit of time left.
Oct 22, 2022 06:50
No problem. We have a lot of top users that can help, too, so you dpn't always need to notify me. But I'll always make a best effort to help. You can also email me from the email on my profile.
Oct 22, 2022 06:49
I'm on literally every day, but you can add a comment to your question with @sfdcfox some message, and it'll notify me.
Oct 22, 2022 06:47
Cool.
Oct 22, 2022 06:42
A lot of programming is attention to detail. This comes with experience.
Oct 22, 2022 06:42
This is something that comes with experience.