• fadwa mangoug
  • NEWBIE
  • 40 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 9
    Replies
Hey,

Im trying to display maps in a visualforce page but the method that builds the map doesnt seem to be called when i preview my page. I would appreciate some help please :)

Here's my map : 

public map<string,string> getMapFieldLabel(){
        
        //List<string> fieldsLabels = new List<string>();
        List<Custom_Object__c> defaultFields = [Select Name from Custom_Object__c where Default__c=True];
        Map<String, Schema.SObjectField> typeMap = Schema.SObjectType.A_second_Custom_Object__c.fields.getMap();
          
        //Get choosen default fields label    
        for(Custom_Object__c defaultField : defaultFields) {
            
            Schema.SObjectField field = typeMap.get(defaultField.Name);
            string fieldLabel =field.getDescribe().getLabel();
            mapFieldLabel.put(defaultField.Name, fieldLabel);
            //fieldsLabels.add(fieldLabel);
            
            
        }
        system.debug(mapFieldLabel);
        return mapFieldLabel;
        
    }

And my VF code : 

         <apex:pageBlockSection columns="3" collapsible="true">
                
            <apex:repeat value="{!MapFieldLabel}" var="item" >
                    
                    <apex:repeat value="{!MapFieldLabel[item]}" var="itemvalue" >                    
                    <apex:outputText value="{!itemvalue}" />
                    </apex:repeat>
            </apex:repeat>   
            </apex:pageBlockSection>

This code doesnt display anything on screen !

Thank you for your help in advance :)
I am working on an analysis in order to merge two Salesforce organizations.
I am having an issue with List Views, their settings (filters, visibility, accessibility) : Is it possible to extract list views as metadata ? 

And I would like to know what is the "Access" standard object in Salesforce.

I would appreciate the help,

Thanks in advance, 

Fadwa
Hey there everyone, 

Im having trouble with my apex code, that had been working before the winter release, and it's been a week now that it's not anymore. i have an error in my log saying : "the number of constructors during runtime and compile time for java.lang.Exception do not match".

Knowing that the Apex code didn't change since, does this have anything to do with some java updates that Sf might have added ?

Thank for ur help in advance,

Fadwa
Helloo everyone, 

I'm using canvas and trying this method " Sfdc.canvas.oauth.login " in my php code, but I get this error : error=redirect_uri_mismatch&error_description=redirect_uri%20must%20match%20configuration

The callback url im using in the one refering to my php app, is it the right one ? 

Any suggestion would help :)

Thanks in advance !
Hey everyone, 

Im new to using canvas, and JS canvas Library.
Im trying to connect an app coded in PHP to my salesforce org and canvas.
For that im trying to use some JS code in my php. 
What I need is getting Salesforce Session ID using Salesforce JS canvas methods. Problem is : i have no clue how to do it, I've been looking all over the web and found no solution.

Can anyone help ?

Thanks in advance :)
hey everyone, 

I m strating with Lightning components and I need to do something like this : (in Visualforce page)

<apex:inputField label="Client" value="{!Opportunity.client__c}"  style="width:70%;"/> <br/>

With lightning i tried this : 

<ui:inputSelect aura:id="client" label="client"
                                          class="slds-input"
                                          labelClass="slds-form-element__label"
                                          value="{!v.opportunity.client__c}"/>

But the list doesn't display the picklist values when its with lightning components !

Anyone can help please ? 

Thanks !
hello there,

I would like to know if it's possible to control access to account fields according to a user territory ?

I know that we can do that with users profiles but have no clue for the territories.

Thanks a lot for ur help :) 
Hey there !

I'm having trouble converting numbers from US Format to Europe Format.
I want to convert someting like : 1,000,000.555 to 1000000,555 
So in an VF Page I have a script and tried this for now doesnt seem to work for the decimal  part and i just convert the comma part for thousands :

value = 1,000,000.555
var regex = new RegExp(',', 'g');
value = parseFloat(value.replace(regex,'').replace(/\./g, ','));


the first replace works but not the second one 

I would really appreciate some help !

Thanks in advance !

Fadwa.
Hey there !
I'm having trouble with a method and can use some help plz !
So here's what I'm trying to do :
My method should give me the ID of an object when i use its name, for now i have this but it's not working, I have an error : " Method does not exist or incorrect signature: [Schema.DescribeSObjectResult].get()"
public integer TargetID() {
      
       
        Schema.SObjectType sobjectType = Name.getSObjectType();
        Integer sobjectId = sobjectType.getDescribe().get();
  SObject record = Database.query('Select Id From ' + sobjectId + ' Where Name = :Name');
   
    }

