• Vinnie Bacon 20
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 4
    Replies
I have been at this a couple of weeks now and am quite frustrated. I believe the task should be fairly simple.

I would like to grab a file, the actual file blob, from a ContentVersion record in LWC. That's it! Reallly! I need the file in LWC because I want to process it with another JS Library that is imported there.

I have tried to make the call to an Apex method (where this is easy to do with a REST call) and get the blob to the LWC that way. I can do this with a string but it looks like this is not possible for a blob.

I've tried to make the call directly from the LWC using a standard  XMLHttpRequest. This seems promising if I were going to a generic site, but it's from a Salesforce site (via the LWC) to the same Salesforce site (via the call to get the ContentVersion.VersionData record). Thus, I'm getting CORS error messages that I can't get around.

I've added a number of headers to the XMLHttpRequest, set the CORS records, and set remote site configurations, but none of this seems to work. Any suggestions as to what to try next would be greatly appreciated. I did create a case with SFDC support but haven't heard back yet.
Trying to learn LWC and struggling. :( I believe this is my unfamiliarity with JS and mapping arrays.

I can pull in some query results into my JS file.I  can put these into a table using columns and all of my fields show up. However, I can't figure out how to access these fields in the JS file.

In the code below, customerDocumentList is the array from the query. I can get the Id but how do I get other fields.

for (let i=0; i < this.customerDocumentList.length; i++) {     console.log(this.customerDocumentList[i].Id);
}

I'm assuming this goes back to the wire method and that I need to map the results like something below, but I can't figure out how to do it.

this.filesList = Object.keys(data).map(item=>({"label":data[item], "value": item  }))

Thanks in advance!
I have files linked to Contacts via another process. I can get the list of contentDocumentIds related to the Contact.

I have a Lightning component where the recordId is a Contact Id and I do a standard iteration on the ContentDocument records. I can display the file information and other details. But I can't for the life of me figure out how to generate a link to the file from the component.

Any help would be appreciated.
I did this before using ui:inputCheckbox but see that this is being deprecated and I should use

    lightning:input type="checkbox"

I'm using this within a table so I one of these in the header and many of these in all of the iterated rows. I'd like the header checkbox to be a 'select all' and set all of the rows to true (and vice versa).

Of course, I also need a way to read which of these were selected as I'm going to be processing these via my controller.

Any help would be greatly appreciated. I'm pulling my hair out here. :(
I have a Lightning component that generates a complete HTML page and then sends that page out via an email upon clicking a button. That is working fine.

I have been asked to display the HTML to the user for review before actually sending the email. However, when I try to put that email into the component to display using lightning:formattedRichText, I get the clickjack error.

Any ideas on how to display generated HTML back into my component for display?  Thanks!
I have a pretty simple component that has a table within a div. I want the table horizontall centered. I've tried all of the standard css methods to do align the table within the div. These methods work outside of Lightning. However, in my component the table always aligns to the left.

I've tried the slds-align-absolute-center which does center the table but it absolutely destroys things by putting all of the table rows into a single row.

If there's any documentation on why standard CSS, which I'm fairly well-versed in, doesn't work some times in Lightning I'd love to read it.

Thanks!!
We don't do typical Lead conversion.  Thus, I have a validation rule that applies to non-sys admins that prevents them from setting a Lead to a status of 'Converted'.  That rule works fine and gives the user an error message telling them how they should convert a Lead.

Instead, if the user enters a specific field on the Lead, it is considered converted and I want to set the status to that.  I have a trigger that sets the status and does some other things.  However, even with the trigger it's the non-admin user doing the saving of the Lead and the validation rule kicks in.

Any ideas how to get around this?  I tried a future method in the trigger but it seems to silently obey the validation rule.
I'm frustrated with the issue of aura:id not being dynamic.  I spent hours only to find out this limitation and now need to rethink how to do this entire task. 

I have a simple list of Accounts.  I want the user to be able to select one or more of these using a checkbox (ui:inputCheckbox).  I dynamically created a unique aura:id for each row using the Account's Id.  I was going to use component.find to figure out which rows have been checked.  But it looks like aura:id can't be built dynamically.

Do I now assume I need to just do this via standard Javascript?  I'm assuming there must be a way to do this common task in Lightning.  Any ideas?
I see several threads on this topic but none that address this in a general manner.  I assume that my firm is typical.  We have several sandboxes where we develop and test code changes and move these to production using change sets.  We do have VCS/Git for back end processes that interact with Salesforce but none with Salesforce code and metadata.

So my question is, what's the best way to get started on this in an organization that already has lots of custom code/metadata, installed apps, etc.?  Currently I'm using intelliJ with the Illuminated Cloud plugin.  I like that but would be ok switching to VS Code (which I've used with Atlassian products in the past) if people feel that is a much better alternative for VCS in Salesforce.

If anyone knows of some good documentation on this topic it would be appreciated.  I had trouble finding it.  Thanks!
I've been struggling with this for a while.  I've created a table using class slds-table which gives me a Lightning like look.  However, there are some things I'd like to tweak such as the row height and adding a border to the bottom of a row (or cell, I tried both).  It seems like my CSS is being ignored where I use inline styling or try to use a class with the !important keyword.

Any ideas as to how this is done?  I'm pretty new to Lightning so it's possible it's a pretty simple issue.  (He said hopefully.)
I'm trying to do something I assume is pretty simple but am getting stumped on how to do it in Lightning.  MY pseudocode is:

<aura:attribute name="printedSpecialRow" type="Boolean" default="false" />

<aura:iteration items="{!v.myList}" var="anItem">
    <aura:if isTrue="{!!v.printedSpecialRow}">
        <tr>Print Special Row</tr>
        <!-- Now set the value of printedSpecialRow to true -->
    </aura:if>
</aura:iteration>

I have simple controller method that sets the printedSpecialRow value to true.  That's easy enough.  But how do I call this method from within the aura:if block to set the value so the next iteration will not call the aura:if block.

This has gotta be easy right.  :)  Thanks!
I did this before using ui:inputCheckbox but see that this is being deprecated and I should use

    lightning:input type="checkbox"

I'm using this within a table so I one of these in the header and many of these in all of the iterated rows. I'd like the header checkbox to be a 'select all' and set all of the rows to true (and vice versa).

Of course, I also need a way to read which of these were selected as I'm going to be processing these via my controller.

Any help would be greatly appreciated. I'm pulling my hair out here. :(
We don't do typical Lead conversion.  Thus, I have a validation rule that applies to non-sys admins that prevents them from setting a Lead to a status of 'Converted'.  That rule works fine and gives the user an error message telling them how they should convert a Lead.

Instead, if the user enters a specific field on the Lead, it is considered converted and I want to set the status to that.  I have a trigger that sets the status and does some other things.  However, even with the trigger it's the non-admin user doing the saving of the Lead and the validation rule kicks in.

Any ideas how to get around this?  I tried a future method in the trigger but it seems to silently obey the validation rule.
I'm trying to do something I assume is pretty simple but am getting stumped on how to do it in Lightning.  MY pseudocode is:

<aura:attribute name="printedSpecialRow" type="Boolean" default="false" />

<aura:iteration items="{!v.myList}" var="anItem">
    <aura:if isTrue="{!!v.printedSpecialRow}">
        <tr>Print Special Row</tr>
        <!-- Now set the value of printedSpecialRow to true -->
    </aura:if>
</aura:iteration>

I have simple controller method that sets the printedSpecialRow value to true.  That's easy enough.  But how do I call this method from within the aura:if block to set the value so the next iteration will not call the aura:if block.

This has gotta be easy right.  :)  Thanks!