• Aniqaaa
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 12
    Replies

Dear All,

 

Could somone please tell me if the code I have explained is correct and detailed enough?? From reading the description does the code make sense. If you could add to it I would really appreciate.

public List<SelectOption> getObjectValues(){

        List<SelectOption> optionList = new List<SelectOption>();

        optionList.add(new SelectOption('None' ,'None'));

        List<String> entities = new List<String>(schemaMap.keySet());

        entities.sort();           

            for(String eachobj: entities){

                optionList.add(new SelectOption(eachobj ,eachobj));

            }  return optionList;

To get object values a select option method was written. The schema map gets all schema objects. This is then added into the option list. Each object was added where the entities came from the schema map and then all objects came into the option list. Finally the option list was returned to see the objects on the VF page.      

 

 

Thanks

 

 

Aniqa

static resourse data table does not exist, check spelling

 

It does not highlight anything in the code and I changed the spelling as well

 

thanks

hi guys,

I am trying to deploy but have the following issue:

reason: com,salesforce,ide.api.metadata.types.................

 

This happens in Step 3 of Step 4 in the deployment plan.


I am deploying the first time, it might be some silly mistake, I would really appreciate if you could help me :)

 

thanks

 

 

anika

Hi,

 

could anyone guide me of how to make deployments. I have the name of sandbox, where I need to deploy it to.
Do I use eclipse? How can I make sure that the test coverage is the same in deployment as in my own sandbox?

 

Thanks

 

 

Anika

Hi Guys,

 

I am doing a Project, for better understanding I am trying to find out "What is the link between the class diagram and Salesforce Schema Builder? "

 

So far, I know that:

Class diagram:

 

  • Describing the static view of the system.
  • Showing the collaboration among the elements of the static view.
  • Describing the functionalities performed by the system.
  • Construction of software applications using object oriented languages.
  • Analysis and design of the static view of an application.

  • Describe responsibilities of a system.

  • Base for component and deployment diagrams.

  • Forward and reverse engineering.

     

    Salesforce Schema Builder:

     

    The Schema Builder makes it easier to visualize my objects, fields and relationships in an interactive Entity Relationship Diagram (ERD).
    It shows the follows:

    • Objects and fields
    • Relationships between objects (standard and custom)
    • Differentiate between master-detail and lookup relationships at a glance
    • Switch views between labels and API names


    To launch Schema Builder, go to Setup → App Setup → Schema Builder.

     

     

    But how are the linked in any ways??

     

    I would really appreciate your help guys :)

     

    Anika

Hi Guys,

 

I am doing a Project, for better understanding I am trying to find out "What is the link between the class diagram and Salesforce Schema Builder? "

 

So far, I know that:

Class diagram:

 

  • Describing the static view of the system.
  • Showing the collaboration among the elements of the static view.
  • Describing the functionalities performed by the system.
  • Construction of software applications using object oriented languages.
  • Analysis and design of the static view of an application.

  • Describe responsibilities of a system.

  • Base for component and deployment diagrams.

  • Forward and reverse engineering.

     

    Salesforce Schema Builder:

     

    The Schema Builder makes it easier to visualize my objects, fields and relationships in an interactive Entity Relationship Diagram (ERD).
    It shows the follows:

    • Objects and fields
    • Relationships between objects (standard and custom)
    • Differentiate between master-detail and lookup relationships at a glance
    • Switch views between labels and API names


    To launch Schema Builder, go to Setup → App Setup → Schema Builder.

     

     

    But how are the linked in any ways??

     

    I would really appreciate your help guys :)

     

    Anika

Hi Guys,

 

I am doing a Project, for better understanding I am trying to find out "What is the link between the class diagram and Salesforce Schema Builder? "

 

So far, I know that:

