Basis-klasse voor het gebruik van de Kenmerk.Data/Meta-Definities
%VHMacro,BL.Kenm.Common
1
BL.Kenm.Main
62171,38157.810308
0
MetaGroep object van het type Kenm.Basis.MetaGroep of Prod.Kenmerk.MetaGroep of variante
Kenm.Basis.MetaGroep
%String
%Boolean
Set blKenm=##class(BL.Kenm.ProdMulti).Create()
1
oMetaGroep:%RegisteredObject
ProdMulti
oMetaGroep:%RegisteredObject,blnPrefetchMDefs:%Boolean=1
%Status
Set MetaGroep + related properties
oMetaGroep:%RegisteredObject
Method PrefetchMDefs()
Inherited from BL.Kenm.Main
Groep allows the use of multiples
1
Groep:%RegisteredObject
%Boolean
Returns the full UnID
De waarde SubID mag geen "." bevatten
1
PRNr:%String,SubID:%String
%String
Returns the common part of the UnID, i.e. PRNr
1
UnID:%String
%String
Returns the subID of the UnID
1
UnID:%String
%String
ClassMethod implementation of method ProdIsMultiple()
Groep is verplicht.
1
ID:%String,Groep:%String
%Boolean
ID can be a PRNr or a UnID.
Checks if the kenmerk $$$KenmMultiPRNr is present for PRNr.
ID:%String
%Boolean
Returns $LB(UnID,UnID,..) which are multiples of PRNr
PRNr:%String
%List
Returns the subID for a new multiple of PRNr
PRNr:%String
%String
Returns the UnID selected from the Multiples list
PRNr:%String,PosInList:%String=1
%String
This will set the ProdMulti kenmerk, which implicates that the UnID is a mulitple.
The PRNr is extracted from UnID.
UnID:%String
%Status
This method will remove the ProdMulti kenmerk, which implicates that the UnID is a mulitple.
This should only be done if PRNr (from UnID) has no other multiples.
In other words: method should only be called from ..MultipleToOne()
UnID:%String
%Status
Convert multiple to PRNr (PRNr is contained in UnID)
UnID as .local to retrieve the new value of the non-multiple.
UnID:%String,CheckIsLastMultiple:%Boolean=1
%Status
1) $$$ERROR($$$GeneralError,$$$msgNotTheLastMultiple(UnID))
Set sc=##class(Prod.Kenmerk.DataDefinitie).CopyViaUnID(UnID,PRNr,$LB(Groep),0,"")
d WL^vhDBG("MultipleToOne: CopyViaUnID from "_UnID_" to "_PRNr_" Status="_$$ParseStatus^vhLib(sc))
If $$$ISOK(sc) Do
. Set sc=..RemoveProdMultiKenmerk(PRNr)
. If ($G(NewProductCreated,1)) Do
. . ; Delete the original multiple UnID product
. . Set sc=##class(Prod.Kenmerk.DataDefinitie).DeleteViaUnID(UnID,$LB(Groep))
. . Set UnID=PRNr
Else Do
. ; Delete any parts of the already created new product
. Set sc2=##class(Prod.Kenmerk.DataDefinitie).DeleteViaUnID(PRNr,$LB(Groep))
Quit sc
]]>
Convert PRNr to multiple (PRNr is contained in UnID)
UnID as .local to retrieve the new value of the multiple.
UnID:%String
%Status
Add new multiple to the given UnID
Returns the new UnID, or empty if error; the error message (%Status) is passed by .local Status
%String