Question

How to Get Parent Case ID to Child case ID

I have a requirement where parent id is A-150 , then if i create child case it should be B-150-1. similarly if parent id is A-151 then child should be B-151-1,B-151-2 ,so on.

I tried to set pyworkIDprefix in pydefault of child case , but unable to get the parent id at that instance.

pyworkIDPrefix= "B-"+ substring(pyWorkCover.pyID,2)+"-"

but when i run its showing child case as B--1,B--2 so on only.

Correct Answer
October 20, 2019 - 7:57am

Hi,

While creating child case parent case data will be available in pyWorkPage itself and current child case will be creating using Iteratepage. You just change your expression with pyWorkPage.pyID it will work as expected.

Thanks,

Deva.

Comments

Keep up to date on this post and subscribe to comments

October 18, 2019 - 7:43am

Hello, 

Have you tried tracing it? Are you sure pyWorkCover.pyID is available on clipboard at this specific moment when calling GenerateID activity for the child?

October 18, 2019 - 9:16am
Response to MarcLasserre_GCS

im not calling GenerateID activity in my child.

October 18, 2019 - 9:37am
Response to anvith_raj

Well the question remains the same are you sure that Cover page is accessible?

October 20, 2019 - 5:05am
Response to MarcLasserre_GCS

cover page is not available at that time. I have tried in cssa exercise cloud link, but it wont set id for child . Is there any way by which we can get parent ID?

October 20, 2019 - 7:57am
Response to anvith_raj

Hi,

While creating child case parent case data will be available in pyWorkPage itself and current child case will be creating using Iteratepage. You just change your expression with pyWorkPage.pyID it will work as expected.

Thanks,

Deva.

October 20, 2019 - 1:23pm
Response to Deva_Prathapaneni

Will this really works...??how a pyworkpage holds two different pyID in one parent class(Org-DIV-WORK-TestParentCase).

Can you please specific on above statement??

October 20, 2019 - 1:36pm
Response to sameerm2

It will work. As i mentioned child creation time child case primary page is Iteratepage_xxx and parent case data  present in pyWorkPage. you can see this in tracer as well. 

October 20, 2019 - 1:41pm

Yes it's working