Class diagram:

 

  • Describing the static view of the system.
  • Showing the collaboration among the elements of the static view.
  • Describing the functionalities performed by the system.
  • Construction of software applications using object oriented languages.
  • Analysis and design of the static view of an application.

  • Describe responsibilities of a system.

  • Base for component and deployment diagrams.

  • Forward and reverse engineering.

     

    Salesforce Schema Builder:

     

    The Schema Builder makes it easier to visualize my objects, fields and relationships in an interactive Entity Relationship Diagram (ERD).
    It shows the follows:

    • Objects and fields
    • Relationships between objects (standard and custom)
    • Differentiate between master-detail and lookup relationships at a glance
    • Switch views between labels and API names


    To launch Schema Builder, go to Setup → App Setup → Schema Builder.

     

     

    But how are the linked in any ways??

     

    I would really appreciate your help guys :)

     

    Anika

Hi Guys,

 

I need to make the UI (front end) look better.
I have been told to use "plugins of js or jQuery". I am new to Salesforce and have not an idea of what I need to do and where I get this plugin from?

 

Could someone please guide me and start me off?

 

Thanks

 

Anika

Hello Guys,

 

I am new to Salesforce and would like to know if someone could tell me how to carry out uni tests?

 

I have got some idea: but not sure where, how and what to do the test on exactly

 

@isTest

public class AccountInvoicerTest

{

public static testMethod void TestInvoiceAccount()

 {

Test.startTest();

Test.stopTest();

  }

system.assert();

system.assertequals();

 

Helo would be much appreciated :)

 

Thanks

Hello Guys,

 

I am a System Admin, but have this issue when I select Profiles:


Insufficient Privileges You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.

 

My code seems to be correct. Any advise will be appreciated.

 

Thanks

 

Anikaa

Does the code need to be put in a Controller class?
It doesnt seem to work could someone please help?



String qry = 'select Id,Name from Account where ....';
ApexPages.StandardSetController  acct = new ApexPages.StandardSetController(Database.getQueryLocator(qry));

Here is some example code


public class EnumeratedValues {

public enum OpportunityEnum {Object1, Object2}
}

