• BigP
  • NEWBIE
  • 50 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 23
    Questions
  • 15
    Replies
  Integer count = [SELECT COUNT() FROM Contact];
Integer rand = Math.floor(Math.random() * count).intValue();
Contact c = [SELECT Name FROM Contact LIMIT 10 OFFSET :rand];
 
  • September 02, 2022
  • Like
  • 0
It is necessary to design an algorithm (a functional class in Apex) which will receive a list of contacts. A percentage will determine the number of people from the list to whom an email will be sent. This percentage should be able to be changed later by an admin dynamically without the need to change the code.

The important thing is that for each possible execution of the class, the list of contacts must be shuffled and sorted randomly. After the list is arranged, by percentage, the total number of contacts to be sent by email must be selected. Each sequence must be different for each execution.
  • September 01, 2022
  • Like
  • 0
No MODULE named markup://c:inputUtils found : 
  • August 23, 2022
  • Like
  • 0
 After the user selects a visit  from the dropdown, the right side of the page should show the details of the visit, like the visit date and time, the  description, the patients information (like email, etc.).
  • August 04, 2022
  • Like
  • 0
input (dropdown) should list with the various visits records that the physician has on that specific date. After the user selects a visit from the dropdown, the right side of the page should show the details of the visit, like the visit date and time, the  description, the patients information (like email, etc.).
  • August 02, 2022
  • Like
  • 0
  • July 27, 2022
  • Like
  • 0
  • July 26, 2022
  • Like
  • 0
public class VisitTriggerHandler {
           
