Application Programming Interface forums

0 Abonnenter

3 Emner

4846 Samtaler

Area for questions and answers about SuperOffice API's.

push_pin lock

EventData for Service?

Hi,   We are switiching all crm scripts from old Service Modul to new Service Modul. in Event "saving a request", i try to block to save Tickets (in new Service Modul) if some requiered fields or Conditions not filled and post error message to User, but it looks the object of both EventData also EventDataDialogDefinition doesn't work for Service modul. Any Alternative? In old Service Modul, I can set Error Message in Screen in Loading Scripts (before setFroCgi). getHtmlElement("panes").setErrorMessage(msg); Below in Screenshots is just my simple Test.
Jianchun You
2
2
10. jun. 2024 | 10:38 a.m.
Emne:
Service and CRMScript Discussion

Siste svar

Ok, thanks, i got it!
by Jianchun You
10. jun. 2024 | 01:37 p.m.
push_pin lock

Navigate to custom URL

Hello All,   I was initially looking of setting up an URL on an error message so that users can click it and that will send them to a help document. But I was not able to make CRM script produce a clickable URL I found out about setNavigateTo, but unfortunatly, I cannot find a way to make it work with anything but Soprotocol. Is it possible to send the susers to a custom URL upon clicking Yes (for example)? Thank you!

AB

Andrei Berianu
4
7
24. apr. 2024 | 01:43 p.m.
Emne:
Service and CRMScript Discussion

Siste svar

Thank you!

AB

by Andrei Berianu
7. jun. 2024 | 02:45 p.m.
push_pin lock

From Javascript to Typescript

Hi everyone,  The 'Javascript for SuperOffice' project is moving forward, and as we (at least tried to) make clear there could be changes down the road..  This particular change is quite big, as we have decided that Typescript is more appropriate as a scripting language inside of SuperOffice. Developers have grown accustomed to the type safety CRMScript provides, and moving to vanilla javascript was seen as to big of a change. Typescript also provides you with errors on compiletime, and will give developers better tools to work with. This has also been the 'most requested feature' from our testers (both internally and externally), and since we dont forsee any technical issues with it, it just made a lot of sense. With this change there is a couple of importalt things to be aware of: We do NOT support re-compiling on every execution, as it would create to much load and overhead. To compile a typescript to javascript you will have to save/apply it. For those who have EXISTING javascripts , e.g. have some javascripts they want to keep, you will have to copy and save those outside of SuperOffice by 11.june 2024. The reason being that we have introduced a new field in the ejscript-table which will contain the Typescript, and that field is what is shown inside the SuperOffice editor. If you were to open an existing script it would show up as blank inside the editor (which it is), and when you apply/save the script it will overwrite whatever is in the ejscript.body-field (Which is where your existing javascript is stored). NOTE: If you didnt read this in time, and still want to get your scripts, it should be possible to fetch the old script through a SearchEngine or similar. Unless you have already saved/overwritten it through the editor.. in then case its gone.. Sorry! Just to make it clear: CRMScripts are of course unaffected by all of this! We hope that is a welcome change for all of you, and we look forward to hear your feedback! //Eivind  
Eivind Fasting
3
2
7. jun. 2024 | 12:57 p.m.
Emne:
Service and CRMScript Discussion

Siste svar

Thanks for the update. Super happy about this!
by Espen Steen
7. jun. 2024 | 01:11 p.m.
push_pin lock

New CRMScript editor (again): Monaco

Hi all, We have been testing whether it is possible to replace Codemirror as our CRMScript editor with Monaco (the basis of VSCode). We have currently implemented this as a testable feature in our latest build, hoping that some of you will try it out and tell us what is not working :-) You can enable Monaco as your CRMScript editor by using the "rms.fcgi?action=debug" panel and tick the Monaco-checkbox. The setting is stored as a cookie in your browser and will only affect you in that particular browser, other users will not be affected. This setting is available in build "main_10.3.7_2024.05.23-01". Sverre
Sverre Hjelm
6
14
23. mai 2024 | 08:04 a.m.
Emne:
Service and CRMScript Discussion

Siste svar

To the good people in this thread:  https://community.superoffice.com/en/technical/forums/api-forums/service-crmscript/from-javascript-to-typescript/  //Eivind
by Eivind Fasting
7. jun. 2024 | 01:00 p.m.
push_pin lock

New follow up dialog, breaking changes

Hi, We have had multiple customers notifying us of issues today because the New follow up dialog was enabled. Issue #1: CRMscript before save trigger on appointment, if you check the 'AppointmentEntity.Description' property, it is always empty for a new appointment, even if you fill in the title field. Shouldn't this be filled with the plain text combination of title + agenda? to keep it backwards compatible? (see https://community.superoffice.com/en/technical/forums/general-forums/announcements/upcoming-appointment-changes/ ) Isssue #2: A new property 'AppointmentEntity.ContactPerson' is introduced that either points to the contact or the person that the appointment is linked to. If you have a CRMscript before save trigger on appointment that changes the relation of the contact and/or person (in this specific case, sets both to 0), this isn't automatically reflected in the new ContactPerson property and is ignored.  
David Hollegien
2
6
30. mai 2024 | 08:57 a.m.
Emne:
Service and CRMScript Discussion

