6

The standard approach would be to use .filter() inp.filter(input => input.get('v.whatever') === expected).forEach(input => mapDataCible[input.get('v.name')] = input.get('v.value')); Have a read of the MDN docs on array methods: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array


4

This line is not the correct way to set fields on the Contact: pageRef.getParameters().put('cont.FirstName', 'Test'); Instead, simply reference the property on your controller: controller.con.FirstName = 'Test'; Obviously, you would follow the same pattern to set LastName.


3

You can't redirect from a trigger. You would want to put a VF page or Lightning Component directly on the Lead record page in order to redirect to an edit page (or even your VF page). There's a few correct approaches to this, but your solution is not a valid one. If I were you, I'd have a trigger update a field on the Lead to indicate that it needs to be ...


3

You need to use wrapper class for that which will have old and new records properties. Below is an example: public List<compareAccount> accounts{get;set;} public void fetchOldNewAccounts() { accounts = new List<compareAccount>(); for(Account acc: [SELECT Id, Name FROM Account]){ // query your accounts accounts.add(new ...


2

If you are talking about lightning:datatable, then the full list of acceptable are in Datatable Documentation in Formatting with Data Types section. The full list: action, boolean, button, button-icon, currency, date, date-local, email, location, number, percent, phone, text, url.


2

The golden rule of unit testing is You only gain coverage for lines of code that are executed as part of a test method. In a unit test, you're generally responsible for ensuring that you provide all of the data that your class needs so that it can run. This usually takes the form of creating and inserting SObjects before running your test proper (as you do ...


1

The recordId you are using should come from lightning context if record already exists. But here you are creating new record - so you need to get the new record Id in onsuccess handler method. Also, for navigation it is recommended to use navigation library with appropriate pageReference type In cmp: <lightning:navigation aura:id="navService"/> ...


1

In order to prepopulate the password with the mask, you will have to use redisplay attribute of <apex:inputSecret>. This above mentioned attribute if set to true displays the value from controller in masked form and if it's not set, it defaults to false and does not display anything. Excerpt from Salesforce documentation on inputSecret ...


1

A password should never be sent from the server to the client in plaintext. This is a major application security hole. The password should not be stored on the server in plaintext, either; ideally, the password should be stored only in hashed and salted form. Storing and returning passwords exposes you to serious security vulnerabilities at multiple layers ...


1

You need to access the field names dynamically using the field name: <apex:repeat value="{!wrapperList}" var="key" id="theRepeatId"> <tr> <td><apex:outputText value="{!key.fieldapiname}" id="theValue"/></td> <td><apex:outputField value="{!key.currentacc[key.fieldapiname]}" id="theValue1"/></td> ...


Only top voted, non community-wiki answers of a minimum length are eligible