• ahmadkhan
  • NEWBIE
  • 0 Points
  • Member since 2013

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

Hi people!

 

i have a question regarding MAPS i am using MAP inside a map for the first time in apex and having some hard time can anyone help me?

 

Map<String, Map<String, List<Audiometry_Test__c>>> audiometryTest =
                                                    new Map<String, Map<String, List<Audiometry_Test__c>>>();

 

how to loop through all the values of this map inside map?

i have two objects which have parent child relationship

 

i have a field person Responsible in parent object which is a lookup field to user

and child object i have a list..

 

i have to send email to all the person responible records of child object that are related to parent object. and i am stuck in logic

Scenario:

 

parent records with person responsible = Rameez whose email is rameez.sheraz@gmail.com


Person Responsible RAMEEZ have 3 child records a,b,c

i have to send email to rameez some information of child records lets say Name of each record.

Please help its very very very urgent.:/ i am just a beginner in apex

Hi guys first of all thanks to all the people here they always help alot!

i have tos end an email notification to multiple users and each user there will be multiple records related

so in the email to each user will be just like below:

 

user1 recieves email.....[30 records based on some criteria]

user2 recieves email.....[30 records]

 

i am able to fetch the records all i to do is sent email and for that i am not getting how i can put all the emails and related records to one email in MAP or LIST? please help me my code is below

List<GSQM_ESH_Audiometry__c> personsResponsible = new List<GSQM_ESH_Audiometry__c>();
    Set<String> personIDSet = new Set<String>();
    Set<String> audiometryIDSet = new Set<String>();
    Map<String, String> personIDAudioID = new Map<String, String>();
     
    global void execute(SchedulableContext sc) {
        
        Map <Id,Id> audiometryObj = new Map<Id,Id>();
        for(GSQM_ESH_Audiometry__c obj : [SELECT Id, Person_Responsible_for_Assessment__c FROM GSQM_ESH_Audiometry__c
                                          WHERE Person_Responsible_for_Assessment__c!=null]){
            audiometryObj.put(obj.Id, obj.Person_Responsible_for_Assessment__c);
            personIDSet.add(obj.Person_Responsible_for_Assessment__c);
            audiometryIDSet.add(obj.Id);
        }
        System.Debug(audiometryObj.keyset());
        list<String> email = new list<String>();
        Map<Id,String> usersObj = new Map<Id,String>();
        for(user userObj: [SELECT Id,email from user where Id=:personIDSet]){
            usersObj.put(userObj.Id,userObj.email);
            email.add(userObj.email);
        }
        
        list<String> employeeName = new List<String>();
        list<GSQM_ESH_Employee_for_Audiometry_Test__c> audiometryListObj = new list<GSQM_ESH_Employee_for_Audiometry_Test__c>();
        Map<String, list<GSQM_ESH_Employee_for_Audiometry_Test__c>> audiometryTest= new Map<String, list<GSQM_ESH_Employee_for_Audiometry_Test__c>>();
        for(GSQM_ESH_Employee_for_Audiometry_Test__c obj : [SELECT userID__c, Employee_Name__c, Audiometry__c FROM
                                                           GSQM_ESH_Employee_for_Audiometry_Test__c
                                                           WHERE Audiometry__c IN:audiometryObj.keyset()
                                                           and Employee_Name__c!=NULL and Next_test__c = Next_MONTH]){
           if(obj!=NULL){

                  //i have to put this email1 and employee names related to one email in MAP or some list so then i can send email in bulk
                   System.Debug(obj.employee_Name__c);
                   String email1 =usersobj.get(obj.userID__c);
                   System.Debug(email1);
           }
        }

global class GSQM_ESH_MonthlyReportsEmailAlertSch implements Schedulable{
     List<GSQM_ESH_Audiometry__c> personsResponsible = new List<GSQM_ESH_Audiometry__c>();
     Set<String> personIDSet = new Set<String>();
     Set<String> audiometryIDSet = new Set<String>();
     Map<String, String> personIDAudioID = new Map<String, String>();
     
     global void execute(SchedulableContext sc) {
        
        personsResponsible = [SELECT Id, Person_Responsible_for_Assessment__c,reportDate__c FROM GSQM_ESH_Audiometry__c];
        for(GSQM_ESH_Audiometry__c obj : [SELECT Id, Person_Responsible_for_Assessment__c FROM GSQM_ESH_Audiometry__c]){
            personIDSet.add(obj.Person_Responsible_for_Assessment__c);
            audiometryIDSet.add(obj.Id);
        }
        System.Debug(personIDSet);
        
        list<String> email = new list<String>();
        list<user> usersObj = [SELECT email from user where Id=:personIDSet];
        for(user userObj: [SELECT email from user where Id=:personIDSet]){
            email.add(userObj.email);
        }
        System.Debug(email);
       
       list<String> employeeName = new List<String>();
       for(GSQM_ESH_Employee_for_Audiometry_Test__c obj : [SELECT Employee_Name__c FROM
                                                           GSQM_ESH_Employee_for_Audiometry_Test__c
                                                           WHERE Audiometry__c=:audiometryIDSet]){
           employeeName.add(obj.Employee_Name__c);
       }
       
       System.Debug(employeeName);
       
        
     }
    
}

 

 

this is my code i am able to fetch the records but i want to relate all the records can anyone guide me how to relate it may be through a map .......so i can send complete information according to the same user? THanks i am new to Apex

Hi people!

 

i need to help someone in buliding my SOQL query

 

i have to fetch records from an object for next three months i can explain the scenerio below:

 

Consider the current month is July i have to fetch the records for July
after that i have to fetch records for August and at the end i have to fetch the records for September

 

and EMail these list to users each month

 

i am very much confused about soql queries like how can i get record for each month and then next month and after next month seperately PLEASE HELP.

Thanks,

Ahmed

Hi guys,

 

i need an urgent help with this

 

i have two picklist one Months in which there are twelve month {January febuarary,..so on} and another is years{2013,2014, to 2020}

i need to convert these two picklists to one date field can any one who wrote this function and share his code? i am in a lil bit hurry.

 

Thanks,

Ahmed

Hi guys need a lil bit help with date formatting

 

<apex:outputText value="{0,date,MM'/'dd'/'yyyy}">
<apex:param value="{!i.Date_of_Incident__c}" />
</apex:outputText>

 

 

this is the code i am using in visual force to format the date but i want to put blank spaces when Date_of_incident__c is empty

but when it ry to do that it gives error that param value expect some numbers please.

 

Please Help!

 

{IF(!i.Date_of_incident)__C!=NULL), display formatted date,'                  '}

