• S@uravv
  • NEWBIE
  • 5 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 9
    Replies
I am using Aura component to create the form. The last element of form has a dynamic picklist which shows the products. 
The users who are unable to use the experience site normally will use the keyboard keys to access. On this very element when user enters something and the popup of related products are shown the focus does not get automatically shifted there Also the up key and down arrow keys are not working to scroll through the popup.

Earlier the search component was done through ui:inputtext, but since that is deprictaed I used Lightning:Input tag and Populated various ARIA attrbutes.

But somehow, it is not working.

Can you please help?
I am using 
<apex:input type="text" styleClass="form-control"  value="{!InvoiceComments}" id="uploadInvoiceComments" onkeypress="return BlockSpecialCharacter(event)" html-placeholder="Comments" style="margin-bottom:20px;"/>
with other elements and then I am using Commandbutton to save it, but InvoiceComments is not getting updated.

I am stuck here for many days, tried different approach but not working please give any suggestions.
When I try to Query 
Invoice__C[] InvoiceData =  [Select Id,Attachment_Id__c,Supporting_Attachment_Id__c from Invoice__c where Id=:InvoiceId]; 
In the debug I see Only Id and Attachment_Id__c fields, because Supporting_Attachment_Id__c is null.
But then I try to  check it using below line.
if(InvoiceData[0].Supporting_Attachment_Id__c == ''||InvoiceData[0].Supporting_Attachment_Id__c == null)
It throws System.NullPointerException: Attempt to de-reference a null object.

How to solve this issue?
Prepoluate a page without URL parameters, The page has alightning web component
I am trying to implement chatbot on my community page so when i am trying to add the url into service console's chat with customer section, but it says "Origins may not contain paths or queries, since they are not part of the origin".
My Url is something like this https://xyz-pqrs.force.com/abc (Dummy URL)
I tried with firefox as well but it didn't work. When I go with "https://xyz-pqrs.force.com", it works but i need to go with my exact URL. I have already whitelisted "https://*.force.com" in the CORS.
Please help.
  • September 24, 2019
  • Like
  • 0
I am using Aura component to create the form. The last element of form has a dynamic picklist which shows the products. 
The users who are unable to use the experience site normally will use the keyboard keys to access. On this very element when user enters something and the popup of related products are shown the focus does not get automatically shifted there Also the up key and down arrow keys are not working to scroll through the popup.

Earlier the search component was done through ui:inputtext, but since that is deprictaed I used Lightning:Input tag and Populated various ARIA attrbutes.

But somehow, it is not working.

Can you please help?

I have created a custom lwc component for entering data for Account creation. To navigate to the Account creation page you have to click 'New' button and the new button will called the custom Aura app then mentioned Account creation lwc will open. (The approach of opening Account creation cant be changed. And seems like as per the Account creation URL it is a lighting out page.)

User-added image
More info on approach which used by us on how to navigate to lwc from visualforce page (https://niksdeveloper.com/salesforce/lwc/how-to-use-lwc-in-visualforce-page/)

Inside Account creation lwc there is a look up field for select parent Account and below is the HTML of that. (used standard codes from lightning documentation)
 

<lightning-record-edit-form object-api-name="Account">
     <lightning-input-field field-name="ParentId">
     </lightning-input-field>
</lightning-record-edit-form>


But when clicked show all results for typed Account Name in Parent Account, it is creating an error on console log as below without opening Account search popup.

User-added image

When I click Show all Results for "testing", below error shows on the browser developer console.

User-added image
 

Above mentioned code perfectly worked and open the Account serach popup in Fully lighting another lwc as below.

User-added image

But it is not working in Account Creation lwc. How to fix this? Is there in custom lookup lwc developed for supporting Show all Results in lookup as well?

When I try to Query 
Invoice__C[] InvoiceData =  [Select Id,Attachment_Id__c,Supporting_Attachment_Id__c from Invoice__c where Id=:InvoiceId]; 
In the debug I see Only Id and Attachment_Id__c fields, because Supporting_Attachment_Id__c is null.
But then I try to  check it using below line.
if(InvoiceData[0].Supporting_Attachment_Id__c == ''||InvoiceData[0].Supporting_Attachment_Id__c == null)
It throws System.NullPointerException: Attempt to de-reference a null object.

How to solve this issue?
Prepoluate a page without URL parameters, The page has alightning web component
I am trying to use the XLSX-JS (which is the thrid party library ) to load execl data into salesforce, I have uplaod the xlsx.js as static resource into salesforce platform and use loadScript to load the js code into webpage, but when I call XLSX.read method I got a XLSX is undefined message. Anyone can advise me how to referece XLSX 
import { LightningElement, track } from "lwc";
import { loadScript } from "lightning/platformResourceLoader";
import xlsx from "@salesforce/resourceUrl/xlsx";

xlsxInitialized = false;
  renderedCallback() {
    if (this.xlsxInitialized) {
      return;
    }
    this.xlsxInitialized = true;
    loadScript(this, xlsx + '/xlsx/xlsx.core.min.js')
            .then(() => {
                console.log('loaded');
            })
            .catch(error => {
                this.error = error;
            });
  }
  handleFileChange(e) {
    var files = e.target.files;
    var file = files[0];
    this.readWorkbookFromLocalFile(file, workbook => {
      console.log("4");
      var sheetNames = workbook.SheetNames; // 工作表名称集合
      var worksheet = workbook.Sheets[sheetNames[0]]; // 这里我们只读取第一张sheet
      console.log(worksheet);
    });
  }

  readWorkbookFromLocalFile(file, callback) {
    var reader = new FileReader();
    reader.onload = e => {
      var data = e.target.result;
      var workbook = XLSX.read(data, { type: "binary" });
      console.log("workbook :" + workbook);
      if (callback) callback(workbook);
    };
    console.log("2");
    reader.readAsBinaryString(file);
    console.log("3");
  }