Application Programming Interface forums

0 Prenumeranter

3 Ämnen

4969 Samtal

Area for questions and answers about SuperOffice API's.

All conversations (4969)

done
Answered
push_pin lock

Does EventDataDialogDefinition work properly on mobile CRM?

What I was trying to do I created an “After request saved” trigger that uses a yes/no EventDataDialogDefinition to display a dialog asking the user whether they want to send an email when the ticket status is changed, on mobile CRM. What I expected to happen I expected the dialog to appear every time the ticket status is changed in Mobile CRM. What actually happened In the online CRM version, everything works as expected. In Mobile CRM, the behavior is inconsistent: When changing the status using the pen icon and updating it that way, the trigger runs and the dialog opens. When changing the status using quick change or the top-right options button, the trigger does not behave the same. With “After saving request” , the trigger does not run at all. I then tested additional trigger types ( “ Request changed status ” and “ Request saved ” ). These triggers did run when updating via quick change / options, but the dialog did not open. Steps to reproduce the problem Create an "After request saved", “Request saved”, or "Request changed status" trigger that uses EventDataDialogDefinition to open a yes/no dialog. Open a request in Mobile CRM. Change the status via the pen icon → dialog opens. Change the status via quick change or the options button → trigger may run, but the dialog does not appear. #setLanguageLevel 4; // Displays delete ticket yes/no dialog Void DisplayDialog(EventData ed) { // Display dialog EventDataDialogDefinition dialog; dialog.setIcon("question"); dialog.setType("yesno"); dialog.setPrefix("openDialog_"); dialog.setTitle("Some title"); dialog.setText("Some text"); ed.showDialog(dialog); } EventData ed = getEventData(); String dialogResponse = ed.getInputValue("openDialog_button"); if (dialogResponse.isEmpty()) DisplayDialog(ed); // Do nothing if (dialogResponse == "no") return; if (dialogResponse == "yes") // Send email   Question Is this intended behavior in Mobile CRM, or could this be a potential bug?    

ES

Eivind Simonsen
0
1
4 h, 6 m sedan | 03:19 em
Ämne:
Service and CRMScript Discussion

Senaste svar

Hi Eivind, This might be related to this bug, please evaluate tracing results in Mobile and/or in Desktop and compare: https://community.superoffice.com/en/product-releases/bugs-wishes/product-issue/?bid=89507&azure=1
by Bas Kreijveld
4 h, 4 m sedan | 03:21 em
done
Answered
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
5
13. aug. 2025 | 12:31 em
Ämne:
Online development and web service API's

Senaste svar

Hi David, This was extremely helpful - thank you so much! :-) Best Regards, Henrik
by Henrik Povlsen
11 h, 26 m sedan | 07:59 fm
done
Answered
push_pin lock

Where can I find EventData commands?

Hello! In this guide I found for task menus , I found a fatastic piece of code that looks like this:  ed.setStateValue( "command:ticket.tab.close" , ticketId); I have many scripts where I want to do things like this, and have before this used soprotocol to navigate around the environment using code. But, soprotocol has it's limitations in the documentation and mainly navigating to new places and creating new enitytys is possible. So I tried looking around the documentation for more commands, and I have not found anything, not in the EventData class or the class method documentation for SetSateValue. So, I was wondering, where do I find the documentation for the state value commands for event data? And as a sub-question, is there a command to force-reload the page you are on? Or specific spaces in SuperOffice? That would also be a wonderful thing, to not have to use html and the window-methods to force a reload. 
Beata Martinsson
1
0
19. nov. 2025 | 02:19 em
Ämne:
Service and CRMScript Discussion
done
Answered
push_pin lock

Cannot relate Ticket.tags (text array) to Tags.tags_id (integer PK) in Power BI — how to resolve the mismatch?

Hi everyone! I'm working with data from our CRM system and modeling it in Power BI. I’ve encountered a structural issue between two tables: Ticket Contains a field called tags , which stores a foreign key array . The values in this field are text strings , not numeric IDs. Tags Contains a field called tags_id , which is the primary key . This PK is a numeric indexed field (clustered, unique). The problem is that the Ticket.tags field contains text-based identifiers, while the Tags.tags_id field is numeric. Because of this, it's not possible to create a direct relationship in Power BI between the two tables. I'm looking for guidance on: How the CRM system expects these fields to be related; Whether there is a missing mapping table or lookup logic; Or if there's a recommended method for converting the text values in Ticket.tags into the numeric tags_id values so they can be modeled properly in Power BI. Any insight into how these two fields are intended to connect would be greatly appreciated.

NT

Neri Kim Thoresen
3
2
17. nov. 2025 | 02:20 em
Ämne:
Service and CRMScript Discussion

Senaste svar

Thanks a lot! I will try that approach.

NT

by Neri Kim Thoresen
18. nov. 2025 | 08:31 fm
done
Answered
push_pin lock

GetUserDefinedFields from all contact

