How to set an UNSAccountB as Outstanding by using a VB Script (XmarkedForDeletion = 2)
- Products
- Solutions
- Resources
- Trials
- Support
- Partners
- Communities
How to set an UNSAccountB as Outstanding by using a VB Script (XmarkedForDeletion = 2)
Hi René,
you have to set the state property of the entity your UNSAccountB is stored in your script code.
Please take a look at the sample script that loads an UNSAccountB object from the database, sets it to Outstanding and saves it to the database.
Public Sub CCC_UNSAccountB_MarkAsOutstanding(UID_UNSAccountB As String) Dim eUNSAccountB As IEntity ' Create and load the UNSAccountB entity eUNSAccountB = Session.Source.Get("UNSAccountB ", UID_UNSAccountB) ' Set the state of the entity to OutStanding eUNSAccountB.State = eUNSAccountB.State Or EntityState.OutStanding ' Save the entity to the database Using uow = Session.StartUnitOfWork() ' put the entity to save in the unit of work uow.Put(eUNSAccountB) ' The entities will be saved here! uow.Commit() End Using End Sub
HtH
Hi René,
you have to set the state property of the entity your UNSAccountB is stored in your script code.
Please take a look at the sample script that loads an UNSAccountB object from the database, sets it to Outstanding and saves it to the database.
Public Sub CCC_UNSAccountB_MarkAsOutstanding(UID_UNSAccountB As String) Dim eUNSAccountB As IEntity ' Create and load the UNSAccountB entity eUNSAccountB = Session.Source.Get("UNSAccountB ", UID_UNSAccountB) ' Set the state of the entity to OutStanding eUNSAccountB.State = eUNSAccountB.State Or EntityState.OutStanding ' Save the entity to the database Using uow = Session.StartUnitOfWork() ' put the entity to save in the unit of work uow.Put(eUNSAccountB) ' The entities will be saved here! uow.Commit() End Using End Sub
HtH