Optimizing the save() Method in runtime



I have Apps to save all Messages and its Ticket per Web Service in SO Online, but it last runtime ca. 3-5 Sec. to save each Message, I have invesgated, since there is some crm scripts where also runs saving Message and Ticket in Trigger to Service: New message on request. This is only example. If I shut down all crm scripts to Service, then the runtime to save Message in apps is only 1 sec.

I checked, there is no logic conflicts to save Message between apps and crm scripts. Is it probability to save Message via webservice in Apps, without to check in crm scripts again? just to save the runtime for our User.


Thanks a lot!

RE: Optimizing the save() Method in runtime


Triggers on Message/Ticket will be executed even if you are using API to create them, so unless you are able to add some logic in trigger scripts to "bypass" your code (ie some attribute on ticket which is not set anywhere else), I dont see any way of optimizing this.

Von: Michel Krohn-Dale 26. Mai 2021

RE: Optimizing the save() Method in runtime

Hi Michel,

I have thought about your idea, for example to create a hidding udf to Ticket, if the certain Ticket runs in API then set it to 1 and after that set it to 0. The Trigger in crmscript to save Message and Ticket runs only if this udf has 0.

The single problem could be, if this long ticket has many messages and it takes many minutes to do the jobs (Copy Ticket with all Messages from current Ticket), during that if this current Ticket or Message will be new saved via Trigger in crm script by other user, then Logik in crm script will not work at this time for the user. This rarely happens but could be still a lack.

But Thanks a lot, I see whether there is a better "bypass".


Von: Jianchun You 26. Mai 2021