• Julien Salenson
  • NEWBIE
  • 20 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 4
    Replies
Hi,

I have created this component :
<lightning:recordEditForm aura:id="edit" recordId="{!v.recordId}" 
                          objectApiName="Account" 
                          > 
    <lightning:inputField fieldName="Sales_DT__c" variant="label-hidden"/>
</lightning:recordEditForm>

Where Sales_DT__c is a lookup on User.
This field Sales_DT__c  has a value recorded : 00530000004FGcfAAG.

Before, it's was working with this old workaround : add lightning:recordViewForm in the same compoent, but it's doesn't work anymore :
<lightning:recordViewForm recordId="{!v.recordId}" 
                              objectApiName="Account" >
        <div class="slds-hidden">
            <lightning:outputField fieldName="Sales_DT__c" />
        </div>
    </lightning:recordViewForm>

I have already read this : https://developer.salesforce.com/forums#!/feedtype=SINGLE_QUESTION_SEARCH_RESULT&id=9060G0000005qTaQAI

But, I didn't found a good response.

Any idea on how to populating this lookup field when I load the component ?
 
Hi,

After saving on my lightning component, I'm trying to go back to my record page with the good slide enabled.

I have a custom tab : 'configurateur' . 

I have tryed this :
var sObectEvent = $A.get("e.force:navigateToSObject");
sObectEvent.setParams({
     recordId: component.get("v.recordId"),
     slideDevName: 'configurateur'
});
sObectEvent.fire();
I'm going back to my record page but i'm landing in the default slide.

Is there a way to go back on my custom slide (tab) 'configurateur' ?

Thanks for your help
 
I have a very strange error.
I have developped a component with lightning:dualListbox.
I have a button 'enregistrer' in controller to save this ordered list (Call when I hit button Save)

