cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Auto generate text for a field

RishabhGupta19881
Participant
0 Kudos
611

Hello Experts,

I hope that all of you are doing well.
There is a requirement to auto-generate field value.
For example, If the parent object short name is XX-AB-CDEF, then the system should generate the short name of the new child object as “XX-AB-CDEFA” (One unique character to be added, after the parent object short name) and if another new child object is created, short name should be “XX-AB-CDEFB” and so on.

 

Thanks and Regards, 

Accepted Solutions (0)

Answers (2)

Answers (2)

ArunSuresh3
Active Participant
0 Kudos

Hi @RishabhGupta19881 

We shall consider 2 scenarios,

Scenario 1:- In relationship type for child if you defined/created as Child 1, Child 2, Child 3, Child 4, etc then based on the selected child relationship type, in the business rule you shall able to suffix the alphabet A,B,C,D etc. 

 

Scenario 2:- In the business rule, create rule to "Get Count of Dependents()" function specifically for relationship type "Child" and based on the count of dependent child define the rule. 

example:- 1. Get Count of Dependents() = 1 for relationship type "Child" the set name as concatenate "parent name" + "A" 

2. Get Count of Dependents() > 1 for relationship type "Child" the set name as concatenate "parent name" + "B" 

3. Get Count of Dependents() > 2 for relationship type "Child" the set name as concatenate "parent name" + "C" 

4. Get Count of Dependents() > 3 for relationship type "Child" the set name as concatenate "parent name" + "D" and so on..,

Can you try this based on your personrelationship definition?

Thanks

Arun

 

ArunSuresh3
Active Participant
0 Kudos

Hi @RishabhGupta19881 

I think you shall able to achieve this requirement by using concatenate function, 

a. Add If condition for relationship type "Child" is equal to null then concatenate name string + "A"

b. Add Else If condition for relationship type "Child" is not equal to null then concatenate name string + "B"

Above condition may work until for 2 children. From third child onwards, need to explore logic.

Thanks

Arun

RishabhGupta19881
Participant
0 Kudos

Hi Arun,
Thanks a lot, but need to explore it more because children are not restricted up to 2.

Thanks and Regards

RishabhGupta19881
Participant
0 Kudos
Hi Arun, Thanks. Challenge here is that parent Object is a field, defined within custom MDF object, rather than defining parent and child relationship. In child object, we have to mention parent object in one of the field as input. It is difficult to use given functions of business rule.
ArunSuresh3
Active Participant
0 Kudos

Hi Rishabh,

If the Parent Object is within the MDF itself then you shall able to place a "On change" condition on the parent object itself, as soon as parent object is updated it will update the child name. 

Thanks & Regards

Arun