Thanks in Advance

Hi guys

 

i have three lists of different objects in my controller and i have to retrieve values from that lists and display it in VF page which is rendered as pdf.

 

but when i try to use dataTable or PageBlockSection it doesnot show anyvalue and when i use <apex:repeat> then it displays value but for two times i know because repeat works like for loop for display records but how i can display the field values can anyone please tell me exact sytnax? i am using the following code now but its not showing

<apex:dataTable value="{!accounts}" var="a">

<tr>
<td>ROC No. <span class="wrapper" style="padding: -1px 0 0 90px; border:solid #000 1px;"><input type="text" style="height:20px;" size="10" />{!a.ROC_No__c}</span>JKKP Reg. No.<span class="wrapper" style="padding: 4px 0 0 72px; border:solid #000 1px;"><input type="text" style="height:15px;" size="20"/></span></td>
<td style="background-color:#cecece;"></td>
<td rowspan="4"></td>
</tr>

</apex:dataTable>

 

Please Help!

Hello,

 

you help will be much appreciated.

 

i am creating a dashboard with a trending chart. My question is that in matrix report can i apply Different formula to a different column in the same row? consider like at the end in grand total i have 1000 amount for the first month then for second months it will be 1000*2, for third 1000*3 and so on for three months is it possible?

                          A1   B1      C1

A                       10    30       40

B                        0      0         0

C                        1      2         3

Grand Total     10 30*2  40*3

HI,

 

hey guys i need help in creating a grouped colum charts i want to create a grouped column chart showing amount on Y-axis and months on X-axis and comparing actual and expected amount on the graph. 

 

i am New to Salesforce. Please guide me.

 

Thanks

HI guys,

 

i need some help please help me out i am stuck in this thing from last one day

 

i have two objects which have parent child relationship

 

i have workflow rule on child object that if the status in Parent object is not equalt to New then the record type of child object  will be changed.

status field in the parent object is Picklist field and i am using Formula if that formula evaluates to true then record type will be changed but itsn ot working i am using the following formula.

AND(
NOT(ISPICKVAL( ParentObject__r.Status__c , "New")) ,
ISPICKVAL(Type__c, "INIT"),
RecordType.Name == "Sample Layout")

 

then change the record type.

Please URGENT Help Needed Thanks

Guys i need help on an after insert trigger i am NEW to apex.

 

i need to use and apex trigger i am writing the scenerio please Help me

 