    public static void sTime (List<visit__c> newVisits){
        
        set<id> physicianId = new set<id>();
        
        for (visit__c vis : newVisits) {
            physicianId.add(vis.OwnerId);
        }
        
        List<Visit__c> oldVisits = [
            SELECT id,Name, ownerid, Visitation__c, Timespan__c, Visitation_End__c
            FROM visit__c
            Where ownerid in : physicianId
        ];
        
       
        
        
        for (visit__c vis : oldVisits) {
            for(visit__c visit : newVisits){
                
                if(visit.Visitation__c == vis.Visitation__c){
                    visit.Visitation__c.addError('The date you have selected is not available');
                    
                }
            }
                
        }
  • July 22, 2022
  • Like
  • 0
(Part 1)
Let us suppose that our Salesforce users are physicians working in a private clinic. Our Salesforce org is the clinic’s system with its own database and internal applications. Each physician has various in clinic visits with patients scheduled throughout the day. Physicians should be differentiated by other types of users like the System Administrator. A physician with the name John Doe needs to be registered on this Salesforce Org. Physicians can view and modify their own visit records, by changing time and date of the visit, description, or even the patient of the visit. They cannot, however, see or modify the records of their colleagues. The following information should be mandatory on every visit: Date/Time of visit and patient information (must include first name, last name and email). It should also have a timespan value of 15 minutes, 30 minutes or 1 hour. An optional information to be filled for patients will also be a ranking value which can vary between values: Low, Mid, High. Only the physician John Doe should be able to rank the patients, other physicians should not be able to see or interact with this ranking value. When a physician’s logs into the Salesforce log, they should be able to see directly on login, the interface to register the patient’s visitations.(Part2)
The visit records (from the first task) of the same physician are not allowed to overlap with each other.
(For example, if visit #1 is scheduled today on 13:30 and has a timespan of 1 hour, then if visit #2 has a timespan of 30 minutes, it should not be allowed to have a start time at 13: 15 or 14:00, but it can before 13:00 or after 14:30).
When a user creates, updates, or deletes a visit record on Salesforce, the patient receives an email notification letting them know the new time/date of the visit, or that the visit has been canceled.
In addition, every morning at 7:00AM, physicians must receive an email with their scheduled visits of the day.
  • July 22, 2022
  • Like
  • 0
The visit records  same physician are not allowed to overlap with each other.
(For example, if visit #1 is scheduled today on 13:30 and has a timespan of 1 hour, then if visit #2 has a timespan of 30 minutes, it should not be allowed to have a start time at 13: 15 or 14:00, but it can before 13:00 or after 14:30).
When a user creates, updates, or deletes a visit record on Salesforce, the patient receives an email notification letting them know the new time/date of the visit, or that the visit has been canceled.
In addition, every morning at 7:00AM, physicians must receive an email with their scheduled visits of the day.
  • July 22, 2022
  • Like
  • 0
The visit records (from the first task) of the same physician are not allowed to overlap with each other.
(For example, if visit #1 is scheduled today on 13:30 and has a timespan of 1 hour, then if visit #2 has a timespan of 30 minutes, it should not be allowed to have a start time at 13: 15 or 14:00, but it can before 13:00 or after 14:30).
When a user creates, updates, or deletes a visit record on Salesforce, the patient receives an email notification letting them know the new time/date of the visit, or that the visit has been canceled.
In addition, every morning at 7:00AM, physicians must receive an email with their scheduled visits of the day..p
  • July 22, 2022
  • Like
  • 0
Trigger SalespartnerUpdate on Job__c(after insert, After Update){

Map<id, id> accwithspmap = new map<id,id>();

for(job__c j:trigger.New){
if(j.Account__c!=Null && j.SalesPartner__c!=Null){
accwithspmap.put(j.Account__c,j.SalesPartner__c);
}
}
List<Account> acclistupdate = new List<Account>();
for(Account acclist: [Select id,SalesPartner__c from account where id=:accwithspmap.keyset()]){

If(accwithspmap.containskey(acclist.id)){
acclist.SalesPartner__c = accwithspmap.get(acclist.id);
acclistupdate.add(acclist);
}

}

Update acclistupdate;



}
}
  • July 21, 2022
  • Like
  • 0
No MODULE named markup://c:inputUtils found : 
  • August 23, 2022
  • Like
  • 0
  • July 27, 2022
  • Like
  • 0
  • July 26, 2022
  • Like
  • 0
(Part 1)
Let us suppose that our Salesforce users are physicians working in a private clinic. Our Salesforce org is the clinic’s system with its own database and internal applications. Each physician has various in clinic visits with patients scheduled throughout the day. Physicians should be differentiated by other types of users like the System Administrator. A physician with the name John Doe needs to be registered on this Salesforce Org. Physicians can view and modify their own visit records, by changing time and date of the visit, description, or even the patient of the visit. They cannot, however, see or modify the records of their colleagues. The following information should be mandatory on every visit: Date/Time of visit and patient information (must include first name, last name and email). It should also have a timespan value of 15 minutes, 30 minutes or 1 hour. An optional information to be filled for patients will also be a ranking value which can vary between values: Low, Mid, High. Only the physician John Doe should be able to rank the patients, other physicians should not be able to see or interact with this ranking value. When a physician’s logs into the Salesforce log, they should be able to see directly on login, the interface to register the patient’s visitations.(Part2)
The visit records (from the first task) of the same physician are not allowed to overlap with each other.
(For example, if visit #1 is scheduled today on 13:30 and has a timespan of 1 hour, then if visit #2 has a timespan of 30 minutes, it should not be allowed to have a start time at 13: 15 or 14:00, but it can before 13:00 or after 14:30).
When a user creates, updates, or deletes a visit record on Salesforce, the patient receives an email notification letting them know the new time/date of the visit, or that the visit has been canceled.
In addition, every morning at 7:00AM, physicians must receive an email with their scheduled visits of the day.
  • July 22, 2022
  • Like
  • 0
Trigger SalespartnerUpdate on Job__c(after insert, After Update){

Map<id, id> accwithspmap = new map<id,id>();

for(job__c j:trigger.New){
if(j.Account__c!=Null && j.SalesPartner__c!=Null){
accwithspmap.put(j.Account__c,j.SalesPartner__c);
}
}
List<Account> acclistupdate = new List<Account>();
for(Account acclist: [Select id,SalesPartner__c from account where id=:accwithspmap.keyset()]){

If(accwithspmap.containskey(acclist.id)){
acclist.SalesPartner__c = accwithspmap.get(acclist.id);
acclistupdate.add(acclist);
}

}

Update acclistupdate;



}
  • July 21, 2022
  • Like
  • 0
We must have a Job object (Job__c) created that will have a Status picklist field with values Budget, Brief, First presentation, Backlog, Closed, Lost. If we have the object Job that is linked to an account, and this account does not have a Sales Partner (it is empty) but the Job has a Sales Partner field , then when the Job goes to Backlog status, the linked Account that had a sales partner, will receive as Sales Partner that Job has.
  • July 19, 2022
  • Like
  • 0