This post is a contribution from Deepak S Kumar a regular visitor of SiebelGuide.com Many thank to him for contributing and sharing his knowledge. I am posting this article as it is. You can also download this article in a word document using this link. I would also request other visitors to participate.
Count (”MVL Link”) - reducing scripting
This article describes how to use Count Function in calculated field involving MVL link to count number of child records for a BC and then base our conditions on that to fullfill our requirement.
Very often we have scenarios where conditions has to be set based on the count or number of records in child BC. This can be achieved using the function Count(“MVL Link”) in a Calculated expression and setting conditions with help of user properties. Let’s understand it with help or a Requirement.
Requirement:
A field “Currency “ in “
Solution:
Count (“MVL Link”) used as an expression in a calculated field returns the number of records in child BC.
Following configuration in Tools is required to achieve the above functionality:
» For the “
» Add following fields to “
Name: Service Agreement Count
Calculated: True
Calculated Value: Count (”Service Agreement”)
Name: Currency Read Only Flag
Calculated: True
Calculated Value: IIF ([Service Agreement Count] = 0, “N”, “Y”)
» Add following BC User Property to Opportunity Business component to make Currency Field Read only
Name: Field Read Only Field: Currency
Value: Currency Read Only Flag
This will make “Currency” Field editable only when Agreement record count = 0 and read only if agreement count > 0.
Related posts(Auto Generated):





March 29th, 2009 at 12:02 pm
Hi,
We have tried it most of the times Refresh and without but a refresh is necessary for that.How would we acheive it without refresh and without script.
April 1st, 2009 at 6:37 am
hai we need to set immediate post changes for that calculated field. so you cna achieve that so calculated fields are refreshed only after committing the record immediate post changes works well
April 22nd, 2009 at 4:24 pm
Nice solution i was tried before in the early siebel days
April 23rd, 2009 at 7:22 pm
I tried for Service Request BC taking Opportunity/Service Agreement as an example.
Given below are the details.
Could not make field Severity ready only.
A field “Severity “ in “Service Request” BC should be read only based on the number of records in child BC “Solution SR/PD“.
If the Solution SR/PD Count child record count > 0 then Severity should be read only and it should be editable if the child record count = 0
MVL
Name : Solution SR/PD
Destination Business Component : Solution SR/PD
Destination Link: Service Request/Solution SR/PD
Name: Solution SR/PD Count
Calculated: True
Calculated Value: Count (”Solution SR/PD”)
Name: Solution Read Only Flag
Calculated: True
Calculated Value: IIF ([Solution SR/PD Count] = 0, “N”, “Y”)
» Add following BC User Property to Opportunity Business component to make Currency Field Read only
Name: Field Read Only Field: Severity
Value: Solution Read Only Flag
April 24th, 2009 at 3:51 am
Hi Suryaa,
Can you expose the count field in the UI and make sure first that it is working fine?