public with sharing class OppReporting {

      //iterators
      public ApexPages.StandardSetController object1{get; set;}
      public ApexPages.StandardSetController object2{get; set;}
    
      //the current page number for each object
      public integer object1Pg{get; set;}
      public integer object2Pg{get; set;}
    
      //display results
      public List<Opportunity> object1Return {get;set;}
      public List<Opportunity> object2Return {get;set;}

      //number of records to display comes from a custom setting
      public integer numberRecordsToDisplay{get;set;}
      public string setRecordsToDisplay{get;set;}
    
      //pages to display for Task
      public list<integer> object1StatusPagesToDisplay{get;set;}
      public integer selectedPageObject1{get;set;}
    
      //pages to display for object2 summary
      public list<integer> object2PagesToDisplay{get;set;}
      public integer selectedPageObject2{get;set;}

      private Set<Id> newIDsSet;
      public Map<ID,ID> object1IdToTaskID{get; set;}
      public ID selectedObject1{get; set;}
    
      //public Set<String> subjects;
      public list<Opportunity> opps{get; set;}
    
      //max pages to dislay
      public long numberOfPagesToDisplayObject1{get; set;}
      public long numberOfPagesToDisplayObject2{get; set;}
                
      public list<object1List> allObject1List{get;set;}{allObject1List = new list<object1List>();}
      public list<object2List> allObject2List{get;set;}{allObject2List = new list<object2List>();}
               
      public OppReporting(){    
            //get the number of records to display on each page
                  numberRecordsToDisplay = 10;          
      }

      //Task Navig
      public void moveToPageObject1() {
            object1.setPageNumber(selectedPageObject1);
            object1Pg = object1.getPageNumber();
            refreshOutput(EnumeratedValues.OpportunityEnum.Object1,object1);
      }

      //Object2 Summary Navig
      public void moveToPageObject2() {
            object2.setPageNumber(selectedPageObject2);
            object2Pg = object2.getPageNumber();
            refreshOutput(EnumeratedValues.OpportunityEnum.Object2,object2);
      }
    
      public PageReference doSearch() {
            integer numberRecordsToDisplayTemp;//if this is not used numberRecordsToDisplay gets permanently set so user can only increase records per page not decrease
            if (setRecordsToDisplay != null && setRecordsToDisplay != '')
                  numberRecordsToDisplayTemp = integer.valueof(setRecordsToDisplay);
            else
                  numberRecordsToDisplayTemp = numberRecordsToDisplay;
                      
            //1st object
            String qry;     
            //NOTE - Product2__c will have to change to Product2
            integer rowlimit = limits.getLimitQueryRows();

            qry = 'select Id,Primary_Agency_Buyer__c,Account.Name,Name from Opportunity limit :rowlimit';
          
            //get number of records
            list<Opportunity> object1AllRecords = Database.query(qry);

            //get number of pages to display        
            decimal numberOfPagesToDisplay = decimal.valueof(object1AllRecords.size()) / decimal.valueof(numberRecordsToDisplayTemp);
                      
            //round up
            numberOfPagesToDisplayObject1 = numberOfPagesToDisplay.round(ROUNDMODE);
          
            object1StatusPagesToDisplay = new list<integer>();

            //produce list of pages to display
            for (integer i = 1;i<=numberOfPagesToDisplayObject1;i++){
                  object1StatusPagesToDisplay.add(i);
            }
                      
            //need to get into iterator so Prev and Next buttons work on same data
            object1 = new ApexPages.StandardSetController(Database.getQueryLocator(qry));
            object1.setPageSize(numberRecordsToDisplayTemp);
          
            //query the data to display
            refreshOutput(EnumeratedValues.OpportunityEnum.Object1,object1);
          

            //used to render correct section
            object1Pg=1;
          
            //2nd object
                              qry = 'select Id,Primary_Agency_Buyer__c,Primary_Agency_Buyer__r.Name,Name,Sum_Total_Price_del__c, Third_party_Stats_checked__c from Opportunity limit :rowlimit';
                
            //get number of records
            list<Opportunity> object2AllRecords = Database.query(qry);
          
            //get number of pages to display
            integer object2AllSize = object2AllRecords.size();
            decimal numberOfPagesToDisplay2 = decimal.valueof(object2AllSize) / decimal.valueof(numberRecordsToDisplayTemp);
                      
            //round up
            numberOfPagesToDisplayObject2 = numberOfPagesToDisplay2.round(ROUNDMODE);
            object2PagesToDisplay = new list<integer>();

            //produce list of pages to display
            for (integer i = 1;i<=numberOfPagesToDisplayObject2;i++){
                  object2PagesToDisplay.add(i);
            }
                      
            //need to get into iterator so Prev and Next buttons work on same data
            object2 = new ApexPages.StandardSetController(Database.getQueryLocator(qry));
            object2.setPageSize(numberRecordsToDisplayTemp);
          
            //query the data to display
            refreshOutput(EnumeratedValues.OpportunityEnum.Object2,object2);
          
                
            //used to render correct section
            object2Pg=1;    
                
            return null;
      }

      public void refreshOutput(EnumeratedValues.OpportunityEnum OpportunityEnumType,ApexPages.StandardSetController std){
            newIDsSet = new Set<Id>();
            for (sObject eachRec : (List<sObject>)std.getRecords())
                  newIDsSet.add((ID)eachRec.get('id'));
          
            system.debug('size refreshOutput ' + newIDsSet.size());
            Task[] allTks;
            OpportunityLineItem[] thisopplines;
            if (OpportunityEnumType ==  EnumeratedValues.OpportunityEnum.Object1){
                  object1Return = [select Id,Primary_Agency_Buyer__c,Account.Name,Name from Opportunity where Id In :newIDsSet];

            //Build list of object1List wrappers to easily display on page
            object1List newObject1List;
            allObject1List.clear();
            for (Opportunity eachopp: object1Return){
                  allTks=eachopp.Tasks;
                  thisopplines = eachopp.OpportunityLineItems;
                  for (OpportunityLineItem eachoppline: eachopp.OpportunityLineItems){
                        newObject1List = new object1List(<<Add each value to wrapper class>>);
                        allObject1List.add(newObject1List);
                  }
            }
            }else if (OpportunityEnumType ==  EnumeratedValues.OpportunityEnum.Object2){
                  object2Return = [select Id,Primary_Agency_Buyer__c,Account.Name,Name,Sum_Total_Price_del__c,Campaign_Start_Date__c,Campaign_End_Date__c,Complexity__c,Complexity_explanation__c, Third_party_Stats_checked__c from Opportunity where Id In :newIDsSet];

                                                                            
                        thisopplines = eachopp.OpportunityLineItems;
                        for (OpportunityLineItem eachoppline: eachopp.OpportunityLineItems){

                              newObject2List = new object2List((<<Add each value to wrapper class>>);
                              allObject2List.add(newObject2List);
                        }
                  }
    
            }
      }
    
    

    
      public class object1List{
            public object1List(String addID, …){
                  this.thisID=addID;
                  <<Add more>>
            }
          
            public String thisID{get;set;}
            <<Add more>>
      }
    
      public class object2List{
            public object2List(String addID, … ){
                  this.thisID=addID;
<<Add more>>          
}
          
          
            public String thisID{get;set;}
            <<Add more>>
      }   
}



