• Matan Alon
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 5
    Replies
Hi,
I'm trying to figure how to hide the delete button in the task detail page when the subject field value equal to 'xxxx' and the profile not equal to admin.
I know i need to custom the delete button with a Visualforce Page but i dont have any clue on how the script needs to look like.

Please help me with that,
Thanks in advance,
Matan.
I have a simple webservice method that updates Account Status from a custom Button in the Opportunity page:

Global class Backoffice {
    WebService static Integer  GenerateBackofficeTask(id  opId) {  
        Opportunity op = [SELECT AccountId from Opportunity WHERE Id =: opId];
        if(op.AccountId!=null)
            {
                Account ac = [SELECT Id from Account WHERE Id =: op.AccountId];
                ac.Type = 'Customer';
                update ac;
            }

    return 1;
    }   
}




Here the Test class i wrote:

@isTest
public  class BackOfficeTest {
    static testMethod void TestMyContractWebService() {

   Integer x = 0;  
    Account ac = new Account(Name='testAccount1');
    insert ac ;


    Opportunity op = new Opportunity(Name='testOpportunity1',AccountId=ac.Id,CloseDate =date.parse('12/12/2014'),StageName='Evaluation');
    insert op ;
    system.debug(op.AccountId);

      x= Backoffice.GenerateBackofficeTask(op.Id); 
    }
}


I don't know why I'm getting the following error:
Method does not exist or incorrect signature: Backoffice.GenerateBackofficeTask(Id)

Please help me this that - I tried to find the reason with no success

Thanks in advance,
Matan.
Hi,
I'm trying to write a lead assignment rule base on lead creation time.
I wrote the following formula:

if(and (VALUE( MID( TEXT( CreatedDate ), 12, 2 ) )>=4 ,
VALUE( MID( TEXT( CreatedDate ), 12, 2 ) )<14),true,false)

sadly there something wrong with it and i dont know what...
Is there something i'm missing ?

Thanks in advance.
Hi,
I'm trying to figure how to hide the delete button in the task detail page when the subject field value equal to 'xxxx' and the profile not equal to admin.
I know i need to custom the delete button with a Visualforce Page but i dont have any clue on how the script needs to look like.

Please help me with that,
Thanks in advance,
Matan.
Hi,
I'm trying to write a lead assignment rule base on lead creation time.
I wrote the following formula:

if(and (VALUE( MID( TEXT( CreatedDate ), 12, 2 ) )>=4 ,
VALUE( MID( TEXT( CreatedDate ), 12, 2 ) )<14),true,false)

sadly there something wrong with it and i dont know what...
Is there something i'm missing ?

Thanks in advance.

Hi,

When a portal user is adding a comment to a case it is not triggering an email to the case owner. So what i tried to do is to create an emailmessage record so that it can be tracked in the Emails related list of a case. But when i am trying to insert the Email Message as a portal user it is giving me the following error:

 

Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []

 

 

The following is the code that I am using.

 

 

 Case incident = [Select Id,Contact.Email,ContactId,OwnerId,Owner.Email,Owner.Name,CaseNumber from Case where Id='500Q0000003JYzUIAW'];
               CaseComment comment = new CaseComment();
               String reason = '<b>Number of people affected by this issue:</b>3<br/><b>Here is the business Justification:</b><br/>';
               comment.CommentBody = reason;
               comment.ParentId = '500Q0000003JYzUIAW';
               insert comment;
EmailMessage m = new EmailMessage();
               m.ParentId ='500Q0000003JYzUIAW';
               m.HtmlBody = 'Hi&nbsp;'+incident.Owner.Name+','+'<br/><u>Request to Escalate incident</u><br/><br/>'+comment.CommentBody;   
               m.Subject = 'A new comment has been added to the incident# '+incident.CaseNumber;
               m.ToAddress=incident.Owner.Email;
               m.FromAddress=incident.Contact.Email;
               m.Status='0';
               insert m;
System.debug(m);

 

 

Can portal users create emailMessages or not?

 

I tried to send an email to the owner but that is not linked to the case.

 

Any ideas how to achieve this.

 

Thanks in advance.

  • May 04, 2011
  • Like
  • 0