Application Programming Interface forums

0 Subscribers

3 Topics

4963 Conversations

Area for questions and answers about SuperOffice API's.

All conversations (4963)

push_pin lock

Is possible to get a filtered Activity-List

Hi, In each Sales we have a  number of archived Emails & Docus, some Emails should be listed for our Logistics User. Therefore we have created a UDF-Checkbox "Logistics" and a Tabs with Custom Screen for Logistics, where we want to have the same but filtered Activity-List: filtered List of Emails & Docus of the current Sales only with this checked Checkbox; Has Download Function via Webtools like in Standart Acrivity-List; and Preview via Minicard. Is this possible?   Many Thanks!   Jianchun
Jianchun You
1
0
5 m ago | 03:59 PM
Topic:
Service and CRMScript Discussion
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
3
3
8 Aug 2025 | 12:50 PM
Topic:
Service and CRMScript Discussion

Last reply

Hi Frode, This is not the best solution, but perhaps a viable workaround. If the customer is to download a CRM document, then you can have a link that just-in-time copies the CRM document to an attachment (method: Integer copyCRMDocumentToAttachment(Integer)), and then redirects the customer to the attachment download link. The script could also register a row in an extra table for a job that cleans up the attachment after some time. Sverre
by Sverre Hjelm
14 Oct 2025 | 11:34 AM
push_pin lock

set DateAdd in Screen Simple Value

Hi, In the Custom Screen for 'Edit Ticket' i can define specialized List in Simple Value to display filtered project List related to Tickets: Now I want to display a Date-Field UDF of Project in this Project List. in SO Datebase the Date-Field is stored with a large number. Then i try to convert it as a Date: Now I click Edit Ticket and by seaching in Project list, it pops up with an Error: Question is, how could i convert to display a date-field from a large number in Screen Simply Value?   Thanks for your Helps.
Jianchun You
1
2
24 Sep 2025 | 09:08 AM
Topic:
Service and CRMScript Discussion

Last reply

got it: order.0.desc = true
by Jianchun You
6 Oct 2025 | 09:22 PM
push_pin lock

Get/Set information about E-marketing on person card

If im not mistaken, its standard to have E-marketing on the person card for mailings. I'm wondering how you can get/set these values from CRMScript. Been trying to read around the  person table , NSPerson , NSPersonAgent and NSPersonEntity classes, but not finding any useful information on it.

FL

Frederic Lien
2
2
30 Sep 2025 | 02:40 PM
Topic:
Service and CRMScript Discussion

Last reply

Both consent info and shipment types can be set using the personentity with the personagent;   #setLanguageLevel 4; Integer personId = 1754; NSPersonAgent personAgent; NSPersonEntity personEntity = personAgent.GetPersonEntity(personId); NSConsentInfo[] personConsents = personEntity.GetConsents(); foreach (NSConsentInfo personConsent in personConsents) { Bool isEmarketing = personConsent.GetConsentPurposeKey().equalsIgnoreCase("EMARKETING"); // do things } NSSelectableMDOListItem[] shipmentTypes = personEntity.GetShipmentTypes(); // do things personEntity.SetShipmentTypes(shipmentTypes); personEntity = personAgent.SavePersonEntity(personEntity);
by David Hollegien
2 Oct 2025 | 09:57 AM
push_pin lock

Delay in CRMScript

Is it possible to add a delay in CRMScript? Say i want to wait 5 minutes before sending an email when the script is triggered. 

FL

Frederic Lien
2
1
26 Sep 2025 | 09:13 AM
Topic:
Service and CRMScript Discussion

Last reply

Thank you so much, worked perfectly!

FL

by Frederic Lien
28 Sep 2025 | 03:23 PM
push_pin lock

getting the personid of the current contact

Is there a better way to get the personId of the current contact than using getCgiVariable("personId")? Lately this has become unstable and often returns the personId of a previously viewed user. The following script is run when a user clicks a button on either a contact card or a ticket/request. So what I need in the end is the x_personid, which is a custom field on person. #setLanguageLevel 4; Integer personId = getCgiVariable("personId").toInteger(); if (personId.isNull() == true || personId < 1) { setVariable("url", getProgramBlogic() + "&action=doScript&includeId=close"); } String externalPersonId; SearchEngine se; se.addField("person.x_personid"); se.addCriteria("person.person_id", "Equals", personId.toString()); if(se.select() > 0) externalPersonId = se.getField(0); if(externalPersonId.toInteger()>0) setVariable("url", "https://bn.app.local/Customer/Link/" + externalPersonId); else setVariable("url", getProgramBlogic() + "&action=doScript&includeId=close");