<apex:page>
         <apex:outputPanel rendered="{!object1StatusDisplay}" >
              <p>&nbsp;</p>
               <apex:outputlabel styleclass="largeTitle">object1 Section</apex:outputlabel>
              <p>&nbsp;</p>
            
              <apex:outputPanel id="currentobject1Page" >
                <apex:outputlabel >Current Page {!object1Pg}</apex:outputlabel>
              </apex:outputPanel>
            
              <apex:pageBlockSection >
                    <apex:pageBlockTable var="object1Rec" value="{!allobject1List}" >
                        <apex:column headerValue="Agency">
                            <apex:commandLink target="_blank" action="/{!object1Rec.thisID}" value="{!object1Rec.thisAgency}"/>
                        </apex:column>
                    </apex:pageBlockTable>
                  
             </apex:pageBlockSection>

                   
             <apex:commandLink styleclass="rightspace" action="{!moveToPageobject1}" >First
                        <apex:param name="selectedPageobject1" assignTo="{!selectedPageobject1}" value="1" />
             </apex:commandlink>
             <apex:commandLink styleclass="rightspace" action="{!moveToPageobject1}" >Previous
               <apex:param name="selectedPageobject1" assignTo="{!selectedPageobject1}" value="{!selectedPageobject1 - 1}" />
            </apex:commandlink>
             <apex:commandLink styleclass="rightspace" action="{!moveToPageobject1}" >Next
               <apex:param name="selectedPageobject1" assignTo="{!selectedPageobject1}" value="{!selectedPageobject1 + 1}" />
            </apex:commandlink>
             <apex:commandLink styleclass="rightspace" action="{!moveToPageobject1}" >Last
               <apex:param name="selectedPageobject1" assignTo="{!selectedPageobject1}" value="{!numberOfPagesToDisplayobject1}" />
            </apex:commandlink>
             <br />
             <apex:outputPanel layout="block" styleclass="scrollNavig">
                         <apex:repeat value="{!object1StatusPagesToDisplay}" var="pgs" >
                            <apex:commandLink styleclass="rightspace" id="object1Link" action="{!moveToPageobject1}" >{!pgs}
                                <apex:param name="selectedPageobject1" assignTo="{!selectedPageobject1}" value="{!pgs}" />
                            </apex:commandlink>
                         </apex:repeat>
             </apex:outputPanel>
        </apex:outputPanel>

        <apex:outputPanel rendered="{!object2Display}" >
             <p>&nbsp;</p>
             <apex:outputlabel styleclass="largeTitle">object2  Section</apex:outputlabel>
             <p>&nbsp;</p>
      
              <apex:outputPanel id="currentobject2Page" >
                <apex:outputlabel >Current Page {!object2Pg}</apex:outputlabel>
              </apex:outputPanel>
            
              <apex:pageBlockSection >
                    <apex:pageBlockTable var="object2Rec" value="{!allobject2List}" >
                        <apex:column headerValue="Agency">
                            <apex:commandLink target="_blank" action="/{!object2Rec.thisID}" value="{!object2Rec.thisAgency}"/>
                        </apex:column>
                        <apex:column headerValue="ID">
                            <apex:outputLabel value="{!object2Rec.thisID}"/>
                        </apex:column>
                    </apex:pageBlockTable>
                  
             </apex:pageBlockSection>
                   
             <apex:commandLink styleclass="rightspace" action="{!moveToPageobject2}" >First
                        <apex:param name="selectedPageobject2" assignTo="{!selectedPageobject2}" value="1" />
             </apex:commandlink>
             <apex:commandLink styleclass="rightspace" action="{!moveToPageobject2}" >Previous
               <apex:param name="selectedPageobject2" assignTo="{!selectedPageobject2}" value="{!selectedPageobject2 - 1}" />
            </apex:commandlink>
             <apex:commandLink styleclass="rightspace" action="{!moveToPageobject2}" >Next
               <apex:param name="selectedPageobject2" assignTo="{!selectedPageobject2}" value="{!selectedPageobject2 + 1}" />
             </apex:commandlink>
             <apex:commandLink styleclass="rightspace" action="{!moveToPageobject2}" >Last
               <apex:param name="selectedPageobject2" assignTo="{!selectedPageobject2}" value="{!numberOfPagesToDisplayobject2}" />
             </apex:commandlink>
             <br />
           
             <apex:outputPanel layout="block" styleclass="scrollNavig">
                         <apex:repeat value="{!object2PagesToDisplay}" var="pgs" >
                            <apex:commandLink styleclass="rightspace" action="{!moveToPageobject2}" >{!pgs}
                                <apex:param name="selectedPageobject2" assignTo="{!selectedPageobject2}" value="{!pgs}" />
                            </apex:commandlink>
                         </apex:repeat>
                     </apex:outputPanel>
        </apex:outputPanel>

    </apex:outputPanel>