But sometimes "enregistrer" return null after the call back on :
actionEnregistrer.setCallback(this, function(actionResult) {
...
if(actionResult.getReturnValue()==null){
service.showWarningToast('Le composant APEX ne répond pas, impossible de sauvegarder !');
}

The strange things is, if i open developper console in another tab, and go back to my component, it's working !
Very strange, isn't it ?

Well do you have an idea where this bug come from ?

Component is :
<lightning:dualListbox name="multipleOptions"  
                                       sourceLabel="Corbeille" 
                                       selectedLabel="Affiché" 
                                       options="{!v.listOptions}" 
                                       value="{!v.selectedOptions}"
                                       />


<lightning:button variant="brand" 
                                      iconName="utility:save" 
                                      label="Enregistrer"
                                      title="Enregistrer"
                                      onclick="{! c.enregistrer }"/>

Controller is :
enregistrer: function(component, event, helper) {
        let service = component.find('service');
        var selectedOptionValue = component.get("v.selectedOptions");//component.get("v.selectedArray");
        var typeObj = component.get("v.typeObj");
        if(selectedOptionValue!=null && typeObj!=null){
            console.log("Option selected with value: '" + selectedOptionValue.toString() + "'");
            var actionEnregistrer = component.get("c.doSaveOrder");
            actionEnregistrer.setParams({
                tabOrderedLine : selectedOptionValue,
                typeObj :typeObj
            });
            //Setting the Callback
            actionEnregistrer.setCallback(this, function(actionResult) {
                console.log('enregistrer:setCallback');
                console.log('actionResult:'+actionResult.getReturnValue());
                if(actionResult.getReturnValue()==null){
                    service.showWarningToast('Le composant APEX ne répond pas, impossible de sauvegarder !');
                }
                else{
                    var result=actionResult.getReturnValue()[0];
                    console.log('result:'+result);
                    var resultMessage=actionResult.getReturnValue()[1];
                    console.log('resultMessage:'+resultMessage);
                    //check if result is successfull
                    if(result=='0'){
                        console.log('avant showSuccessToast');
                        service.showSuccessToast(resultMessage);
                        console.log('apres showSuccessToast');
                        helper.clickBackToConfig(component, event);
                    } else{
                        service.showWarningToast('Erreur :'+resultMessage);
                    }
                }
            });
            //adds the server-side action to the queue        
            $A.enqueueAction(actionEnregistrer);
        }
        else{
            if(selectedOptionValue==null) service.showWarningToast('Impossible de charger la selection');
            else service.showWarningToast('Le type d\'objet n\'a pas été chargé :'+typeObj);
        }
    },

APEX is:
//Sauver l'odre des options 
    @AuraEnabled
    public static List<String> doSaveOrder(List<String> tabOrderedLine, String typeObj) {
        List<id> lIdSelected = new List<id>();
        List<String> ReturnString=new List<String>();
        List<score_setting_field_mapping__c> sco_field_map_toUpdate = new List<score_setting_field_mapping__c>();
        if(tabOrderedLine.size()>0){
            String debug = '';
            score_setting_field_mapping__c[] sco_field_map;
            //Perform Operation with records (cutted)
            update sco_field_map_toUpdate;
            ReturnString.add('0');
            ReturnString.add('Sauvegarde effectuée !');
            
        }
        else{
            ReturnString.add('1');
            ReturnString.add('Vous devez modifier l\'odre d\'au moins une ligne');
        } 
        return ReturnString;
    }

​​​​​​​
Hi,

I have used a lightning:datatable and I want to format number in a column.

Today, i  my controller, I use :
{label: 'My number', fieldName: 'my_number', type: 'currency',sortable : true
},

My result is :
123,00 €

And I want to have :
123 €
=> No digit allowed after the commat.

Is there a way to do that ?

Thanks for your help,
Julien
Hi,

I'm using a lightning:datatable in a lightning component.
My controller set a column using currency :
{label: 'My label for currency', fieldName: 'my_currency_number', 
             type: 'currency',sortable : true,
             cellAttributes: { class: { fieldName: 'showClass'}}
            },
            
Today, my problem is :
I have this result : 234,00 €

And I would like to remove digits, and I would like to have this result :
234 €

How can I do that?

Thanks for your help,
Julien
Hello,

I'm creating a new salesforce package. 
I want my final user be able to configure it.
So I want to give them access to a custom page where they will be able to change setting.

My question is, where do I save this settings ? I want this setting be writable trought a visulaforce page or a lightning component.

Thanks for your help.
Hi,

Something strange happend..
 have developp an apex and a test class in Summer 2018.
Eveything was fine. Today, my class are working in production.

But today, I have re-run the test, and I have got 
"SObject row was retrieved via SOQL without querying the requested field".

But the field is in the apex class, in SOQL and test class too.

Does something happend in the last 2 release ?
Hi,

I'm using lightning:inputField, but I want only the input field, nothing else.
I have hidde the label, but I automaticaly get the helptext near the field.
And I don't want it in my component.

My code is :
<lightning:inputField fieldName="myCustomField__c" variant="label-hidden" "/>

Any Idea ?
 
Hi,

I have created this component :
<lightning:recordEditForm aura:id="edit" recordId="{!v.recordId}" 
                          objectApiName="Account" 
                          > 
    <lightning:inputField fieldName="Sales_DT__c" variant="label-hidden"/>
</lightning:recordEditForm>

Where Sales_DT__c is a lookup on User.
This field Sales_DT__c  has a value recorded : 00530000004FGcfAAG.

Before, it's was working with this old workaround : add lightning:recordViewForm in the same compoent, but it's doesn't work anymore :
<lightning:recordViewForm recordId="{!v.recordId}" 
                              objectApiName="Account" >
        <div class="slds-hidden">
            <lightning:outputField fieldName="Sales_DT__c" />
        </div>
    </lightning:recordViewForm>

I have already read this : https://developer.salesforce.com/forums#!/feedtype=SINGLE_QUESTION_SEARCH_RESULT&id=9060G0000005qTaQAI

But, I didn't found a good response.

Any idea on how to populating this lookup field when I load the component ?
 
Hi,

I have used a lightning:datatable and I want to format number in a column.

Today, i  my controller, I use :
{label: 'My number', fieldName: 'my_number', type: 'currency',sortable : true
},

My result is :
123,00 €

And I want to have :
123 €
=> No digit allowed after the commat.

Is there a way to do that ?

Thanks for your help,
Julien
Hi,

I'm using lightning:inputField, but I want only the input field, nothing else.
I have hidde the label, but I automaticaly get the helptext near the field.
And I don't want it in my component.

My code is :
<lightning:inputField fieldName="myCustomField__c" variant="label-hidden" "/>

Any Idea ?