Application Programming Interface forums

0 Abonnenter

3 Emner

4962 Samtaler

Area for questions and answers about SuperOffice API's.

All conversations (4962)

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 a.m.
Emne:
Service and CRMScript Discussion

Siste svar

got it: order.0.desc = true
by Jianchun You
6. okt. 2025 | 09:22 p.m.
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 p.m.
Emne:
Service and CRMScript Discussion

Siste svar

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. okt. 2025 | 09:57 a.m.
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
2
8. aug. 2025 | 12:50 p.m.
Emne:
Service and CRMScript Discussion

Siste svar

It's is a thougth. But the problem is when the sales people are going to make changes in the document then they had to make new copy of the document. That is not preferable. And when you use "printBinary" for downloading in Customer Center the script is taking to much memory so it terminates.

FF

by Frode Follerås
2. okt. 2025 | 07:00 a.m.
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 a.m.
Emne:
Service and CRMScript Discussion

Siste svar

Thank you so much, worked perfectly!

FL

by Frederic Lien
28. sep. 2025 | 03:23 p.m.
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 a.m.
Emne:
Service and CRMScript Discussion

Siste svar

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 a.m.
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 p.m.
Emne:
Service and CRMScript Discussion

Siste svar

Ah, so the GUI is not updated. That sounds like a bug :)
by David Hollegien
16. sep. 2025 | 07:38 a.m.
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 p.m.
Emne:
Service and CRMScript Discussion

Siste svar

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 p.m.
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 a.m.
Emne:
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 p.m.
Emne:
Service and CRMScript Discussion

Siste svar

OK, thank you!
by Martin Andersen
4. sep. 2025 | 01:54 p.m.
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
2
1
29. aug. 2025 | 02:22 p.m.
Emne:
Service and CRMScript Discussion

Siste svar

Hi, I am afraid that this will be a bit tricky to implement without being a developer. Basically, you would probably like something called a "webhook" (a mechanism for triggering a script when something changes in the database) for the project and/or projectmember entity. This webhook should execute a CRMScript which will query the db and find all distinct companies that are related to the project (through persons who can be project members). Then it should query all companies that have the checkmark enabled, and finally perform a delta-operation (remove checkmark from companies that should no longer have it, and add checkmark to companies that should get it). Sverre
by Sverre Hjelm
3. sep. 2025 | 07:27 a.m.