• deepak1.3956330618074822E12
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 10
    Replies
Hello All,

I have the following code where i am trying to display a list of Checkbox items in a custom link from a Case page. The below code displays all the checkboxes and the labels but when i select the checkbox and save and then come back to the same link, the checkbox selections are gone. I dont want to use "inputcheckbox value" as my itemlabels are different and lengthy. can anyone help on this?

<apex:page standardController="Case" extensions="ChecklistController" tabStyle="Case" >
<apex:form >
<apex:pageBlock id="theBlock">
<apex:pageBlockSection >
            <apex:pageBlockSectionItem >Config Checklist:
                <apex:selectcheckboxes layout="pageDirection">
                     <apex:selectOption itemLabel="Confirm that General Exceptions are handled when configuring the site" itemvalue="onclick" rendered="true"/>
                     <apex:selectOption itemLabel="Confirm that SBW, burst factor and billing model matches the SEO form" itemvalue="onclick" />
                     <apex:selectOption itemLabel="Capture MTR and check for the nearest POP" itemvalue="onclick" />
                     <apex:selectOption itemLabel="Ensure that If POP has one ISP and a BGP IP, select the IP with the lowest latency" itemvalue="onclick" />
                     </apex:selectcheckboxes>     
              </apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>

Regards
Deepak
I have difficulty in getting the case comments to the body of the email when invoked through javascript through a button. I have a custom button called Send Email and when clicked on Send Email, it opens the email client (In my case outlook). The To, CC, Subject are all filled through field reference in the javascript but i am not able to fill the body of the email with the last case comment that is public.
The javascript (Onclick Javascript under custom button) i have is as below

javascript:location.href='mailto:{!Contact.Email};{!Case.Additional_To_Emails__c}?CC=support@aryaka.com&SUBJECT=[{!Case.CaseNumber}] [{!Case.Subject}][{!Case.Ref_ID__c}] &BODY={!Case.Last_Case_Comment}';

{!Case.Last_Case_Comment} is not getting filled in the body of the email. Any suggestions to make it work?

Regards
Deepak
I have creaed a custom button called "Send Email"  and with URL as the content source. I am also populating email with the fields. But when the email client opens, the subject and body have "+" symbol in places of "space"

The url that i am referring to as given below

mailto:{!Case.Additional_To_Emails__c};{!Contact.Email}  &cc="support@aryaka.com"&subject= [{!Case.CaseNumber}][{!Case.Subject}] [{!Case.Ref_ID__c}]&body={!Case.Last_Case_Comment}

The email has the subject as below

[00036029][Test+test] [ref:_00DL0ADQ5._500L03bbZe:ref]

The body of the email as below

"Test+Comment+from+Sandbox
Regards
Deepak"

Anybody has any idea on why its adding "+" in place of "spaces"

Regards
Deepak
The piece of code goes as below. When a case is updated, i am getting the following error. 

There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Apex trigger CommentUpdate caused an unexpected exception, contact your administrator: CommentUpdate: execution of BeforeUpdate caused by: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, E2CP.SetMostRecentPublicComment: execution of AfterInsert caused by: System.EmailException: SendEmail failed. First exception on row 0; first error: INVALID_EMAIL_ADDRESS, Invalid to address : null: [] (E2CP): []: Trigger.CommentUpdate: line 12, column 1".

Seems its related to Email to Case premium but not able to figure out how to fix this. 

I am trying to put a comment through this trigger. When the field Case Summary Changed equals Yes, then the case summary in the field Case_Status_Updates__c should be updated as case comments. The code is failing when i am trying to Insert the new comment (last line).

trigger CommentUpdate on Case (before update) {
List<CaseComment> NewComment = new List<CaseComment>();
for(case c:trigger.new){
if(c.Case_Summary_Changed__c == 'Yes'){
CaseComment com = new CaseComment();
com.ParentId = c.id;
com.IsPublished=FALSE;
com.CommentBody= c.Case_Status_Updates__c;
NewComment.add(com) ;
}
}
Insert NewComment;
}

Regards
Deepak
Went through all the posts on Survey Force Error on Authorization required but could get it working in my set up. 
The problem is happening when i define a custom field under Survey Taken object and build a Master-Detail Relationship with Case object. When I do this, the contact is not able to submit the survey get the error, "Authorization is required"
If I remove this custom field or change the Data type to Lookup, it works perfectly.

I have checked many times on the site guest user profile. The VF pages are associated properly. The permissions are set properly for Case, Account and Contact objects, sharing rules are also defined but still i keep on getting Authorization error

Can some one help to see where the problem is and how to fix it?

