function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
v varaprasadv varaprasad 

Update field on child object

I have a Parent Object called "Treatement" and a child object "Infusion". For a particular treatement we have to create infusion records. the 1st Infusion record should have infusion number (a field in Infusion) as 1 and 2nd record should have infusion number as 2 , and the count should continue. 

How to achive this..

Thanks 
Best Answer chosen by v varaprasad
G10G10
Hi,

To achive mentioned functionality, You can create one rollup summary field on parent Object , which will help you keep count of all the childs ,On child object create one workflow rule(only created) keeping criteria as created Date not equal to nulll and update your infusion number field using field update.

Field update Formula : 

NAME_of_ROLLUP_SUMMAY + 1

Hope this is helpful to you :)
happy coding.

Regards,
Jiten.

All Answers

Deepak GulianDeepak Gulian
Why dont you use Auto number field in infusion object,. Best & simplest
v varaprasadv varaprasad
Hi Deepak,

based on particular Treatment child infusion  record only i need to update.

 
G10G10
Hi,

To achive mentioned functionality, You can create one rollup summary field on parent Object , which will help you keep count of all the childs ,On child object create one workflow rule(only created) keeping criteria as created Date not equal to nulll and update your infusion number field using field update.

Field update Formula : 

NAME_of_ROLLUP_SUMMAY + 1

Hope this is helpful to you :)
happy coding.

Regards,
Jiten.
This was selected as the best answer
v varaprasadv varaprasad
Hi All,

Thanks for your immediate reply.
for MD relation ship it will work.. 


Thanks Jiten :).. 

 
Sumit Jain CelebalSumit Jain Celebal
Hi Varaprasad

Assuming this is a one-off update that you need to do, here are the steps that you can follow:

1. Export the data of child object Infusion in a csv file using data loader. Include Infusion Id, Treatment Id in the csv file.

2. Open the csv in excel and sort the data on Treatment and Infusion.

3. Assuming that the treatment id is in column 1, Infusion id is in column 2 and the Count column is in column 3.

4. Put the below formula in Column 3:
             =IF(A2<>A1,1,C1+1)    

And replicate the cell value for other columns.

And you are done.

Let me know in case of any questions.

Regards
Sumit
sumit@celebal.com