I have parent and response docs with status information. How can I define so that parent doc can’t be chosen as “ready” unless all the responses are, for example “archived”?
Subject: How to restrict parent doc status information based on response doc status?
Jojanna,
Why don’t you use @GetDocField to check this. Still you have not given clear picture what you want to do like “Archived”. I assume you don’t want to move response docs in archived mode until your parent document status field is not “ready”. If this is the case, loop through all doc, check the status field value . If its ready then use “Responses” method to get all the response document and proceed.
Rishi
Subject: How to restrict parent doc status information based on response doc status?
If there’s a way you can link the doc and responses together via a common ‘key’ field (ie they all share some idenifier like a unique Part number or serial number or…).
Build a view sorted by this key.
In the Doc/Parent, do a lookup using the key. Bring back the status/field/whatever it is you want to see at some specific value. If any of the dblookup returns are not the value you want, prohibit whatever change you want.
Parent - PN 12345
Child - PN 12345 - In Process
Child - PN 12345 - In Process
Child - PN 12345 - Done
Dblookup all items starting with 12345. If not all values are ‘Done’, don’t allow the parent to be set to Archive.
Works like a charm.
HTH
Doug
Subject: RE: How to restrict parent doc status information based on response doc status?
Thanks Rishi and Doug for your advices!
I’ll try with your advice on Monday and let you know what’s the situation. Hopefully I will be bright enough…![]()
Subject: RE: How to restrict parent doc status information based on response doc status?
Again, suprise, I was able to build that code and it is working! Thank you so much for guiding, I was a little bit lost on how to solve this, but this was easy way to built this up!
Subject: RE: How to restrict parent doc status information based on response doc status?
Suprise, suprise, I’m not able to build working @DbLookup code…
I have created a view, which includes Response docs sorted by order number (Field1). This is s field which is same on both docs, parent and response.
But, I’m not able to retrieve any status information…Can you please provide me code example?
Subject: RE: How to restrict parent doc status information based on response doc status?
StatusValue := @DbLookup(“Notes”:“NoCache”;“”;“lookupView”;key;FieldOrColumn);
No magic here. Make sure you’re syntax is correct and your key is correct.
Doug