Regards
Deepak
Hi All

I am looking for a sample code that updates the Account name in a case to a default value if certain other field values are selected.
For example, if  i select the Type = ABC, then Account Name should default to ABC when the case is saved.

Any help is appreciated

Regards
Deepak
I have created a field called Hold Release Date. The Status field in the case has an entry Hold.
I am comparing the Hold Release Date to Today and trying to trigger a field update that moves from Hold to Open. But this is not happening.
Mainly because the workflow rule evaluates only for the below Evaluation Criteria
a) Created
b) Created and everytime its edited
c) Created, and any time its edited to subsequently meet criteria

Since after moving the Case to Hold status and after putting Hold Release Date, the case is not touched i.e there are no edits to that case. Since there are no edits to the case, none of the evaluation criteria is met and workflow rule is not triggered.

Example: When I put a case in Hold for lets say 7 days, the Hold Release Date would be after 7 days. In these 7 days or even probably more than 7 days, the case will not be edited at all. So the Hold Release Date is missed because no triggeres on the 7th day to move the Hold state to Open state.

Now, Salesforce support says that i can do this only using triggers.
I am new to triggers and trying to understand the Apex code (i am not a "coder" :-))
After looking into some apex triggers, i wrote my own simple code as below

trigger HoldRelease on Case (before insert) {
if (case.Hold_Release_Date__c = 'TODAY'){
case.Status = 'Open';}
}

So, when Hold Relase Date is Today, i can trigger a field update to Status to go to Open and then trigger an email.

But salesforce seems to be not liking it and giving an error which i am not able to make it out

Error Error: Compile Error: Expression cannot be assigned at line -1 column -1

Can anybody help with the above code or give me the code that can do the above job? Your help is appreciated.

Regards
Deepak
Hello All,

I have the following code where i am trying to display a list of Checkbox items in a custom link from a Case page. The below code displays all the checkboxes and the labels but when i select the checkbox and save and then come back to the same link, the checkbox selections are gone. I dont want to use "inputcheckbox value" as my itemlabels are different and lengthy. can anyone help on this?

<apex:page standardController="Case" extensions="ChecklistController" tabStyle="Case" >
<apex:form >
<apex:pageBlock id="theBlock">
<apex:pageBlockSection >
            <apex:pageBlockSectionItem >Config Checklist:
                <apex:selectcheckboxes layout="pageDirection">
                     <apex:selectOption itemLabel="Confirm that General Exceptions are handled when configuring the site" itemvalue="onclick" rendered="true"/>
                     <apex:selectOption itemLabel="Confirm that SBW, burst factor and billing model matches the SEO form" itemvalue="onclick" />
                     <apex:selectOption itemLabel="Capture MTR and check for the nearest POP" itemvalue="onclick" />
                     <apex:selectOption itemLabel="Ensure that If POP has one ISP and a BGP IP, select the IP with the lowest latency" itemvalue="onclick" />
                     </apex:selectcheckboxes>     
              </apex:pageBlockSectionItem>
</apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>

Regards
Deepak
I have difficulty in getting the case comments to the body of the email when invoked through javascript through a button. I have a custom button called Send Email and when clicked on Send Email, it opens the email client (In my case outlook). The To, CC, Subject are all filled through field reference in the javascript but i am not able to fill the body of the email with the last case comment that is public.
The javascript (Onclick Javascript under custom button) i have is as below

javascript:location.href='mailto:{!Contact.Email};{!Case.Additional_To_Emails__c}?CC=support@aryaka.com&SUBJECT=[{!Case.CaseNumber}] [{!Case.Subject}][{!Case.Ref_ID__c}] &BODY={!Case.Last_Case_Comment}';

{!Case.Last_Case_Comment} is not getting filled in the body of the email. Any suggestions to make it work?

Regards
Deepak
I have creaed a custom button called "Send Email"  and with URL as the content source. I am also populating email with the fields. But when the email client opens, the subject and body have "+" symbol in places of "space"

The url that i am referring to as given below

mailto:{!Case.Additional_To_Emails__c};{!Contact.Email}  &cc="support@aryaka.com"&subject= [{!Case.CaseNumber}][{!Case.Subject}] [{!Case.Ref_ID__c}]&body={!Case.Last_Case_Comment}

The email has the subject as below

[00036029][Test+test] [ref:_00DL0ADQ5._500L03bbZe:ref]

The body of the email as below

"Test+Comment+from+Sandbox
Regards
Deepak"

Anybody has any idea on why its adding "+" in place of "spaces"

