• Raghu Natha 2
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 17
    Questions
  • 9
    Replies
Hi,

I awant to validate the data in a editable data table cell change event

<lightning-datatable                                                
        key-field="id"
        data={data}
        show-row-number-column
        row-number-offset={rowOffset}   
        onrowaction={handleRowAction}
        onsave={handleSave}
        columns={columns}
        oncellchange={validatecelldataset}
        draft-values={draftValues}
        errors={error}
>

In JS file 
validatecelldataset(event){ 
        console.log('Cell Data  : ' +JSON.stringify( event.detail.draftValues[0]));        
    }

How to validate the above data and send an error message.
In the columns array i do have the column name type, lenght, so the validations that I am looking for is to check against the data type and length in the JS method.

Tahnk you
Hi,

The LWC lightning input components does not contain onpaste functionality. Any pointers on how this cna be achieved.

Thnak you
Team,

Is there a way in selenium to identify the lightning elements in a flow. The id keeps changing and selenium canoot find the element.

Thank you,
Raghu
Hi,

Created a Lightning Web Component which gets the contacts on click of a button from an Apex class. The functionality works as expected when the component is used inside salesforce.

When the same component is used outside salesforce, the component is unable to fetch data.
Code: Lightninhout html code (https://github.com/EasyLearnJava/HerokuStaticSite/blob/master/home.html)
Below is my lightning out component deployed to Heroku
https://demoout.herokuapp.com/home.html

When I click on the button "Load Contacts" I see the below error.
Access to XMLHttpRequest at 'https://rnrcommunities-developer-edition.na85.force.com/Test/aura?r=1&aura.ApexAction.execute=1' from origin 'https://demoout.herokuapp.com' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
 

Hi,

I am trying to use Lightning out component out side salesforce, and I see the below error in the browser console.
" GET  https://rnrcommunities-developer-edition.na85.force.com/Test//c/lwcVfDemoApp.app?aura.format=JSON&aura.formatAdapter=LIGHTNING_OUT 404 (Not Found)"

Below is the code

<html>
<H1> Hello World </h1>
<div id="lightning"></div>
<script src="https://rnrcommunities-developer-edition.na85.force.com/Test/lightning/lightning.out.js"></script>
<script>
$Lightning.use("c:lwcVfDemoApp", function() {
$Lightning.createComponent("c:lwcVFDemo", {
objectName: "Contact"
},
"lightning",
function(cmp) {
console.log("LWC component was created");
// do some stuff
}
);
},
'https://rnrcommunities-developer-edition.na85.force.com/Test/'
);
</script>
</html>

NOTE: this is for allowing gues access.
Hi,

Can some one suggest how to do run a validation rule when a column value is edited in Lightning data table in LWC

Reference :
https://developer.salesforce.com/docs/component-library/bundle/lightning-datatable/example
 
Can I build a lightning component which can get the current location of a user from his mobile.

Thanks you,
Raghu
Hi,

When web to casecreation fails, how can I get notified so that I can check th logs in salesforce to find the appropriate reason. 

Thanks,
Raghu
Hi,

In our communities, we have Home page tab and Tab A, Tab B.
Users can see Hoempage, Tab A and Tab B when they login.

And Home Page  is open to public, with out logging in.
Please let me know how to make Tab B also public.

Regards,
Raghu 
Hi,

Please let me know how to add an attachement to Rest api and send the atttachment to external application in Apex.

Regards,
Raghu
Hi,

How to find all the reports whose running user id is 005f2000001AbUF

For Dashboards I got the same by using the following query:
select id from Dashboard where RunningUserId='005f2000001AbUF'

Thank you,
Raghu

 
Is there a rereference example for salesforce and Amazon SNS Integration ?  
Component Code
<lightning:fileUpload label="Upload Multiple files" 
                               multiple="false" 
                              accept=".pdf, .png, .jpg"
                              recordId="{!v.recordId}"
                              aura:id="multipleUpload"
                             onuploadfinished="{!c.handleUploadFinished}" />

JScontroller
({
    handleUploadFinished: function (component, event, helper) {
        // Get the list of uploaded files
        var uploadedFiles = event.getParam("files");
alert("Files uploaded length  : " + uploadedFiles.length);
      }    
})

After the Alert How do we retrieve the files uploaded and send it to Apex class ?
Also on the APEX class what is the input parameter type we use for receiving the file sent from the above JS

Hi All,

In my free developer account, Under the community section when I add a component with basic text box and other fields the component is visible in Community pages after publising the changes (I made the pages as public, so that every one can view with out logging in).

But when the component has some data like contacts which are being fetched from the Apex controller, I cannot see the same component once the changes are published. Please guide me

Regards,

Raghu
 

Hi

The below code fails to load the App. Can any one suggest me how to view the error using lightning inspector
<aura:component >
    <lightning:input />
</aura:component>

NOTE: <lightning:input name="test" label="hello"/>  --> Updating the code with this line works. But I want to see how to debug the above error
I am using Lightning inspector chrome extension. But cannot see the error.

User-added image

 
 
Hi, 

Can some one tell me the difference between the below 2 validation scenarios
Scenario 1, has 2 lightning fields to validate and the validation in JS works as expected
Scenario 2, has just one lightning input field to validate and the same JS validation fails (WHY ?) (What is the solution for this scenario for validation)

SCENARIO1:
<aura:component>
        <aura:attribute name = "documentType" type="String"/>
        <aura:attribute name = "attachmentNameValue" type="String"/>
        <lightning:layoutItem class="slds-p-around--medium" size="6">
            <lightning:select aura:id="fieldId"
                              required="true"
                              name="attachmentType"
                              label="Attachment Type"
                              value="{!v.documentType}"                             >
                <option value = "">select</option>          
            </lightning:select>
        </lightning:layoutItem>  
        <lightning:layoutItem class="slds-p-around--medium" size="6">
            <lightning:input aura:id="fieldId"
                             required="true"
                             label="File Name"
                             name="filename"
                             value="{!v.attachmentNameValue}"/>
        </lightning:layoutItem>    
        <lightning:button variant="brand" label="Upload" value="uploadSearch" onclick="{!c.handleUploadAction}"/>
    </aura:component>

JS:
({
    handleUploadAction : function(component, event, helper) {
        //helper.onSelectChange(component, event);
        var allValid = component.find('fieldId').reduce(function (validSoFar, inputCmp) {
            inputCmp.showHelpMessageIfInvalid();
            return validSoFar && !inputCmp.get('v.validity').valueMissing;
        }, true);
        if (allValid) {
            alert('All form entries look valid. Ready to submit!');
        } else {
            alert('Please update the invalid form entries and try again.');
        }
    }
})

SCENARIO 2:
<aura:component>
        <aura:attribute name = "documentType" type="String"/>
        <aura:attribute name = "attachmentNameValue" type="String"/>         
        <lightning:layoutItem class="slds-p-around--medium" size="6">
            <lightning:input aura:id="fieldId"
                             required="true"
                             label="File Name"
                             name="filename"
                             value="{!v.attachmentNameValue}"/>
        </lightning:layoutItem>    
        <lightning:button variant="brand" label="Upload" value="uploadSearch" onclick="{!c.handleUploadAction}"/>
    </aura:component>

JS:
({
    handleUploadAction : function(component, event, helper) {
        //helper.onSelectChange(component, event);
        var allValid = component.find('fieldId').reduce(function (validSoFar, inputCmp) {
            inputCmp.showHelpMessageIfInvalid();
            return validSoFar && !inputCmp.get('v.validity').valueMissing;
        }, true);
        if (allValid) {
            alert('All form entries look valid. Ready to submit!');
        } else {
            alert('Please update the invalid form entries and try again.');
        }
    }
})

 
 
Hi,

The LWC lightning input components does not contain onpaste functionality. Any pointers on how this cna be achieved.

Thnak you

Hi,

I am trying to use Lightning out component out side salesforce, and I see the below error in the browser console.
" GET  https://rnrcommunities-developer-edition.na85.force.com/Test//c/lwcVfDemoApp.app?aura.format=JSON&aura.formatAdapter=LIGHTNING_OUT 404 (Not Found)"

Below is the code

<html>
<H1> Hello World </h1>
<div id="lightning"></div>
<script src="https://rnrcommunities-developer-edition.na85.force.com/Test/lightning/lightning.out.js"></script>
<script>
$Lightning.use("c:lwcVfDemoApp", function() {
$Lightning.createComponent("c:lwcVFDemo", {
objectName: "Contact"
},
"lightning",
function(cmp) {
console.log("LWC component was created");
// do some stuff
}
);
},
'https://rnrcommunities-developer-edition.na85.force.com/Test/'
);
</script>
</html>

NOTE: this is for allowing gues access.
Hi,

In our communities, we have Home page tab and Tab A, Tab B.
Users can see Hoempage, Tab A and Tab B when they login.

And Home Page  is open to public, with out logging in.
Please let me know how to make Tab B also public.

Regards,
Raghu 
Hi,

How to find all the reports whose running user id is 005f2000001AbUF

For Dashboards I got the same by using the following query:
select id from Dashboard where RunningUserId='005f2000001AbUF'

Thank you,
Raghu

 
Is there a rereference example for salesforce and Amazon SNS Integration ?  
Hi

The below code fails to load the App. Can any one suggest me how to view the error using lightning inspector
<aura:component >
    <lightning:input />
</aura:component>

NOTE: <lightning:input name="test" label="hello"/>  --> Updating the code with this line works. But I want to see how to debug the above error
I am using Lightning inspector chrome extension. But cannot see the error.

User-added image