The problem is with the get(), I know it works with names but not with ID's.

Thanks in advance for the help :) !
Hey again,
I have another question concerning the tests but this time its about test methods for classes using a standard controller; I managed to write this part of the class test for now and it only gives me 60% code coverage. Do you plz have any idea how to improve it.

Apex class :

public class feedbackStatuts {
    public String feedback_status {get; set;}
    private String status;
   
      
  
    public feedbackStatuts(ApexPages.StandardController stdController) {
         
         //Initialisation de variables
         feedback_status = '';
         status = ApexPages.currentPage().getParameters().get('Feedback_statut__c');   
         
         if (status=='New'){
             status='Assigned';
   } else if (status=='Assigned'){
             status='Assigned to editor';
            } else if (status=='Assigned to editor'){
             status='Information Needed';
            } else if (status=='Information needed'){
             status='Effort estimation';
            } else if (status=='Effort estimation'){
             status='Will not fix';
            } else if (status=='Will not fix'){
             status='Resolved';
            }else if (status=='Resolved'){
             status='Delivered';
            }else if (status=='Delivered'){
             status='Closed';
            }
         
          
     }
   
   
   
}


And the test class that I've written for now is like :

@isTest
public class feedbackStatutsTest {
   
    static testMethod void feedbackStatutsTest() {
       
       Feedbacks__c f = new Feedbacks__c(Name = 'trial',Feedback_statut__c='New');
        System.debug('Feedback status before change ' + f.Feedback_statut__c);
        Insert f;
       
   Test.StartTest();
       
        //set the test's page to the VF page
        PageReference pageRef = Page.change_status;
        Test.setCurrentPage(pageRef);
       
        //Call the constructor
        ApexPages.StandardController sc = new ApexPages.StandardController(f);
        feedbackStatuts controller = new feedbackStatuts(sc);
        
        //test action methods on the controller
        string statut = f.Feedback_statut__c;
        system.assertEquals(statut, 'Assigned');
   
     
        Test.StopTest();
        delete f;

    }
}


Thanks for the help :) !
hey there,
I've just stated using salesforce and apex and I'd like to have some help with my testing methods. If anyone can helpl plz i'd be gratefull !
Here's the visualforce page code  :

<apex:page controller="progress_bar">
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/>
   <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
   <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
 <apex:pageblock title="Feedbacks by Severity">
        <form>     
      <center>
             <br/> <br/> <br/> <br/>
                <div class="progress">
                    <div class="progress-bar progress-bar-striped progress-bar-success" role="progressbar" style="width:35%">
                        {!Normal} Normal
                    </div>
                   
                    <div class="progress-bar progress-bar-striped active progress-bar-warning" role="progressbar" style="width:20%">
                        {!Blocking} Blocking
                    </div>
                   
                    <div class="progress-bar progress-bar-striped progress-bar-danger" role="progressbar" style="width:20%">
                        {!Urgent} Urgent
                    </div>
                 </div>
          </center>
  </form>
     <style>
            .progress {
            color : white;
            font-weight : bold;
            font-size : 100%;
           
            }
     </style>
 </apex:pageblock>
</apex:page>


and the apex class used :

public class progress_statut {

    public integer getNew(){
        return [select count() from feedbacks__c where Feedback_statut__c='New'];
    }
  
 public integer getAssigned(){
        return [select count() from feedbacks__c where Feedback_statut__c='Assigned'];
    }
    public integer getAssignedEditor(){
        return [select count() from feedbacks__c where Feedback_statut__c='Assigned to Editor'];
    }
 public integer getInformationNeeded(){
        return [select count() from feedbacks__c where Feedback_statut__c='Information Needed'];
    }
 
    public integer getEffortEstimation(){
        return [select count() from feedbacks__c where Feedback_statut__c='Effort Estimation'];
    }
     public integer getwillnotfix(){
        return [select count() from feedbacks__c where Feedback_statut__c='Will not fix'];
    }
    public integer getresolved(){
        return [select count() from feedbacks__c where Feedback_statut__c='Resolved'];
    }
    public integer getdelivered(){
        return [select count() from feedbacks__c where Feedback_statut__c='Delivered'];
    }
    public integer getclosed(){
        return [select count() from feedbacks__c where Feedback_statut__c='Closed'];
    }
}


Thanks for the help in advance !!


 
Hey,

Im trying to display maps in a visualforce page but the method that builds the map doesnt seem to be called when i preview my page. I would appreciate some help please :)

Here's my map : 

