Application Programming Interface forums

0 Prenumeranter

3 Ämnen

4954 Samtal

Area for questions and answers about SuperOffice API's.

All conversations (4954)

push_pin lock

Questions migrating from COM to Hybrid/web model

Old situation: 10 years ago, I created a C# application (let's call it TheApp.exe) that is called from within Superoffice 8 (by using a GUI - Web panel button). Inside TheApp, the currently logged on Superoffice user is used to perform various tasks in Superoffice (via SuperOffice.COM.Application) Workflow for the end user: from within SuperOffice, the user clicks on the button. That opens TheApp.exe on his computer (no need for a separate login). His actions within TheApp are stored in the SuperOffice database (under his own username). Closing TheApp brings the user back to SuperOffice, where he sees the screen updated with the extra data that was filled in via TheApp. New situation: The client is moving towards Superoffice 10.5.4 running on IIS on-prem (the hybrid model?) My question: how do I adjust TheApp to the new situation, providing the same workflow to the end user? Problems I'm running into: 1) How to make the button in SuperOffice in the browser work to open TheApp.exe on his computer? 2) How to make sure the user does not have to login again from within TheApp? Instead, TheApp should be impersonating the user that was already logged in via the browser SuperOffice session (or alternatively: via Windows 11?) 3) Which protocol to use to communicate with SuperOffice from within TheApp? I see there is a Netserver route or a WebApi route. What I've tried: 1) Register a custom protocol on the end user's pc that forwards to TheApp.exe. Calling a url with that protocol when clicking on the Web panel button in SuperOffice. This sort of works, although every time the user clicks on the button, he receives a browser message that it is trying to open an external application. So not a clean solution yet 2) In the url, I was able to provide the <usec> parameter, which gives me a SOTicket in TheApp. 3) Here I'm a bit stuck which protocol to use. I tried using SuperOffice.CRM.Services and then in code do a SoSession.Authenticate(SOTicket); That gives me an error though. Also, I wonder how the assembly knows where SuperOffice is running so where to connect to exactly. I think I'm missing something there. So far it feels a little like failing forward. I'm not sure if any of the steps/solutions I've come up with are the way to go, or if there are better ways of solving my problems. Any help would be much appreciated.  

FC

Frank Cornegge
3
1
9 h, 6 m sedan | 08:25 fm
Ämne:
Online development and web service API's

Senaste svar

Hi Frank! Migrating from SuperOffice v8.x to v10.x has some hurdles. NetServer uses dependency injection to configure database dependencies and logging. Navigating around the application is still supported using SoProtocol , albeit not as uniform as it was in the windows client. For onsite installations, we still support passing the usec credential as a template variable, but not in the online environment. So you should still be able to use it as before, just making the right changes for NetServer will make SoSession.Authenticate work as expected.  We have a GitHub repo that demonstrates these DI changes, but is geared more towards the online environment. I will add a onsite version today for you. We've also introduced the Screen Designer , for minor UI customizations.  More to follow in an email.  Best regards!  
by Tony Yates
7 h, 56 m sedan | 09:36 fm
push_pin lock

Simple Automation? ( if [Member in Project] then set [Checkmark] )

Hello, I am new to SuperOffice scripting and unfortunately not a developer. I am hoping to get some guidance. I want to automate the activation/deactivation of a specific checkmark in a company’s details, based on whether a company (or an employee of a company) is part of a specific project. I also want to remove the checkmark if that is no longer the case. Is this possible to achieve with a script in SuperOffice? Could you point me to the necessary functions to do so? Thanks in advance. I tried to read the documentation myself, but that’s just beyond my skill set.

JB

Jörg Brüggemann
1
0
29. aug. 2025 | 02:22 em
Ämne:
Service and CRMScript Discussion
push_pin lock

Detect merges - possibly via Webhook event?

Hi Everyone, I am trying to figure out whether I can get information out of SuperOffice API when for instance users merge a Person into another Person. Ideally, I would listen for merge events in the webhook, but that doesn't seem to be an option. Does anyone have any knowledge of this or alternative ideas as to how I might achieve this information?   Best Regards, Henrik
Henrik Povlsen
2
4
13. aug. 2025 | 12:31 em
Ämne:
Online development and web service API's

Senaste svar

Hi Henrik,   Try adding the table number, operation and options fields to the output, maybe that gives some hints to what behavior you are seeing.
by David Hollegien
18. aug. 2025 | 09:04 em
push_pin lock

Problems getting data from extra table using REST

I don't get data from the "select" columns when I use "archive/dynamic". The URL I use is   "/archive/dynamic?select=y_produkter.x_hovedgruppe,y_produkter.x_produktnr&$filter=y_produkter.id eq 16" And the response is {"PrimaryKey":"16","EntityName":"y_produkter"} Can anyone see what I'm doing wrong? Is there another way of getting data from extra tables?

FF

Frode Follerås
2
1
18. aug. 2025 | 08:13 fm
Ämne:
Online development and web service API's

Senaste svar

You are missing a dollar sign.  "/archive/dynamic? $ select=y_produkter.x_hovedgruppe,y_produkter.x_produktnr&$filter=y_produkter.id eq 16"
by David Hollegien
18. aug. 2025 | 08:30 fm
push_pin lock

Request Type CRM Script

Isn't it possible to get the Request type for my request in CRM Script? or is it to early days for request types? 😀  
Rune Elleskov
0
1
11. aug. 2025 | 12:28 em
Ämne:
Service and CRMScript Discussion

Senaste svar

