• Raghavendra A
  • NEWBIE
  • 195 Points
  • Member since 2013
  • SAT


  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 2
    Likes Given
  • 41
    Questions
  • 25
    Replies
Hi all,

in the documentation (https://developer.salesforce.com/docs/component-library/bundle/lightning-datatable/documentation) a way is documented to preselect rows programmatically.
For this reason you should use "selected-rows"-attribut on lightning-datatable.

DOCUMENTATION

The selected-rows attribute enables programmatic selection of rows, which is useful when you want to preselect rows.
<lightning-datatable
    columns={columns}
    data={data}
    key-field="id"
    selected-rows={selectedRows}>
</lightning-datatable>
<lightning-button
    label="Select"
    onclick={handleSelect}>
</lightning-button>

To select a row programmatically, pass in the row key-field value.
// Load data via init handler first
// then handle programmatic selection
handleSelect() {
   const rows = ['a'];
   this.selectedRows = rows;
}

My component looks (simplfied) the following way:
export default class MergeDuplicates extends LightningElement {
    @track preSelectedRows = ['0011x00000KOMiJAAX'];
    
    [...]
}

My html-file (simplified) looks the following way:
<lightning-datatable
       key-field="Id"
       data={data}
       columns={columns}
       onrowselection={handleSelected}
       selected-rows={preSelectedRows}
       is-loading={tableLoadingState}>
</lightning-datatable>

My purpose: Preselect the current account, because the lwc is placed on a lightning record page for account.

My problem: Nothing happens. No checkbox is active.

One of my first ideas was the key-field. I changed it from "id" (lowercase) to "Id" (uppercase) but that don't solve the problem.

I don't know any other simpler way to test the preselect of rows for datatable than my example above.

Any suggestions?
Hi All,

I am trying to use the following tag in the Lightning component that I have developed. But, when I execute the page, the area where this tag is shown errors out. All that I am doing in the component is that it is a custom component, that pulls in fields from the the record and shown. 

<forceChatter:feed type="Record" subjectId="0F92800CAGxxxxx"/>

Any suggestions is highly appreciated!

Thanks,
Raghu
Hi,

I would like to develop a Lightning component that allws the user to upload image or images and then show the uploaded image in the area that the image was loaded. Any help or direction with this kind of lightning is highly appreciated. 

Thanks,
Raghu
Hi All,

I would like to do the following. Show a few records in lightning component. When the user clicks on any record a pop up modal should open that shows couple of fields from the record detail page. Then show a image. 

But everything that’s shown in the modal must have custom c s s . Like background of the modal must be blue instead of white and then different font etc. 

can we design a lightning component like this? Any help is highly appreciated! 

Thanks,
Raghu 
Hi All,

We have a requirement where a User should have access to all Contacts. He must be able to edit all Records, even the the record owned by others but should not be able to delete any Contact in system. This should be the same for all other custom objects.

How can we set this up? Any help would be highly appreciated.

Thanks,
Raghu
 
Hi All,

I am trying to render few fields based on the value of a picklist field. When the value of Picklist is changed to Old then only fields A, B, C must be shown. When the Value of Picklist is changed to New then all 5 fields A,B,C,D, E must be shown. Please help me on how to show two different conditions in Visualforce page tag for a Picklist field. 

Following is the code.

 <apex:inputField value="{!A}"  rendered="{!Picklist == 'New'}"/>
  <apex:inputField value="{!B}" rendered="{!Picklist == 'New'}"/>
   <apex:inputField value="{!C}"  rendered="{!Picklist == 'New'}"/>
  <apex:inputField value="{!D}" rendered="{!Picklist == 'New'}"/>
   <apex:inputField value="{!E}"  rendered="{!Picklist == 'New'}"/>
 
I was able to show all 5 fields when Picklist value is New. How can I add anther condition? Any help would be highly appreciated.

Thanks,
Raghu

 
Hi All,

I need your help wiht a SOQL query. In a visualforce page, I need to show in a Visualforce page all the Approval Process Item that is assigned to a logged in user. I am trying to build a SOQL query for this, but finding it much more challenging than regular SOQL queries. Challenge is that I want to provide a link to the Record that is part of the Approval Process.

Could someone help me with a SOQL query that pulls all Approval items peding for the logged in user. Or even help me with the right direction.

Thanks,
Raghu
Hi All,

I have set up a multi step Approval Process where a record should be approved by multiple approvers. In each step a person will approve and that record will be sent to another user to approve.But all those users have only Read only access on that object. Hence they cannot viewthe items pending for aproval.  Is there any workaround so that they can access the items that pending for Approval to those users?

Thanks,
Raghu
Hi All,

I'm trying to stop the email notifications to a community User through APEX code for the following scenarios:

1. Welcome email for a New User creation
2. Email notification on receiving a Private message.

I have used the following code to disable the Email notification:

userId.UserPreferencesDisableAllFeedsEmail = true;

Even then the emails are thrown to the user.
Please suggest some workaround for this.
Hi All,

I am trying to import BLOB data using the data loader but the data load is failing saying invalid blob data. I want to insert the blob data as attachments into the system.

Could someone please explain how can I import Blob data as attachment on the contact record using Apex Data Loader?

Thanks,
Raghu
Hello All,

Could someone explain the differnece of using the Get and Set methods in Apex/Visualforce page developement? 

I am always confused on how to use these methods. It would be great if someone can give an example to me!

Thanks a lot in advance!

Regards,
Raghu
Hello!

I've just started to try to use triggers and need some help.  I thought this would be a pretty quick and easy thing to do, but I've been working on this same issue for a while now and I'm at a loss.  I'm including my draft code but it maybe beyond saving.  FYI - I did talk to SF support and found out that they can't help with detailed coding questions like this....  I hoping he community can help me :)

Here is the need: 

Create a new Opportunity when a Contract record is updated, specifically the field named 'Current Term Expiration Date' is updated.

On the new opportunity, I want to prepopulate data from the contract record
  • Record Type = ‘Existing Business’  (01280000000AT8P)
  • Service Offering = Contract field ‘Service_Lines__c’
  • Opportunity name = Create a new opportunity name.
    • Correct format: Dept # – Account Name – Service Line – Renewal (CTE Year)
    • Fields: ‘Department__c’ – ‘Account’ – ‘Service_Lines__c’ – Renewal (Year(‘Current_Term_Expiration_Date__c’)
      • Example for demonstration purposes only   4444 – Houston Methodist Hospital – IONM – Renewal (2014)
  • Stage ‘StageName’= ‘Renewal Notification’
  • Model Type  ‘Model_Type__c’= ‘Renewal’

Here is the code that I commented out – (otherwise I couldn’t save)

// Create the Opportunity record only when CTE is Updated

trigger CreateOpportunity on Contract (after update) {
//List<Opportunity> newOpps = new List <Opportunity>();
//for (Opportunity opp : Trigger.new);
//if (contract.Current_Term_Expiration_Date__c ==isChanged) {
//Opportunity Opp = new Opportunity();   
//opp.Opportunity_Name__c = ‘Department__c’ – ‘Account’ – ‘Service_Lines__c’ – Renewal (Year(‘Current_Term_Expiration_Date__c’)
//opp. RecordType =‘Existing Business’  (01280000000AT8P)
//opp. Service_Line__c=Contract. ‘Service_Lines__c’
//opp. StageName= ‘Renewal Notification’
//opp. Model_Type__c’= ‘Renewal’

}
    // Inserting the New Opportunity Record.

//try {
     //   insert opptoinsert;
  //  } catch (system.Dmlexception e) {
     //   system.debug (e);
   }

Any help would be greatly appreciated
Can anyone provide a basic explanation of what Apex Code Coverage is, and how to increase it?
We just upgraded/migrated our Customer Portal to the new Customer Communities platform (but kept the Customer Portal licenses and did not migrate to new Communities licenses) and now when we create a new Community User the Welcome email is not sending at all - regardless of whether or not you check "Generate new password and notify user immediately" or not - have tried both ways on initial creation and either way it does not send the welcome email.

In the Manage Communities Setup option we do have "Send welcome email" checked and created a new email template to be used with it. The template is active and Available for Use. All of the Portal Profiles and permissions have been given access to the new Community. 

When I first Published the new Community I did not have the Manage Communities Setup option "Send welcome email" checked because I didn't want to blow up all the existing Users' inbox. We were already sending an email to customers announcing the upgraded Community. But then once it was Published and the new email template was created the setting was checked back to "Send welcome email".

What does work is after you create the new user and leave "Send welcome email" unchecked, Save it. Then go back and click 'Edit' and now check "Send welcome email". That will then send the email template set for the 'Forgot Password' and 'Change Password' options in the Manage Communities Setup options.

And apparently, SFDC changed how they treat these emails from Portal to Communities, but does not mention this in any documentation. In Portals an auto-generated password used to be contained directly in the email template, inserted at the bottom.

Now, in the new Communities, that auto-generated password is no longer included, but they changed how they do this for security reasons (winter 14 release update apparently) and instead of sending a username and password in the email they now send a special link that allows people to click and change their password.

The trick is that your forgot your password email template needs to include this special merge field (undocumented anywhere by SFDC from what I found):

{!Community_Url}

If you include that it will be replaced with a special url that allows the user to change their password and logs them in. Thread where I first found this out: http://salesforce.stackexchange.com/questions/17887/communities-forgot-password-emails

This is being successfully included in the 'Forgot Password' and 'Change Password' email templates that were created. So when I go back to the newly created User and click 'Edit' and now check "Send welcome email", it does send the email template set for the 'Forgot Password' and 'Change Password' options to the new user and they are able to get in after setting their password.

Any ideas or help you can provide??

Thanks,
Alex
I have a text field called Test__c

public myCustomSettings__c myCustomSettings=myCustomSettings__c.getValues('PBA');
String imageid = myCustomSetting.Image_Id__c;

If i do hardcode the file ID , I see the image.

//obj.Test__c = '<img alt="comment" src="/servlet/servlet.FileDownload?file=01580000001YP3k" ></img>';

But ofcourse I don't want to hard code the id, so I did the following which doesn't display the image
pbaComment.Test__c = '<img alt="comment" src="/servlet/servlet.FileDownload?file="+commentimageid>

Can someone tell me what is the correct syntax?

Thanks.
My org is enabled with state and country picklist the problem is when i am trying to create a new company report it is taking the old state and country fields (text fields) i want to have new fields (picklist) what i have to do ?
I've setup web-to-lead and it all seems to be working, except the redirect. When I click Submit, the lead data is sent to my org, and then it opens a new tab and redirects to the URL defined. However, the original page is still there with all of the fields still filled. I want the redirect to happen on the original page, not a new tab.

I'm not sure what I've done wrong. Below is my code. I tried this on multiple computers (mac/pc) and browsers (chrome, safari, ff) - all with the same results above. Any ideas?

Thanks,
Sati


<!--  ----------------------------------------------------------------------  -->
<!--  NOTE: Please add the following <META> element to your page <HEAD>.      -->
<!--  If necessary, please modify the charset parameter to specify the        -->
<!--  character set of your HTML page.                                        -->
<!--  ----------------------------------------------------------------------  -->

<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8">

<!--  ----------------------------------------------------------------------  -->
<!--  NOTE: Please add the following <FORM> element to your page.             -->
<!--  ----------------------------------------------------------------------  -->

<form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">

<input type=hidden name="oid" value="00D50000000JOCj">
<input type=hidden name="retURL" value="http://www.eversauce.com">
<input type="hidden" name="lead_source" value="web"/>

<!--  ----------------------------------------------------------------------  -->
<!--  NOTE: These fields are optional debugging elements. Please uncomment    -->
<!--  these lines if you wish to test in debug mode.                          -->
<!--  <input type="hidden" name="debug" value=1>                              -->
<!--  ----------------------------------------------------------------------  -->

<p><span style="font-size: small;"><b><label for="first_name">First Name</label></b></span><br /><input id="first_name" type="text" name="first_name" size="20" maxlength="40" /></p>
<p><span style="font-size: small;"><b><label for="last_name">Last Name</label></b></span><br /><input id="last_name" type="text" name="last_name" size="20" maxlength="80" /></p>
<p><span style="font-size: small;"><b><label for="email">Email</label></b></span><br /><input id="email" type="text" name="email" size="20" maxlength="80" /></p>
<p><span style="font-size: small;"><b><label for="phone">Phone</label></b></span><br /><input id="phone" type="text" name="phone" size="20" maxlength="40" /></p>
<p><span style="font-size: small;"><b><label for="company">Company</label></b></span><br /><input id="company" type="text" name="company" size="20" maxlength="40" /></p>
<p><span style="font-size: small;"><b><label for="description">Comment</label></b></span><br /><textarea name="description"></textarea></p>
<p><input type="submit" name="submit" /></p>

</form>