Forum Discussion
- ChrisLoranValued Contributor
It would be useful to have a screen cap of an example, for clarification on the question here.
Let's say you have an entity , where the InUse property has been set to a stored value for a certain time period:
Example:Now I want to use a BR, to remove the InUse stored value , for the time period 2022M1 on the (Default) scenario type.
Dim entMbr As MemberInfo = BRApi.Finance.Members.GetMemberInfo(si,DimTypeId.Entity, "Shanghai", True) Dim entProps As EntityVMProperties = entMbr.GetEntityProperties() Dim idScenarioType As Integer = DimConstants.Unknown ' -- use for (Default) scenario type Dim idTime As Integer = TimeDimHelper.GetIdFromName("2022M1") entProps.InUse.RemoveStoredPropertyItem( idScenarioType, idTime )
By running this code, it has removed the stored value (True) for the InUse property, for 2022M1 for the entity.
Only the stored value for 2020M1 now remains.Now repeat the BR , with time argument of 2020M1:
Now all the stored values have been removed:
- NicolasArgenteValued Contributor
Hi ChrisLoran and thanks for stepping in!
What you are doing in the script is deleting one by one the properties. To achieve that, it means you already know the Time value property that needs to be deleted. How do you get a list of those time values? In your printscreen above, how would you get the list of 2020M1 and 2022M1?
and is there an api to delete all Time value properties of the InUse?
Thanks- RobbSalzmannValued Contributor II
NicolasArgente for time, try si.WorkflowClusterPk.TimeKey
For scenario, si.WorkflowClusterPk.ScenarioKey
In your rule:
Dim sScenario As String = ScenarioDimHelper.GetNameFromID(si, si.WorkflowClusterPk.ScenarioKey)
Dim sTime As String = BRApi.Finance.Time.GetNameFromId(si, si.WorkflowClusterPk.TimeKey)
Related Content
- 12 months ago
- 11 months ago
- 11 months ago