Hi Simen Thanks :-)
by Rune Elleskov
12. aug. 2025 | 12:22 em
push_pin lock

Up/downloading big crm documents using script - Script is taking too much memory

I'm trying to up- and downloading documents using crm-script in Customer Portal. The files are big. 50-150 MB. I'm using "printBinary" when I'm downloading. And  "decodeBase64AsStream(base64)" and  "documentAgent.SetDocumentStream(....)" for creating document.   When it's above 50 MB I get " Script is taking too much memory" Is it possible to change the memory limit for a given tentant Id?    

FF

Frode Follerås
2
1
8. aug. 2025 | 12:50 em
Ämne:
Service and CRMScript Discussion

Senaste svar

Thank you for a very good answer! I came also to the same conclusion. The best way to solve this is creating av Custom App.

FF

by Frode Follerås
12. aug. 2025 | 06:18 fm
push_pin lock

Notify user that a new ticket has been created via script (Notify class)

Hi,  I´m currentlly trying to notify a user in the system when a new ticket has been created and assigned to the user with the Notify class and it´s ticket related functions.  However i don´t get any notifications when i try to use the functions "SendNewTicket/SendNewTicketMessage" which i would like to have since they automatically include the link to the ticket. I receive notifications when i use the function "SendCustomMessage".  I have set up my user to a new category where the requests should be handed out so my user becomes the owner directly, but the notification is not appearing.  Is there something i´m missing in order for this to work? (I have checked out an older forum post regarding this problem but the fixes from that one doesn´t seem to work here.) Thanks in advance Fredrik

FL

Fredrik Larsson
0
1
7. aug. 2025 | 12:06 em
Ämne:
Service and CRMScript Discussion

Senaste svar

Just to rule out configuration, have you verified that you have the necessary notification settings turned on?   If "yes", can you try to notify other users and see it they receive anything?
by Simen Mostuen Iversen
8. aug. 2025 | 08:27 fm
push_pin lock

update a bool using setValue

Hello, I'm new to this code language and I still haven't figured a lot out yet. I've got this section of a script:     if (c.setValue("contact_id", contactId.toString())) {         if (mismatchFound) {             c.setValue(BOOL_UDF_KEY, "1");             printLine("Updated:" + companyName);         } else {             c.setValue(BOOL_UDF_KEY, "0");         }         c.save();     } else {         printLine("Failed to load contact: " + contactId.toString());     } Where I'm trying to update a UDF Checkbox, but I don't know exactly how to update it or how to pass the value. Passing it as a string return the error: EjScript::RunTimeException: Value::getBool(): m_type != TypeBool but passing it as anything else is not allowed when using setValue. Any input or advice on this would be greatly appreciated.

FN

Fabian Nilsson
2
2
31. juli 2025 | 06:56 fm
Ämne:
Service and CRMScript Discussion

Senaste svar

Thank you, this worked great!

FN

by Fabian Nilsson
31. juli 2025 | 11:42 fm
push_pin lock

Decompress GZIP in CRMscript

Hi, we're trying to work with data returned form an API endpoint from our ERP system. The data is returned by the HTTP post as JSON that is compressed with GZIP. Is there any way to deflate this data within CRM script? Thanks in advance.

MS

Manuel Severin
2
1
10. juli 2025 | 09:20 fm
Ämne:
Service and CRMScript Discussion

Senaste svar

Hi Manuel,   I don't think CRMscript is capable of applying such a step. I would recommend decompressing 'outside SuperOffice'
by Bas Kreijveld
28. juli 2025 | 07:21 fm
push_pin lock

Webhook on contact.changed or created will not trigger

Hey, I set up a new simple webhook, to just throw something at https://webhook-test.com/ and see what sticks It fired the original "I've been created" message: But nothing but silence ever since. The webhook is active, and from what I can see, correct. But no matter if I change the name, department, category on a contact/company or create a brand new one - nothing but silence from the webhook. Name: Webhook test for when contact is changed or created from service ID: 73 State: 1 Secret: TargetUrl: https://webhook-test.com/d**************************************8 Registered By: BK Registered Date: 2025-07-22 15:58:58 Updated By: Updated Date: Type: webhook Events: - contact.changed - contact.created The webhook was created using CRMScript Rest API: String targetUrl = "https://webhook-test.com/d**************************************8"; NSWebhookAgent webhookAgent; NSWebhook webhook = webhookAgent.CreateDefaultWebhook(); String[] events = String("contact.changed, contact.created").split(","); webhook.SetEvents(events); webhook.SetName("Webhook test for when contact is changed or created from service"); webhook.SetType("webhook"); webhook.SetTargetUrl(targetUrl); webhook = webhookAgent.SaveWebhook(webhook); printLine("Webhook succeeded with ID: " + webhook.GetWebhookId().toString());   I don't see any reason for this not to work. The type could be invalid. In the documentation the examples used crmscript and linking it up to a inlcudename in targetUrl. But since the initial test message went through. I think the webhook-test.com url in targetUrl and type "webhook" is working. Any ideas?     

BK

Bjørn Karlsen
2
2
22. juli 2025 | 02:22 em
Ämne:
Service and CRMScript Discussion

Senaste svar

Hi Bjorn, Propably due to the application pool being recyled during the night, this causes the caches to be flushed. Next time, try running below code to make sure the caches where flushed after registering the webhook: NSDiagnosticsAgent diagnosticsAgent; diagnosticsAgent.FlushCaches();
by David Hollegien
23. juli 2025 | 07:39 fm