Hi, i have a field definied for contact the field is SuperOffice:43. By more contact are this field set to 44444. How can i make a SearchEngine, to give me, all the contact that have SuperOffice:43 = 44444 ? Have you got any Idea? Thanks

FR

Fabrice Reithinger
2
1
14. nov. 2025 | 02:25 em
Ämne:
Service and CRMScript Discussion

Senaste svar

My recommendation would be to use an archive provider query, it's faster. #setLanguageLevel 4; NSArchiveRestrictionInfo[] restrictions; NSArchiveRestrictionInfo res1; res1.SetName("contactUdef/SuperOffice:43"); res1.SetOperator("="); res1.SetValues(String("44444").split(",")); restrictions.pushBack(res1); NSArchiveOrderByInfo[] order; String[] entities = String("contact").split(","); Integer pageSize = 250; NSArchiveAgent archiveAgent; NSArchiveListItem[] rows = archiveAgent.GetArchiveListByColumns("SimpleContact", String("contactId,name,contactUdef/SuperOffice:43").split(","), order, restrictions, entities, 0, pageSize); foreach (NSArchiveListItem row in rows) { Map rowData = row.GetColumnData(); String contactId = rowData.get("contactId"); String contactName = rowData.get("name"); String contactUdef = rowData.get("contactUdef/SuperOffice:43"); printLine(contactId + ": " + contactName + "=> " + contactUdef ); } Hope this helps!
by Tony Yates
14. nov. 2025 | 02:44 em
done
Answered
push_pin lock

Trigger in Flow does not trigger when using CRM-script

I have a simple flow which adds a person to a static selection when a person is added as a project member to a project. The flow works fine when you manually adds a project member. But when I do it by CRM-script, the flow doesn't trigger. I use the code below to add project memeber. Is this a bug? NSProjectAgent pAgent; NSProjectEntity project = pAgent.GetProjectEntity(16); NSProjectMember[] members = project.GetProjectMembers(); NSProjectMember pMember; pMember.SetProjectId(project.GetProjectId()); pMember.SetContactId(809); pMember.SetPersonId(1143); members.pushBack(pMember); project.SetProjectMembers(members);   project = pAgent.SaveProjectEntity(project);

FF

Frode Follerås
1
0
12. nov. 2025 | 08:12 fm
Ämne:
Service and CRMScript Discussion
done
Answered
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, or with other Alternative?   Many Thanks!   Jianchun
Jianchun You
2
2
28. okt. 2025 | 03:59 em
Ämne:
Service and CRMScript Discussion

Senaste svar

Hi Tony, that's good idea and works fine, new Function disvovered. Many Thanks!  
by Jianchun You
5. nov. 2025 | 02:54 em
done
Answered
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 em
Ämne:
Service and CRMScript Discussion

Senaste svar

Thank you. copyCRMDocumentToAttachment helped some. It did not work on 90 MB, but it on worked 75 MB. I have not found the max yet.

FF

by Frode Follerås
29. okt. 2025 | 02:47 em
done
Answered
push_pin lock

Is NSNumberAllocationAgent updated lately?

Hello! I've recently come across a support ticket where certain users are unable to create a new contact. Reason being a trigger we created several years ago now throws an error. In this trigger we run NSNumberAllocationAgent.SaveCountRefEntity() in context of a user, but this only works for users with user level 0, We're not sure if the customer has done any changes to their users, or if the access rights for this method has changed with SuperOffice release 11.5?   Example code: #setLanguageLevel 4; NSNumberAllocationAgent numAllocAgent; NSRefCountEntity contactNumberEntity = numAllocAgent.GetRefCountEntity(96); // 96 = Contact number counter Integer incrementedNumber = contactNumberEntity.GetCurrentValue() + 1; // Save the incremented number to counter in database contactNumberEntity.SetCurrentValue(incrementedNumber); numAllocAgent.SaveRefCountEntity(contactNumberEntity); // This one fails!!   Throws error for users outside user level 0:

ES

Eivind Simonsen
3
2
29. okt. 2025 | 08:18 fm
Ämne:
Service and CRMScript Discussion

Senaste svar

Hi Eivind, Yes, I can confirm that this was also included in recent security fix deployed in 11.5. I beleive the mindset is that things that can only be done in Settings and maintenance are things that should only be done by administrators.  It's our business logic that increments Contact numbers when new companies are created. It's not known when these values should be changed otherwise, so we would very much be interested in learning more about your use case that doesn't match the intended behavior. I see you using CRMScript for this - in the context of a non-admin user. If this was a custom application you could perform the changed as a system user. Please send me an email with more context and I'll take it up with the product team for evaluation.  Best regards.
by Tony Yates
29. okt. 2025 | 10:12 fm
done
Answered
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 fm
Ämne:
Service and CRMScript Discussion

Senaste svar

got it: order.0.desc = true
by Jianchun You
6. okt. 2025 | 09:22 em