Regards
Deepak
The piece of code goes as below. When a case is updated, i am getting the following error. 

There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Apex trigger CommentUpdate caused an unexpected exception, contact your administrator: CommentUpdate: execution of BeforeUpdate caused by: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, E2CP.SetMostRecentPublicComment: execution of AfterInsert caused by: System.EmailException: SendEmail failed. First exception on row 0; first error: INVALID_EMAIL_ADDRESS, Invalid to address : null: [] (E2CP): []: Trigger.CommentUpdate: line 12, column 1".

Seems its related to Email to Case premium but not able to figure out how to fix this. 

I am trying to put a comment through this trigger. When the field Case Summary Changed equals Yes, then the case summary in the field Case_Status_Updates__c should be updated as case comments. The code is failing when i am trying to Insert the new comment (last line).

trigger CommentUpdate on Case (before update) {
List<CaseComment> NewComment = new List<CaseComment>();
for(case c:trigger.new){
if(c.Case_Summary_Changed__c == 'Yes'){
CaseComment com = new CaseComment();
com.ParentId = c.id;
com.IsPublished=FALSE;
com.CommentBody= c.Case_Status_Updates__c;
NewComment.add(com) ;
}
}
Insert NewComment;
}

Regards
Deepak
Hi All

I am looking for a sample code that updates the Account name in a case to a default value if certain other field values are selected.
For example, if  i select the Type = ABC, then Account Name should default to ABC when the case is saved.

Any help is appreciated

Regards
Deepak

Hi All getting this error:

 

tom_test_error_conditions.test_package_error_conditions()Class111

 

Failure Message: "System.QueryException: List has more than 1 row for assignment to SObject", Failure Stack Trace: "Class.tom_test_error_conditions.test_package_error_conditions: line 11, column 1"

 

Now there is only one queue that matches these criteria, but it does relate to multiple objects.

 

the line of code is.

 

  Group payroll_queue = [select Id, Name from Group where (Name = 'Time_Off_Manager_Payroll') and (Type = 'Queue')];

 

Any help greatly apreciated.

 

R

Hello,

 

I need help tracking down what is causing this error. It seems to be a read permission error, but everyone has read permission so I do not understand what does not have read permission.

 


Method Name:

tom_test_cancellation.test_cancellation

Message:

System.DmlException: Update failed. First exception on row 0 with id a0M50000000yOJ4EAM; first error: TRANSFER_REQUIRES_READ, The new owner must have read permission

Stack Trace:

Class.ptoPackage.cancel_request_without_commit: line 444, column 3 Class.tom_test_cancellation.test_cancellation: line 53, column 6 External entry point

 

 

 

public class ptoPackage { public static void cancel_request_without_commit(Id request_id) { Time_Off_Request__c[] tors = [select Id, Status__c from Time_Off_Request__c where (Id = :request_id) and (IsDeleted = false)]; if (tors.size() == 0) { throw new Time_Off_Exception('There is no Time Off Request with ID \'' + request_id + '\', so it cannot be canceled.'); } System.assert(tors.size() == 1); if ((tors[0].Status__c != 'Approved') && (tors[0].Status__c != 'Rejected') && (tors[0].Status__c != 'Requires Re-Approval')) { throw new Time_Off_Exception('A Time Off Request cannot be closed if it is in the ' + tors[0].Status__c + ' state.'); } tors[0].Status__c = 'Canceled'; update tors; } }

 

 

 As far as I can tell the method 'cancel_request_without_commit' sets status of the current 'Time_Off_Request__c' to 'Canceled' if the status is 'Approved','Rejected', or 'Requires Re-Approval', else it throws an error message.

I know in the time-off manager pto request process the 'Time_Off_Request__c' record ownership changes. It changes to the designated 'approval process' user when the record is in the approval process and the status is 'pending approval'. When the status is 'approved' the owner of the 'Time_Off_Request__c' record is the 'Time_Off_Manager_Payroll' queue as a way of locking them down. When you cancel a 'Time_Off_Request__c' the owner goes back to the 'Time_Off_Request__c' record creator if it is different. So I think I understand how the error message relates to transfering ownership of record.

I check the objects for the time off manager and every user profile has at least read permission for all objects. Its setup as suggested in the customization guide. For most users they have more than the minimum permission, but every users profile meets the minimum. Is there something else I should check?

Do you think its safe to assume since this error does not happen in the sandbox with the exact same configuration setup. In a configuration only sandbox with no data records. That the problem is with the 'Time_Off_Request__c' data records in production that the 'cancel_request_without_commit' can runa against? In other words its the data not the configuration?

 

Thank you