SG

Snorre Garmann
3
7
12 Sep 2025 | 06:19 AM
Topic:
Service and CRMScript Discussion

Last reply

Thanks all for helping to clarify the issue. I have created a bug report for this: BUG ID: 82774 and prompted the team. Best regards!  
by Tony Yates
19 Sep 2025 | 11:52 AM
push_pin lock

Intended use of the new 'load request' and 'load request message' CRMScript triggers

Hi, We have been hitting some issues/road blocks with migrating customers to the new service solution, where the customization possibilties are much more restricted. One of the issues we have been hitting a lot is being unable to automatically fill in fields (either custom or default), in the 'old service' we could do this with url variables. In New Service this has not been possible (so protocol does not work). Now with these new triggers we where hoping we could solve these challenges (and migrate more of our customers to new service), but sadly with the first 2 scenario's we tried it, immediately hit an issue: #1 Setting a custom field value based on soprotocol, immediately hit a bug that getNavigateTo () does not work in triggers, preventing us from getting the SOProtocol being navigated to (if it works like that) #2 Just tried to set the ticket priority based on the linked person contact ticket priority, but setting 'TicketEntity.Priority.TicketPriorityId' with setOutputValue doesn't do anything. What is the intended use cases of this triggers here, should setting values with setOutputValue work? The documentation of these triggers is not made yet (# 2185 ), so we are not sure if we are looking at bugs here or if this is not the intended use case.
David Hollegien
2
1
15 Sep 2025 | 05:47 PM
Topic:
Service and CRMScript Discussion

Last reply

Ah, so the GUI is not updated. That sounds like a bug :)
by David Hollegien
16 Sep 2025 | 07:38 AM
push_pin lock

Error running a script from the Task Menu

Hi All, I am not sure if this is support or SuperOffice communiuty, but I have a site that cannot run CRM Scripts via the task menu button. Currently the script just has the following code. #setLanguageLevel 4; EventData ev = getEventData(); log(ev.getInputValues().toJson()); String test = "1"; If I run the code from the scripting section of the Admin client the script runs with no issues (I have a trace on this). However, if I link the script to a Task Menu button, when I run the option on the task menu I get the following errors. At the top of the page I get: Something went wrong with api/v1/Agents/CRMScript/ExecuteScriptAsEvent: [object Object] In a pop up dialog I get: Request failed with status code 403 Nothing gets recorded in the trace, so the script does not even get as far as running. Does anyone have any idea as to why I would get this issue? Many thanks, Trevor
Trevor Sharp
2
4
15 Sep 2025 | 03:19 PM
Topic:
Service and CRMScript Discussion

Last reply

Hi David, You're a genius !!! It was the SymmetricKey and Secret that did not match up.  Now I have corrected this, the script is running from the task menu. Thank you very much for your help with this. Trevor
by Trevor Sharp
15 Sep 2025 | 05:29 PM
push_pin lock

Max size uploading document using the API. Error above 75 MB

When I upload docs > 75 MB I get "Maximum request length exceeded". I'm using:  savedDocument = await docAgent.SetDocumentStreamAsync(savedDocument, sreader.BaseStream, true);   Less then 75 MB is fine.  I thought 94.4 MB was max and the time for a file upload is 5 min. ( What is the maximum size of an attachment which can be uploaded in SuperOffice CRM? ) Is there a limit using the API? I'm testing against SOD.

FF

Frode Follerås
1
0
9 Sep 2025 | 11:54 AM
Topic:
Online development and web service API's
push_pin lock

Timeout 120 seconds

Hello! Is there any way to run a schedueled script for more than 120 seconds? It is not a very long time. Regards Martin
Martin Andersen
2
1
4 Sep 2025 | 01:49 PM
Topic:
Service and CRMScript Discussion

Last reply

OK, thank you!
by Martin Andersen
4 Sep 2025 | 01:54 PM