You need to sign in to do that
Don't have an account?
yuhan chen 3
branch auto number
There are two object A B
A is a master object of B
we have set a auto number in A which goes like con-0001,con-0002,...
then we want a auto branch number in B based on A which goes like con-0001-0001, con-0001-0002,... if they are related to con-0001
How can we make this happen in Apex or standard config?
This is just an idea but you could have an auto number on the account and a trigger on contact that runs after insert that could concatenate the serial number field on account with count value on contact the update that particular record.
I hope this helps and in case if this comes handy can you please choose this as the best answer so that it can be used by others in the future.
Regards,
Anutej
All Answers
This is just an idea but you could have an auto number on the account and a trigger on contact that runs after insert that could concatenate the serial number field on account with count value on contact the update that particular record.
I hope this helps and in case if this comes handy can you please choose this as the best answer so that it can be used by others in the future.
Regards,
Anutej
You can try this:
Create one AutoNumber field on A. con-0001
Create one Autonumber field on B 0001
Now you can create one formula field on B which concatenates Autonumber fields of B and A.
If this helps you, can you please choose this as the best answer so that it can be used by others in the future.
I think if the above way is done then all the contacts will have a unique number for example:
Account 1 contact-2
Id's would be: a-001-001, a-001-002
Account 2 contact-1
Id would be a-002-003
I think yuhan is mentioning that the id should be a-002-001
If that is the case then I don't think the auto number on object b might not be useful.
I agree with what you are saying.