i have three objects A, B and C

 

B has a lookup field with A so when u create a record in B then u have to select from Lookup Field of A

 

and when u create the Record of B then a new record will be created in Object C and two fields of Object A will be copied in two fields of Object C. lets say two fields are SMALL and LARGE.

 

PLEASE HELP!

Hi guys

 

i have three lists of different objects in my controller and i have to retrieve values from that lists and display it in VF page which is rendered as pdf.

 

but when i try to use dataTable or PageBlockSection it doesnot show anyvalue and when i use <apex:repeat> then it displays value but for two times i know because repeat works like for loop for display records but how i can display the field values can anyone please tell me exact sytnax? i am using the following code now but its not showing

<apex:dataTable value="{!accounts}" var="a">

<tr>
<td>ROC No. <span class="wrapper" style="padding: -1px 0 0 90px; border:solid #000 1px;"><input type="text" style="height:20px;" size="10" />{!a.ROC_No__c}</span>JKKP Reg. No.<span class="wrapper" style="padding: 4px 0 0 72px; border:solid #000 1px;"><input type="text" style="height:15px;" size="20"/></span></td>
<td style="background-color:#cecece;"></td>
<td rowspan="4"></td>
</tr>

</apex:dataTable>

 

Please Help!

Hi people!

 

i have a question regarding MAPS i am using MAP inside a map for the first time in apex and having some hard time can anyone help me?

 

Map<String, Map<String, List<Audiometry_Test__c>>> audiometryTest =
                                                    new Map<String, Map<String, List<Audiometry_Test__c>>>();

 

how to loop through all the values of this map inside map?

i have two objects which have parent child relationship

 

i have a field person Responsible in parent object which is a lookup field to user

and child object i have a list..

 

i have to send email to all the person responible records of child object that are related to parent object. and i am stuck in logic

Scenario:

 

parent records with person responsible = Rameez whose email is rameez.sheraz@gmail.com


Person Responsible RAMEEZ have 3 child records a,b,c

i have to send email to rameez some information of child records lets say Name of each record.

Please help its very very very urgent.:/ i am just a beginner in apex

Hi people!

 

i need to help someone in buliding my SOQL query

 

i have to fetch records from an object for next three months i can explain the scenerio below:

 

Consider the current month is July i have to fetch the records for July
after that i have to fetch records for August and at the end i have to fetch the records for September

 

and EMail these list to users each month

 

i am very much confused about soql queries like how can i get record for each month and then next month and after next month seperately PLEASE HELP.

Thanks,

Ahmed

Hi guys,

 

i need an urgent help with this

 

i have two picklist one Months in which there are twelve month {January febuarary,..so on} and another is years{2013,2014, to 2020}

i need to convert these two picklists to one date field can any one who wrote this function and share his code? i am in a lil bit hurry.

 

Thanks,

Ahmed

Hello,

 

you help will be much appreciated.

 

i am creating a dashboard with a trending chart. My question is that in matrix report can i apply Different formula to a different column in the same row? consider like at the end in grand total i have 1000 amount for the first month then for second months it will be 1000*2, for third 1000*3 and so on for three months is it possible?

                          A1   B1      C1

A                       10    30       40

B                        0      0         0

C                        1      2         3

Grand Total     10 30*2  40*3

HI,

 

hey guys i need help in creating a grouped colum charts i want to create a grouped column chart showing amount on Y-axis and months on X-axis and comparing actual and expected amount on the graph. 

 

i am New to Salesforce. Please guide me.

 

Thanks

HI guys,

 

i need some help please help me out i am stuck in this thing from last one day

 

i have two objects which have parent child relationship

 

i have workflow rule on child object that if the status in Parent object is not equalt to New then the record type of child object  will be changed.

status field in the parent object is Picklist field and i am using Formula if that formula evaluates to true then record type will be changed but itsn ot working i am using the following formula.

AND(
NOT(ISPICKVAL( ParentObject__r.Status__c , "New")) ,
ISPICKVAL(Type__c, "INIT"),
RecordType.Name == "Sample Layout")

 

then change the record type.

Please URGENT Help Needed Thanks

Guys i need help on an after insert trigger i am NEW to apex.

 

i need to use and apex trigger i am writing the scenerio please Help me

 

i have three objects A, B and C

 

B has a lookup field with A so when u create a record in B then u have to select from Lookup Field of A

 

and when u create the Record of B then a new record will be created in Object C and two fields of Object A will be copied in two fields of Object C. lets say two fields are SMALL and LARGE.

 

PLEASE HELP!