cancel
Showing results for 
Search instead for 
Did you mean: 

How to add wait in SAP C4C Using ABSL Code

srikanthrathod
Explorer

Hi Experts,

I want to add delay/wait in my Custom BO events. Can you please tell me how can we achieve it ?

I am trying this by taking the current time of the system and adding 10 seconds and comparing it again. Somehow i am not able to add 10 secs. Is there any way we can achieve it.

Regards,

Srikanth Rathod

Accepted Solutions (0)

Answers (2)

Answers (2)

srikanthrathod
Explorer

Hi,

I have found the solution. Sorry for the late post

Code snippet below

var set_end = Context.GetCurrentGlobalDateTime();

var duration = ABSL: Duration.ParseFromString("PT5S");

var check_now = set_end.AddDuration(duration);

while (set_end < check_now)

{

set_end = Context.GetCurrentGlobalDateTime();

}

former_member689468
Participant
0 Kudos

Nice idea 🙂 just what I need at the moment, thx for posting

guruprasad_durai
Explorer
0 Kudos

Hello Srikanth,

You can try making use of the standard library available "Duration". Using this Library you can Add or Subtract Duration.

Regards,

Guruprasad