• Shekhar P V Palwankar
  • NEWBIE
  • 110 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies
While working with Auto Number I found that the system is skipping few numbers. I observed that if I try to save a record with one of the fields as an Auto Number and any error occurs while saving the record (say the mandatory field is missing/ duplicate value error), then the system simply skips the next number. e.g. I created one record with Auto Number as C-0001, while creating the second record I bumped into errors twice and on saving the same record the record was assigned with Auto Number as C-0004.

Issue with Auto Number 

Logically, a system should increment the Auto Number counter only after a successful transaction. Anyone has ever observed such a behavior? Any solution to take care of this?

Thanks in advance.

Regards,
Shekhar Palwankar
I have written a test class as mentioned below:
@isTest
public class TestClassSetupMethod 
{	
	@testSetup static void setup1()
    {
    	List<Account> lstAccount=new List<Account>();
        
		for(Integer i=0;i<2;i++)
        {
        	lstAccount.add(new Account(Name='TestAccount' + i));
        }

        insert lstAccount;
	}
	
    static testmethod void testmethod1()
    {
        Account act=[Select Id,Name From Account where name=:'TestAccount0'];
        act.Phone='7276621406';
        update act;
        System.assertEquals('7276621406', act.phone);
        Account act2=[Select Id,Name From Account where name=:'TestAccount1'];
        delete act2;
        System.assertEquals('TestAccount1', act2.Name);  
        act2.Phone='7276621444';
        // update act2; // with this line commented code runs without any error 
        System.assertEquals('7276621444', act2.phone);
    }
}

I expected to get an error at line 24 since I have deleted the Account record named 'act2' on line 23.
In case the code on line 26 (update act2;) is uncommented, I get an error for update failed (System.DmlException: Update failed. First exception on row 0 with id 0012800000byUNGAA2; first error: ENTITY_IS_DELETED, entity is deleted: [] ), which I believe is correct.
 
Any idea why it does not throw any error on assetion at line 24 in case the update act2 is commented on line 26. Any help on this would be appreciated. Thanks in advance.
Problem Statement: Whenever you try to import the data into Salesforce using Dataloader and any validation error occurs (e.g. the .csv file being imported has Account Name as blank), an automated email needs to be sent to one of the admin/ any user from Salesforce.

Has anyone tried this before? Any help would be appreciated... Thanks in advance.
While working with Auto Number I found that the system is skipping few numbers. I observed that if I try to save a record with one of the fields as an Auto Number and any error occurs while saving the record (say the mandatory field is missing/ duplicate value error), then the system simply skips the next number. e.g. I created one record with Auto Number as C-0001, while creating the second record I bumped into errors twice and on saving the same record the record was assigned with Auto Number as C-0004.

Issue with Auto Number 

Logically, a system should increment the Auto Number counter only after a successful transaction. Anyone has ever observed such a behavior? Any solution to take care of this?

Thanks in advance.

Regards,
Shekhar Palwankar
I have written a test class as mentioned below:
@isTest
public class TestClassSetupMethod 
{	
	@testSetup static void setup1()
    {
    	List<Account> lstAccount=new List<Account>();
        
		for(Integer i=0;i<2;i++)
        {
        	lstAccount.add(new Account(Name='TestAccount' + i));
        }

        insert lstAccount;
	}
	
    static testmethod void testmethod1()
    {
        Account act=[Select Id,Name From Account where name=:'TestAccount0'];
        act.Phone='7276621406';
        update act;
        System.assertEquals('7276621406', act.phone);
        Account act2=[Select Id,Name From Account where name=:'TestAccount1'];
        delete act2;
        System.assertEquals('TestAccount1', act2.Name);  
        act2.Phone='7276621444';
        // update act2; // with this line commented code runs without any error 
        System.assertEquals('7276621444', act2.phone);
    }
}

I expected to get an error at line 24 since I have deleted the Account record named 'act2' on line 23.
In case the code on line 26 (update act2;) is uncommented, I get an error for update failed (System.DmlException: Update failed. First exception on row 0 with id 0012800000byUNGAA2; first error: ENTITY_IS_DELETED, entity is deleted: [] ), which I believe is correct.
 
Any idea why it does not throw any error on assetion at line 24 in case the update act2 is commented on line 26. Any help on this would be appreciated. Thanks in advance.

I'm following the documtation found at https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_add_cmp_salesforce1.htm , but even with the 'implements="force:appHostable"' set in my aura:component, the Lightning Component isn't available when I try to add a new Lightning Tab.

Any insight?

Hello,

 

I've been trying to find out the required fields for some objects but was not sure how I could do this.  For example the User object has details specified as follows  http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_user.htm#topic-title  How can I find out from this though which fields are actually required fields when creating a new user & which are not?

 

Thanking you in advance for your help!