public map<string,string> getMapFieldLabel(){
        
        //List<string> fieldsLabels = new List<string>();
        List<Custom_Object__c> defaultFields = [Select Name from Custom_Object__c where Default__c=True];
        Map<String, Schema.SObjectField> typeMap = Schema.SObjectType.A_second_Custom_Object__c.fields.getMap();
          
        //Get choosen default fields label    
        for(Custom_Object__c defaultField : defaultFields) {
            
            Schema.SObjectField field = typeMap.get(defaultField.Name);
            string fieldLabel =field.getDescribe().getLabel();
            mapFieldLabel.put(defaultField.Name, fieldLabel);
            //fieldsLabels.add(fieldLabel);
            
            
        }
        system.debug(mapFieldLabel);
        return mapFieldLabel;
        
    }

And my VF code : 

         <apex:pageBlockSection columns="3" collapsible="true">
                
            <apex:repeat value="{!MapFieldLabel}" var="item" >
                    
                    <apex:repeat value="{!MapFieldLabel[item]}" var="itemvalue" >                    
                    <apex:outputText value="{!itemvalue}" />
                    </apex:repeat>
            </apex:repeat>   
            </apex:pageBlockSection>

This code doesnt display anything on screen !

Thank you for your help in advance :)
I am working on an analysis in order to merge two Salesforce organizations.
I am having an issue with List Views, their settings (filters, visibility, accessibility) : Is it possible to extract list views as metadata ? 

And I would like to know what is the "Access" standard object in Salesforce.

I would appreciate the help,

Thanks in advance, 

Fadwa
Hey everyone, 

Im new to using canvas, and JS canvas Library.
Im trying to connect an app coded in PHP to my salesforce org and canvas.
For that im trying to use some JS code in my php. 
What I need is getting Salesforce Session ID using Salesforce JS canvas methods. Problem is : i have no clue how to do it, I've been looking all over the web and found no solution.

Can anyone help ?

Thanks in advance :)
Hey there !

I'm having trouble converting numbers from US Format to Europe Format.
I want to convert someting like : 1,000,000.555 to 1000000,555 
So in an VF Page I have a script and tried this for now doesnt seem to work for the decimal  part and i just convert the comma part for thousands :

value = 1,000,000.555
var regex = new RegExp(',', 'g');
value = parseFloat(value.replace(regex,'').replace(/\./g, ','));


the first replace works but not the second one 

I would really appreciate some help !

Thanks in advance !

Fadwa.
hey there,
I've just stated using salesforce and apex and I'd like to have some help with my testing methods. If anyone can helpl plz i'd be gratefull !
Here's the visualforce page code  :

<apex:page controller="progress_bar">
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/>
   <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
   <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
 <apex:pageblock title="Feedbacks by Severity">
        <form>     
      <center>
             <br/> <br/> <br/> <br/>
                <div class="progress">
                    <div class="progress-bar progress-bar-striped progress-bar-success" role="progressbar" style="width:35%">
                        {!Normal} Normal
                    </div>
                   
                    <div class="progress-bar progress-bar-striped active progress-bar-warning" role="progressbar" style="width:20%">
                        {!Blocking} Blocking
                    </div>
                   
                    <div class="progress-bar progress-bar-striped progress-bar-danger" role="progressbar" style="width:20%">
                        {!Urgent} Urgent
                    </div>
                 </div>
          </center>
  </form>
     <style>
            .progress {
            color : white;
            font-weight : bold;
            font-size : 100%;
           
            }
     </style>
 </apex:pageblock>
</apex:page>


and the apex class used :

public class progress_statut {

    public integer getNew(){
        return [select count() from feedbacks__c where Feedback_statut__c='New'];
    }
  
 public integer getAssigned(){
        return [select count() from feedbacks__c where Feedback_statut__c='Assigned'];
    }
    public integer getAssignedEditor(){
        return [select count() from feedbacks__c where Feedback_statut__c='Assigned to Editor'];
    }
 public integer getInformationNeeded(){
        return [select count() from feedbacks__c where Feedback_statut__c='Information Needed'];
    }
 
    public integer getEffortEstimation(){
        return [select count() from feedbacks__c where Feedback_statut__c='Effort Estimation'];
    }
     public integer getwillnotfix(){
        return [select count() from feedbacks__c where Feedback_statut__c='Will not fix'];
    }
    public integer getresolved(){
        return [select count() from feedbacks__c where Feedback_statut__c='Resolved'];
    }
    public integer getdelivered(){
        return [select count() from feedbacks__c where Feedback_statut__c='Delivered'];
    }
    public integer getclosed(){
        return [select count() from feedbacks__c where Feedback_statut__c='Closed'];
    }
}


Thanks for the help in advance !!