</apex:form>
</apex:pageBlock>


</apex:page>

Hey Guys,

I need to get Object Permissions then build a Map doing something like
'<Parent__r.ProfileId, ObjectPermissions>
         map<Id, ObjectPermissions[]>'

 

I have wriiten a piece of code below, but becasue I am new I don't think its doing anything.

 

 

Also follwoing the data model on http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_erd_profile_permissions.htm

the code below seems to be not following the diagram.

 

//get objPerms  then build Map<Parent__r.ProfileId, ObjectPermissions>
         // map<Id, ObjectPermissions[]>
    //from ObjectPermissions Parent__r.ProfileId in the set
    map<Id, ObjectPermissions[]> mapProfileIdtoObjectPermissions = new map<Id, ObjectPermissions[]>();
    for(PermissionSet PS : [SELECT Id, ProfileId,
    (SELECT Id,  //Whichever other fields I may need
        FROM ObjectPermissions) // could have issue with ObjectPermissions, I need to get correct child name
        FROM PermissionSet
        WHERE ProfileId IN: profileIds]){
    //we check whether the key has already been put to the map, if not, we perform a put
    if(mapProfileIdtoObjectPermissions.get(PS.ProfileId) == null)
        mapProfileIdtoObjectPermissions.put(PS.ProfileId, new list<ObjectPermissions>{PS.ObjectPermissions});
    // else, the key has already been put, so we just add all ObjectPermissions that are related to this ProfileId
    else
        mapProfileIdtoObjectPermissions.get(PS.ProfileId).addAll(PS.ObjectPermissions);
}

 

 

 

If someone could help by finishing of the code I would appreciate there I am new to Apex.

 

 

Thanks

Hey Guys,

I need to get Object Permissions then build a Map doing something like
'<Parent__r.ProfileId, ObjectPermissions>
         map<Id, ObjectPermissions[]>'

 

