• Miramo
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
Hi,

I have a batch process which updates the ownership of accounts, contacts and opportunities when they are updated via an external system.

When it runs an error is occurring saying the batch name needs to be unique even though it has the time attached to it.

Has anyone seen this type of error before and knows how to ressolve it?  Also someone is a fan of the 7 dwarfs,,,

User-added image
Hi,

I am close but trying to write a validation rule on mobile number.

Mobile should begin with a + and then the country code (below is 44) and then after the country code it should only allow the number 7 and error if any other numbers are entered.

So far I have th ebelow but its allowing any number after the +44

NOT(REGEX(MobilePhone, "^(\\+44)?[1-9]{2}[7]{1}.*?")),

example number is +44787446352

Thanks
  • April 01, 2021
  • Like
  • 0
Hi,

I am trying to write a before delete trigger on a custom object to capture information before its deleted and then save it to another custom object and getting errors.
I am not a developer but having ago (badly so far).  Here is what I have and the errors: -

Trigger so far for deletion

trigger deleteproject on Project__c (before delete)
 {
        List<Deleted_Records__c> lstToInsrt = new List<Deleted_Records__c>(); 

        for(Deleted_Records__c deletedProj : trigger.old)
        {         
       
            Deleted_Records__c pd = new Deleted_Records__c();
              pd.Object_Name__c = 'Project';
              pd.Object_Record_ID__c = Project__c.Id;
              pd.Date_Deleted__c = DateTime.NOW();
              pd.Deleted_Record_Owner__c = Project__c.OwnerId.Name;
              pd.Who_Deleted__c = getFirstName() + getLastName();
              pd.Project_Name__c = Proect__c.Name;
              pd.Project_Code__c = Project__c.Project_Code__c;
              pd.Region__c = Project__c.Region__c;
              pd.Project_Active_or_Dormant__c = Project__c.Project_Active_or_Dormant__c;
              pd.ERP_ID__c = Project__c.ERP_ID__c;
              pd.Object_Contact__c = Project__c.Project_Contact1__c;
        

            lstToInsrt.add(pd);
        }
        if(lstToInsrt.size()>0){
            insert lstToInsrt;
        }
   
}

I am getting the error Illegal assignment from Schema.SObjectField to String at line 10 column 15.

The field Object_Record_Id__c is a text field.
I am sure I will get a similar error for the fields Who_Deleted__c and also Deleted_Record_Owner__c
  • December 14, 2020
  • Like
  • 0
Hi,

I am close but trying to write a validation rule on mobile number.

Mobile should begin with a + and then the country code (below is 44) and then after the country code it should only allow the number 7 and error if any other numbers are entered.

So far I have th ebelow but its allowing any number after the +44

NOT(REGEX(MobilePhone, "^(\\+44)?[1-9]{2}[7]{1}.*?")),

example number is +44787446352

Thanks
  • April 01, 2021
  • Like
  • 0
Hi,

I am trying to write a before delete trigger on a custom object to capture information before its deleted and then save it to another custom object and getting errors.
I am not a developer but having ago (badly so far).  Here is what I have and the errors: -

Trigger so far for deletion

trigger deleteproject on Project__c (before delete)
 {
        List<Deleted_Records__c> lstToInsrt = new List<Deleted_Records__c>(); 

        for(Deleted_Records__c deletedProj : trigger.old)
        {         
       
            Deleted_Records__c pd = new Deleted_Records__c();
              pd.Object_Name__c = 'Project';
              pd.Object_Record_ID__c = Project__c.Id;
              pd.Date_Deleted__c = DateTime.NOW();
              pd.Deleted_Record_Owner__c = Project__c.OwnerId.Name;
              pd.Who_Deleted__c = getFirstName() + getLastName();
              pd.Project_Name__c = Proect__c.Name;
              pd.Project_Code__c = Project__c.Project_Code__c;
              pd.Region__c = Project__c.Region__c;
              pd.Project_Active_or_Dormant__c = Project__c.Project_Active_or_Dormant__c;
              pd.ERP_ID__c = Project__c.ERP_ID__c;
              pd.Object_Contact__c = Project__c.Project_Contact1__c;
        

            lstToInsrt.add(pd);
        }
        if(lstToInsrt.size()>0){
            insert lstToInsrt;
        }
   
}

I am getting the error Illegal assignment from Schema.SObjectField to String at line 10 column 15.

The field Object_Record_Id__c is a text field.
I am sure I will get a similar error for the fields Who_Deleted__c and also Deleted_Record_Owner__c
  • December 14, 2020
  • Like
  • 0