• Thaier Issa
  • NEWBIE
  • 10 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 4
    Replies
Does anyone know if @future transactions and callouts count against force.com sites bandwidth and request time if they were executed from the site?
I am getting this error when trying to save my test, here is my test code
 
@istest (seeAllData = True) private class requnl_class_test  {

@isTest static void requnl_class_test () {
	Patient_Details__c client = new Patient_Details__c(
		Patient_name__c='Donkey Kong',
		Email_Address__c='tom@tom.com',
		Phone_number3__c='2012012233'
		);
	insert client;
	Patient_chart__c chart= new Patient_chart__c (
		RESTORE_Client__c=client.Id,
		name='sard'
		);
	insert chart;
	 
	ApexPages.currentPage().getParameters().put('id',chart.id);
	ApexPages.StandardController stdController = new ApexPages.StandardController(chart);
	
    requnl_class consext  = new requnl_class(stdController);

	PageReference pageRef = Page.Request_Unlock;

setCurrentPage(pageRef);

}
}

And here is my class code 
public without sharing class requnl_class
{
   private ApexPages.StandardController standardController;
   public String recId {get; set;}

 
    public requnl_class(ApexPages.StandardController standardController)
    {
    recId=ApexPages.CurrentPage().getparameters().get('id');
        this.standardController = standardController;
        
    }
  

public PageReference send() {

Messaging.singleEmailmessage email = new Messaging.singleEmailmessage();

patient_chart__c PatientId = [SELECT Id FROM patient_chart__c WHERE ID =:recid Limit 1]; 

List<string>sendTo = new List<String>();

sendTo.add('support@restorehair.com'); 

email.setToAddresses(sendTo);

email.setSubject('Please unlock this patient chart.'); 

email.setHtmlBody('Please unlock cs28.salesforce.com/'+PatientId.Id);

Messaging.sendEmailResult[] r = Messaging.sendEmail(new Messaging.singleEmailmessage[] {email});

        return null;
    }
}

Any help would be appreciated :)
 
I am trying to send an email from an apex class and I am utilizing a soql query to populate part of the email as it is unique based on the record and I receive this in the email. 
User-added image
Here is my soql query: 
 
List<patient_chart__c> PatientId = new
List<patient_chart__c>();
PatientId = [select Id from patient_chart__c limit 1];

 
Is it possible to allow a user to only be able to edit one specific field when a record is locked? I am trying to send an email from a workflow or a visualforce page because sending from Apex has been a rabbit hole at this point so I am looking for other options, Anyone have any insight? 
I have a custom object that goes through an approval process, when this approval process is initiated the record locks, I made an email template and I am trying to figure out how to send the email when the user clicks a "Request Unlock" button, I've tried using multiple things but none of it works because the record is locked so users can't do anything with the button. How can I do this via an apex trigger? Any help would be appreciated. 
I have some code here for an important time within my organization that texts clients their appointment times. I noticed an issue that when someone books ahead of daylight savings time, it does not tell them the correct time, it is still an hour behind. I am currently looking for a solution by implementing a formula that accounts for DST but I have not been able to implement a good solution as of yet. 

Here is the formula that displays the correct time for our timezone 

This is called Appointment_Time__c
IF( OR( VALUE( MID( TEXT( Start_Time__c - (6/24) ), 12, 2 ) ) = 0, VALUE( MID( TEXT( Start_Time__c - (6/24) ), 12, 2 ) ) = 12 ), "12", TEXT( VALUE( MID( TEXT( Start_Time__c - (6/24) ), 12, 2 ) ) - IF( VALUE( MID( TEXT( Start_Time__c - (6/24) ), 12, 2 ) ) < 12, 0, 12 ) ) ) & ":" & MID( TEXT( Start_Time__c - (6/24) ), 15, 2 ) & " " & IF( VALUE( MID( TEXT( Start_Time__c - (6/24) ), 12, 2 ) ) < 12, "AM", "PM" )

And then I have another formula that does the same thing as the first one but it is an hour ahead. 

This is called Appointment_Time_DST__c
IF( OR( VALUE( MID( TEXT( Start_Time__c - (5/24) ), 12, 2 ) ) = 0, VALUE( MID( TEXT( Start_Time__c - (5/24) ), 12, 2 ) ) = 12 ), "12", TEXT( VALUE( MID( TEXT( Start_Time__c - (5/24) ), 12, 2 ) ) - IF( VALUE( MID( TEXT( Start_Time__c - (5/24) ), 12, 2 ) ) < 12, 0, 12 ) ) ) & ":" & MID( TEXT( Start_Time__c - (5/24) ), 15, 2 ) & " " & IF( VALUE( MID( TEXT( Start_Time__c - (5/24) ), 12, 2 ) ) < 12, "AM", "PM" )
And then finally, I have a formula that determines the date and then it converts the normal time into DST, here is that formula that I have not been able to correctly implement because it does not convert correctly when it should. 
 
IF(OR(AND(DAY(TODAY()) >=10 , MONTH(TODAY()) >= 3), 
AND(DAY(TODAY()) <=3 , MONTH(TODAY()) <=11)) , 
Appointment_Time__c , Appointment_Time_DST__c)
Any help on what I am doing wrong would be greatly appreciated, 

Thanks in advance. 

 
I am using a professional edition. I have a field Matching_Records__c on Lead object which I want to get populated with a link which would contain matching records to that specific record on the basis of some fields ( like Required_Type__c or Required_Price__c on Lead Object) . The query needs to be done on other object records ( LikeType__c and Price__c on Product__c Object). 
What are the approaches I can follow in this case when I can't use any apex?   
I am trying to send an email from an apex class and I am utilizing a soql query to populate part of the email as it is unique based on the record and I receive this in the email. 
User-added image
Here is my soql query: 
 
List<patient_chart__c> PatientId = new
List<patient_chart__c>();
PatientId = [select Id from patient_chart__c limit 1];

 
Is it possible to allow a user to only be able to edit one specific field when a record is locked? I am trying to send an email from a workflow or a visualforce page because sending from Apex has been a rabbit hole at this point so I am looking for other options, Anyone have any insight? 
I have a custom object that goes through an approval process, when this approval process is initiated the record locks, I made an email template and I am trying to figure out how to send the email when the user clicks a "Request Unlock" button, I've tried using multiple things but none of it works because the record is locked so users can't do anything with the button. How can I do this via an apex trigger? Any help would be appreciated.