Siste svar

Just tested, works for both new and existing appointments now, great!
by David Hollegien
4. jun. 2024 | 11:05 a.m.
push_pin lock

Setting Ticket to Unassigned if owner is not available

When adding a message to a ticket through email the status is set to Unassigned if the current owner is marked as Not Present. When adding messages through the webapi it seems this logic is ignored. I'm trying to do this manually using something like the following code, but that throws an error saying that GetUserPresenceStatus() is not available for partners. Is there any other way to do this? Or enable the reassignment for TicketAgent.SaveTicketMessageEntityWithNotify()?   var agent2 = new UserAgent(await GetConfig(), _client); var status = await agent2.GetUserPresenceStatusAsync(ticket.OwnedBy.AssociateId); if (status.Status == EjUserStatus.StatusNotAvailable) { ticket.OwnedBy = new Associate() { AssociateId = 0 }; }

SG

Snorre Garmann
2
2
28. mai 2024 | 01:08 p.m.
Emne:
Online development and web service API's

Siste svar

Excellent. That worked perfectly.

SG

by Snorre Garmann
29. mai 2024 | 05:47 a.m.
push_pin lock

Virtual fields for person address fields

Hi, We have a customer where the address fields of the main person of a ticket are shown in the ticket header like this: They have encountered a few times now that the wrong address is displayed here, it shows the address of a company with the same Primary ID as the person. This happens because there is no restriction on the atype_idx field of the address table added when you point to the address fields like this. Sadly there currently are no virtual fields on the person table (they are there for the contact table) to solve this. Could these be added? or is there another solution here? This wish has been asked before, but the bug id does not exist anymore. https://community.superoffice.com/en/technical/forums/api-forums/service-crmscript/display-address-for-person-in-view-person-screen/ https://community.superoffice.com/en/technical/forums/api-forums/service-crmscript/person-address-from-sm-shown-in-cs/  
David Hollegien
1
0
24. mai 2024 | 09:42 a.m.
Emne:
Service and CRMScript Discussion
push_pin lock

Mailbox, run before message is saved trigger

Hi, I have a specific email from a customer that always should be merged with an existing request, this email have an PDF attachement. What would be the best way to merge this email? "Mailbox, run before message is saved trigger" seems not to handle attachements, should I then use run after message is saved trigger and merge requests? Would appriciate any suggestions how to do this. Thanks!
Johan Friberg
1
0
17. mai 2024 | 07:01 a.m.
Emne:
Service and CRMScript Discussion
push_pin lock

New messages collapsed in ticket overview

I'm adding messages to tickets through the api, but I have noticed that all new messages are default collapsed in SO gui. Is there a way to get them to be expanded by default?     var agent = new TicketAgent(await GetConfig(), _client); var message = await agent.CreateDefaultTicketMessageEntityAsync(); message.Ticket.TicketId = ticketId; message.Body = messageBody; message.Type = TicketMessageType.Plain; message.Badge = BadgeType.Incoming; var messageEntity = await agent.SaveTicketMessageEntityWithNotifyAsync(message,true);

SG

Snorre Garmann
2
2
14. mai 2024 | 07:26 a.m.
Emne:
Online development and web service API's

Siste svar

Thanks. I think the confusion was caused by the fact that when new messages arrives on a ticket already opened and we click the status bar asking to reload, the new messages are shown as collapsed. If we instead click F5 the correct number of expanded messages are shown.

SG

by Snorre Garmann
14. mai 2024 | 10:23 a.m.
push_pin lock

Reopen ticket through API

How do I reopen a ticket with status=Closed? It seems to ignore the state on TicketEntity. I would think the following should work, but the status on the ticket remains Closed     var ticket = await agent.GetTicketEntityAsync(ticketId); ticket.BaseStatus = TicketBaseStatus.Active; await agent.SaveTicketEntityAsync(ticket); var newTicket = await agent.GetTicketEntityAsync(ticketId); if(newTicket.BaseStatus != TicketBaseStatus.Active){ throw new Exception(":exploding_head:"); }

SG

Snorre Garmann
2
2
14. mai 2024 | 06:27 a.m.
Emne:
Online development and web service API's

Siste svar

I tried that first without success, but now I got it to work if setting both TicketStatusId and Status on TicketEntity.Status. Should I set both BaseStatus and Status?  

SG

by Snorre Garmann
14. mai 2024 | 07:07 a.m.