Not able to trigger an event from the script

Hi Everyone,

I am trying to generate an event from a script.

I tested the script using Visual Studio its triggering the event but when I tested the same from designer it not triggering any event.

If sapMandant.ALEShortName.Contains("ND2") Then
Dim htParameter = New Dictionary(Of String, Object)(StringComparer.OrdinalIgnoreCase)
Dim UID_DPRProjectionStartInfo As String = Connection.GetSingleProperty("DPRProjectionStartInfo", "UID_DPRProjectionStartInfo", "UID_DPRSystemVariableSet = '" & UID_DPRSystemVariableSet & "' AND UID_DPRProjectionConfig = '" & UID_DPRProjectionConfiguration & "'").ToString()
htParameter.Add("UID_DPRProjectionStartInfo", UID_DPRProjectionStartInfo)
Dim myEntity As IEntity = Session.Source.Get("SAPMANDANT", UID_SapMandant)
Using uow As IUnitOfWork = Session.StartUnitOfWork()
uow.Generate(myEntity, "POSTSYNC_ND2", htParameter)
uow.Commit()
End Using
End If

Any Idea if I am missing something ?

Parents Reply
  • Hi  and  

    Thanks for the quick solution, so its working fine from designer under Test Script. It is triggering the new job.

    But their is another issue which I forgot to mention.

    Issue2:

    I have assigned the above script to a process (Script <- Process <- Event)

    When the process runs and If the condition is True then it should trigger another event and then the Job, but its not happening. 

    Dim myEntity As IEntity = Session.Source.Get("SAPMANDANT", UID_SapMandant)
    Using uow As IUnitOfWork = Session.StartUnitOfWork()
    uow.Generate(myEntity, "POSTSYNC_ND2", htParameter)
    uow.Commit()
    End Using

     So can we do the same where it doesn't use any transaction while executing the script via job process? 

Children