I have wriiten a piece of code below, but the error says (SELECT Id,  //Whichever other fields I may need

SELECT is an unexpected token

 

 

Also follwoing the data model on http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_erd_profile_permissions.htm

the code below seems to be not following the diagram.

 

//get objPerms  then build Map<Parent__r.ProfileId, ObjectPermissions>
         // map<Id, ObjectPermissions[]>
    //from ObjectPermissions Parent__r.ProfileId in the set
    map<Id, ObjectPermissions[]> mapProfileIdtoObjectPermissions = new map<Id, ObjectPermissions[]>();
    for(PermissionSet PS : [SELECT Id, ProfileId
    (SELECT Id,  //Whichever other fields I may need
        FROM ObjectPermissions) // could have issue with ObjectPermissions, I need to get correct child name
        FROM PermissionSet
        WHERE ProfileId IN: profileIds]){
    //we check whether the key has already been put to the map, if not, we perform a put
    if(mapProfileIdtoObjectPermissions.get(PS.ProfileId) == null)
        mapProfileIdtoObjectPermissions.put(PS.ProfileId, new list<ObjectPermissions>{PS.ObjectPermissions});
    // else, the key has already been put, so we just add all ObjectPermissions that are related to this ProfileId
    else
        mapProfileIdtoObjectPermissions.get(PS.ProfileId).addAll(PS.ObjectPermissions);
}

 

 

 

If someone could help I would appreciate there I am noew to Salesforce and its programming language.

 

 

Thanks

static resourse data table does not exist, check spelling

 

It does not highlight anything in the code and I changed the spelling as well

 

thanks

Hi,

 

could anyone guide me of how to make deployments. I have the name of sandbox, where I need to deploy it to.
Do I use eclipse? How can I make sure that the test coverage is the same in deployment as in my own sandbox?

 

Thanks

 

 

Anika

Hi Guys,

 

I am doing a Project, for better understanding I am trying to find out "What is the link between the class diagram and Salesforce Schema Builder? "

 

So far, I know that:

Class diagram:

 

  • Describing the static view of the system.
  • Showing the collaboration among the elements of the static view.
  • Describing the functionalities performed by the system.
  • Construction of software applications using object oriented languages.
  • Analysis and design of the static view of an application.

  • Describe responsibilities of a system.

  • Base for component and deployment diagrams.

  • Forward and reverse engineering.

     

    Salesforce Schema Builder:

     

    The Schema Builder makes it easier to visualize my objects, fields and relationships in an interactive Entity Relationship Diagram (ERD).
    It shows the follows:

    • Objects and fields
    • Relationships between objects (standard and custom)
    • Differentiate between master-detail and lookup relationships at a glance
    • Switch views between labels and API names


    To launch Schema Builder, go to Setup → App Setup → Schema Builder.

     

     

    But how are the linked in any ways??

     

    I would really appreciate your help guys :)

     

    Anika

Hi Guys,

 

I need to make the UI (front end) look better.
I have been told to use "plugins of js or jQuery". I am new to Salesforce and have not an idea of what I need to do and where I get this plugin from?

 

Could someone please guide me and start me off?

 

Thanks

 

Anika

Hello Guys,

 

I am a System Admin, but have this issue when I select Profiles:


Insufficient Privileges You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.

 

My code seems to be correct. Any advise will be appreciated.

 

Thanks

 

Anikaa

Hey Guys,

I need to get Object Permissions then build a Map doing something like
'<Parent__r.ProfileId, ObjectPermissions>
         map<Id, ObjectPermissions[]>'

 

I have wriiten a piece of code below, but the error says (SELECT Id,  //Whichever other fields I may need

SELECT is an unexpected token

 

 

Also follwoing the data model on http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_erd_profile_permissions.htm

the code below seems to be not following the diagram.

 

//get objPerms  then build Map<Parent__r.ProfileId, ObjectPermissions>
         // map<Id, ObjectPermissions[]>
    //from ObjectPermissions Parent__r.ProfileId in the set
    map<Id, ObjectPermissions[]> mapProfileIdtoObjectPermissions = new map<Id, ObjectPermissions[]>();
    for(PermissionSet PS : [SELECT Id, ProfileId
    (SELECT Id,  //Whichever other fields I may need
        FROM ObjectPermissions) // could have issue with ObjectPermissions, I need to get correct child name
        FROM PermissionSet
        WHERE ProfileId IN: profileIds]){
    //we check whether the key has already been put to the map, if not, we perform a put
    if(mapProfileIdtoObjectPermissions.get(PS.ProfileId) == null)
        mapProfileIdtoObjectPermissions.put(PS.ProfileId, new list<ObjectPermissions>{PS.ObjectPermissions});
    // else, the key has already been put, so we just add all ObjectPermissions that are related to this ProfileId
    else
        mapProfileIdtoObjectPermissions.get(PS.ProfileId).addAll(PS.ObjectPermissions);
}

 

 

 

If someone could help I would appreciate there I am noew to Salesforce and its programming language.

 

 

Thanks