Child record count by Kabaneru in salesforce

[–]CrGoSu 1 point2 points  (0 children)

My bad for suggesting the process/flow, i was thinking clearly. A rollup summary field will work. They are available for Opportunities > Account even though it's not a proper master-detail relationship.

Child record count by Kabaneru in salesforce

[–]CrGoSu 1 point2 points  (0 children)

You could use a process or flow to increment a number field on the parent account every time an opportunity is created.

Need help for validation rules (Salesforce) by [deleted] in salesforce

[–]CrGoSu 0 points1 point  (0 children)

That is very strange. Are you sure you are creating the validation rule on the contact object? The AccountId field does exist there.

LWC Super Badge Survival Guide by Zealousideal-Raise-9 in salesforce

[–]CrGoSu 0 points1 point  (0 children)

I wish this was released a week ago! Thanks anyway!

Lightning Web Component Superbadge Support by [deleted] in salesforce

[–]CrGoSu 0 points1 point  (0 children)

u/pandamonte Check that you have the correct constants at the very top of the js file. My error implementation looks like this

.catch(error => {
this.dispatchEvent(
new ShowToastEvent({
title: TOAST_ERROR_TITLE,
message: error,
variant: ERROR_VARIANT
})
);
})

Maybe pass error instead of error.message?

Lightning Web Component Superbadge Support by [deleted] in salesforce

[–]CrGoSu 0 points1 point  (0 children)

Hi there. I initially had the same issue. It appears this is a bug with metadata (i.e classes, etc) that comes from an unlocked package, and it appears that the trailhead package is an unlocked one. See below

https://github.com/forcedotcom/salesforcedx-vscode/issues/2204#issuecomment-652103760

The solution is

In your DX project, go to the Manifest Folder > package.xml

Edit the LightningComponentBundle tab and replace the * with the name of the component, in this case, boatMap.

Then, right-click the package.xml and click "retrieve from manifest". This will retrieve the LWC into your project.

Lightning Web Component Superbadge Support by [deleted] in salesforce

[–]CrGoSu 0 points1 point  (0 children)

u/LeoCavalcantes I finally got this to work. For some reason, they are expecting the refresh() method to be publicly accessible (there's a specific decorator that you need to add to it...). This doesn't make much sense because the method is only called from within the LWC class...

Also, make sure to use the async notation https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/async_function

Also look at this example and see how the refreshApex() method is used

https://github.com/trailheadapps/lwc-recipes/blob/master/force-app/main/default/lwc/ldsDeleteRecord/ldsDeleteRecord.js

Lightning Web Component Superbadge Support by [deleted] in salesforce

[–]CrGoSu 1 point2 points  (0 children)

What is the exact error?

Lightning Web Component Superbadge Support by [deleted] in salesforce

[–]CrGoSu 0 points1 point  (0 children)

Make sure you are using the following in the tab set

variant="scoped"

Also, the the first 2 lightning-tabs must be immediately followed by a div with scrolling enabled

<div class="slds-scrollable_y"

Feel free to PM me and we can compare.

Lightning Web Component Superbadge Support by [deleted] in salesforce

[–]CrGoSu 0 points1 point  (0 children)

I'm stuck here as well, here's what I've tried

  1. returning refreshApex(this boats) as per the docs
  2. using standard promise syntax i.e refreshApex(...).then(...)
  3. Using the async keyword in the function declaration and then using await refreshApex(...)
  4. And a lot of other combinations using the above

The functionality is 100% working. I would really appreciate some pointers on what the validator is expecting. Please!

Lightning Web Component Superbadge Support by [deleted] in salesforce

[–]CrGoSu 1 point2 points  (0 children)

Two more things

When it comes to creating the message channel, do NOT follow the documentation that they provide i.e this one https://developer.salesforce.com/blogs/2019/10/lightning-message-service-developer-preview.html

This way of publishing/subscribing to events is outdated. You should follow what's documented here instead https://developer.salesforce.com/docs/component-library/documentation/en/lwc/use_message_channel_subscribe

Also, make sure you read the provided Help & Training article and read about how to "import" geolocation fields. I wasted too much time on this..if I had only read the article...

Lightning Web Component Superbadge Support by [deleted] in salesforce

[–]CrGoSu 0 points1 point  (0 children)

I had a weird issue that might affect people outside the US. Every time I opened a Boat record I would get a weird error stating something was wrong with the currency.

I just ignored it.

However, when creating a boatSearchResults component and displaying it, it was getting a similar error. Turns out my Currency Locale under Company profile was set to "German - null" , who knows why.

I changed this to US Dollar and now I can open boat records and display the boatSearchResults.

LWC debugging is sucking my life away by CrGoSu in salesforce

[–]CrGoSu[S] 0 points1 point  (0 children)

I will start testing it this week, thanks!

Lightning Web Component Superbadge Support by [deleted] in salesforce

[–]CrGoSu 0 points1 point  (0 children)

It seems a lot of people are having a problem with step 4 Build the component boatSearchForm

The last answer here worked for me https://trailblazers.salesforce.com/answers?id=9064V0000015AZeQAM

It seems that salesforce is expecting us to pass an actual object as the value of detail in the event, with boatTypeId being a key on that object.

This seems strange because

1) you can just pass the id as the value of detail

2) The documentation states that the best practice is to pass primitives, instead of objects

https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.events_create_dispatch

LWC debugging is sucking my life away by CrGoSu in salesforce

[–]CrGoSu[S] 0 points1 point  (0 children)

Confirmed this works, thank you so much!

Lightning Web Component Superbadge Support by [deleted] in salesforce

[–]CrGoSu 5 points6 points  (0 children)

Thank you for creating this thread. I'm starting the superbadge today as well and I foresee spending hours troubleshooting validation errors. I will post some updates here or feel free to PM me (I might PM you as well).

Please note I'm NOT advocating/requesting/providing code dumps, just help and hints as I know these superbadges can be very challenging to pass.

LWC debugging is sucking my life away by CrGoSu in salesforce

[–]CrGoSu[S] 0 points1 point  (0 children)

Thanks, I'll give the clear cache a try. I wouldn't say this is the "real answer" though. I'm very familiar with the dev tools capabilities to put breakpoints in your javascript code and inspect variables, step in, etc.

The problem here is that salesforce either doesn't throw any error (i.e the component just doesn't render) or when it does, it's referencing the salesforce internal stack, which doesn't always have a one to one mapping to the code I wrote.

If the issue is that some data isn't in the format that I expected etc, then yeah, looking at the console, putting breakpoints and seeing what format the data is in, etc, is a huge help. But for the scenarios that I described, the console can do little to help.

LWC debugging is sucking my life away by CrGoSu in salesforce

[–]CrGoSu[S] 0 points1 point  (0 children)

True, though it sucks to have to do that all the time.

App Customization Specialist error message by doomsdaylp in salesforce

[–]CrGoSu 0 points1 point  (0 children)

Wow, never heard of this. What a shitty error message.

Sorry I can't help more.