• Mariem Mejrissi
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 1
    Replies
Hi Everyone,

Could someone please help me to get just the first value and remove other values. 
User-added image
 private void getTargetList(List<Suricat_Segment__c> segmentList, Map<String, integer> countTargetMap, Map<String, List<Suricat_Segment__c>> targets){
            Map<String, List<Suricat_Segment__c>> targetNameMap = new Map<String, List<Suricat_Segment__c>>();
            Map<String, integer>  countTarget ;
            for (Suricat_Segment__c seg : segmentList){
                if (targetNameMap.containsKey(seg.Suricat_Lever__r.Suricat_Product_Campaign__r.Name + '/' + seg.UC_promoted__c + '/' + seg.VF__c + '/' + seg.Deal_Number__c)){
                    targetNameMap.get(seg.Suricat_Lever__r.Suricat_Product_Campaign__r.Name + '/' + seg.UC_promoted__c + '/' + seg.VF__c + '/' + seg.Deal_Number__c).add(seg);
                } else{
                    targetNameMap.put(seg.Suricat_Lever__r.Suricat_Product_Campaign__r.Name + '/' + seg.UC_promoted__c + '/' + seg.VF__c + '/' + seg.Deal_Number__c, new List<Suricat_Segment__c>{ seg });
                }
               
            }
            targets.putAll(targetNameMap);
        }

 <table class="liste-offres">
            <thead>
                <tr>
                    <th class="first_th">PRODOTTO PROMOZIONATO</th>
                    <th class="first_th">CONDIZIONI SCATENANTI</th>
                    <th class="first_th">QUANTITA’ PROMOZIONATA</th>
                    <th class="first_th">VALORE FACCIALE</th>
                    <th class="last_th">CODICE VALASSIS</th>
                </tr>
            </thead>
            <tbody>
                <apex:repeat var="mapKey" value="{!campaignWrapper.targets}">
                    <tr>
                        <!-- <td class="first_td" rowspan="{!campaignWrapper.countTargetMap}"> -->
                            <td class="first_td">
                            <apex:repeat value="{!campaignWrapper.targets[mapKey]}" var="mapValue">
                                {!mapValue.Suricat_Lever__r.Suricat_Product_Campaign__r.Name}
                                <br/>
                            </apex:repeat>
                        </td>
                        <td class="first_td ">
                            <apex:repeat value="{!campaignWrapper.targets[mapKey]}" var="mapValue">
                                {!mapValue.Suricat_Lever__r.Target__c}
                                <br/>
                            </apex:repeat>
                        </td>
                        <td class="first_td">
                            <apex:repeat value="{!campaignWrapper.targets[mapKey]}" var="mapValue">
                                <apex:outputText value="{0, number, ###,###}">
                                    <apex:param value="{!mapValue.UC_promoted__c}" />
                                    <br/>
                                </apex:outputText>
                            </apex:repeat>
                        </td>
                        <td class="first_td">
                            <apex:repeat value="{!campaignWrapper.targets[mapKey]}" var="mapValue">
                                <apex:outputText value="{!mapValue.VF__c}" />
                                <br/>
                            </apex:repeat>
                        </td>
                        <td class="last_td">
                            <apex:repeat value="{!campaignWrapper.targets[mapKey]}" var="mapValue">
                                <br/>
                                <apex:outputText value="{!mapValue.Deal_Number__c}" />
                            </apex:repeat>
                        </td>
                    </tr>
                </apex:repeat>
            </tbody>
        </table>
Hi everyone ! 
How can I fix this problem 
User-added imageUser-added imageAny Help Please !! 
Hi everyone, 
My problem is that mediaSupport return false and the camera still not streaming. How can I fix that ? 
 startStreaming: function() {
        const mediaSupport = 'mediaDevices' in navigator;
        if (mediaSupport && null == this.camera.cameraStream) {
           navigator.mediaDevices.getUserMedia({ audio: false, video: {facingMode: 'environment' } })
                .then((mediaStream) => {
                    this.camera.cameraStream = mediaStream;
                    this.camera.stream.srcObject = mediaStream;
                    this.camera.stream.play();
                })
                .catch(function (err) {
                    console.error(err);
                });
        } else {
            alert('Your browser does not support media devices.');
            return;
        }
    },
 
Hii ! I try to develop Kanban-Lightning-component and how can I declare objLabel in component because is not declared 
https://github.com/sfdcbox/Kanban-Lightning-component
I have to create the login page with User name and password in lightning 

I have created the fields, but I have this error when I enter invalid password or username.

This page has an error. You might just need to refresh it. Error in $A.getCallback() [Cannot read property 'login__c' of null] Callback failed: apex://LoginController/ACTION$getressource Failing descriptor: {markup://c:login}

Can you please help me in this.

Login controller.js
({
    doInit : function(component, event, helper) {
        
    },
    
 
    loginPage : function(component, event, helper) {
         var userid = component.get("v.Empiduser"); 
        var pass= component.get("v.Empidpwd");
        
        var action = component.get("c.getressource");
        
            action.setParams({
              username:userid,
              userpassw:pass
        });
    
         action.setCallback(this,function(response){  
           if($A.util.isEmpty(userid ) || $A.util.isUndefined(userid )){
            alert('Please Enter User Name!');
          return ;
        }   
          if($A.util.isEmpty(pass) || $A.util.isUndefined(pass)){
            alert('Please Enter Password!');
           return;
        } 
        var login= response.getReturnValue().login__c ;
          var password= response.getReturnValue().password__c;
         var role= response.getReturnValue().Role__c;
             
          
             if (login==userid && password==pass &&role=="Scrum Master")
              {
           const myEvent = component.getEvent('firstEvent');
            myEvent.setParams({ username: userid });
            myEvent.fire();
              }
             else if ((login==userid && password==pass &&role=="Developer"))
             {
                 const myEvent = component.getEvent('firstEvent');
            myEvent.setParams({ username: userid });
            myEvent.fire();
             }
             else if ((login==userid && password==pass &&role=="Product Owner"))
             {
                 const myEvent = component.getEvent('firstEvent');
            myEvent.setParams({ username: userid });
            myEvent.fire();
             }
             
             else 
             {
                 
                 alert("echec");
             }
         
          });
         $A.enqueueAction(action);
        
      
    },   
         
    
   
})
class Apex

public class LoginController {
    @auraEnabled
    public static Ressource__c getressource(String username,String userpassw ){
       return ([SELECT login__c,Name,password__c,Role__c,Tel__c FROM Ressource__c where login__c=:username and password__c=: userpassw]);
    }
 
    
}
Regards,
Mariem 
Hello everyone! 

VALUE(TEXT( FLOOR(heure_fin__c - heure_debut__c) ) & TEXT( ROUND(MOD((heure_fin__c - heure_debut__c)*24,24),0)) & TEXT( ROUND( MOD((heure_fin__c - heure_debut__c)*1440,60) ,0)))

I create this formula field to calculate the number of days, hours and minutes But I want to separate them by a symbol like ","

What must be the solution here? 
Hii ! I try to develop Kanban-Lightning-component and how can I declare objLabel in component because is not declared 
https://github.com/sfdcbox/Kanban-Lightning-component