Application Programming Interface forums

3 Themen

4933 Gespräche

Area for questions and answers about SuperOffice API's.

push_pin lock

Trigger on Service: New message on request and messge.getAttachments() is empty

Hey, We're trying to get the attachements for a message on this trigger, but Message.getAttachments() is empty when called. If we manually set an old messageId, we do get the attachements. It's almost like the trigger fires before the attachments are stored. Any clever work arounds here? I tried to get the trigger script to sleep. Or do a while loop and wait until the Integer array is filled with something. But seems like it never does.  I hit execution timeout before the array has any entries. So maybe this is some job that is done after the trigger i run? Best Regards Bjørn

BK

Bjørn Karlsen
0
0
7 h, 8 m vor | 02:18 PM
Thema:
Service and CRMScript Discussion
push_pin lock

SuperOffice.SystemUser.Client v1.2 ignores proxy on authentication

Hi There seems to be a bug in the latest version of nuget SuperOffice.SystemUser.Client where the HttpClient provided is not used when authenticating. This results in not using proxy settings and therefore authentication fails when behind proxy. I'm guessing it is this change that causes it Snorre  

SG

Snorre Garmann
2
1
11. Apr. 2025 | 07:49 AM
Thema:
Client libraries and tools

Letzte Antworten

Hello Snorre,  Thank you for reporting this.  This issue belongs on github , so please create an issue there and I will look into it :) /Eivind
by Eivind Fasting
14 h, 17 m vor | 07:10 AM
push_pin lock

Best way to create a new address format in Online

Hi there, i have a customer who'd like a custom address format. In order to do this on-premise i would just copy a layout that already exists, and change the variables i need. Therefore i constructed the following CRM-Script that should copy the 4 other lines, and add them to the addressformat table, with my changed values:   #setLanguageLevel 4; SearchEngine se; se.addField('AddressFormat.addressformat_id'); se.addField('AddressFormat.name'); se.addField('AddressFormat.layout_id'); se.addField('AddressFormat.atype_idx'); se.addField('AddressFormat.address1_line'); se.addField('AddressFormat.address1_subpos'); se.addField('AddressFormat.address1_leadtext'); se.addField('AddressFormat.address1_zip'); se.addField('AddressFormat.address1_length'); se.addField('AddressFormat.address1_flags'); se.addField('AddressFormat.address1_mask'); se.addField('AddressFormat.address2_line'); se.addField('AddressFormat.address2_subpos'); se.addField('AddressFormat.address2_leadtext'); se.addField('AddressFormat.address2_zip'); se.addField('AddressFormat.address2_length'); se.addField('AddressFormat.address2_flags'); se.addField('AddressFormat.address2_mask'); se.addField('AddressFormat.address3_line'); se.addField('AddressFormat.address3_subpos'); se.addField('AddressFormat.address3_leadtext'); se.addField('AddressFormat.address3_zip'); se.addField('AddressFormat.address3_length'); se.addField('AddressFormat.address3_flags'); se.addField('AddressFormat.address3_mask'); se.addField('AddressFormat.city_line'); se.addField('AddressFormat.city_subpos'); se.addField('AddressFormat.city_leadtext'); se.addField('AddressFormat.city_zip'); se.addField('AddressFormat.city_length'); se.addField('AddressFormat.city_flags'); se.addField('AddressFormat.city_mask'); se.addField('AddressFormat.county_line'); se.addField('AddressFormat.county_subpos'); se.addField('AddressFormat.county_leadtext'); se.addField('AddressFormat.county_zip'); se.addField('AddressFormat.county_length'); se.addField('AddressFormat.county_flags'); se.addField('AddressFormat.county_mask'); se.addField('AddressFormat.state_line'); se.addField('AddressFormat.state_subpos'); se.addField('AddressFormat.state_leadtext'); se.addField('AddressFormat.state_zip'); se.addField('AddressFormat.state_length'); se.addField('AddressFormat.state_flags'); se.addField('AddressFormat.state_mask'); se.addField('AddressFormat.zip_line'); se.addField('AddressFormat.zip_subpos'); se.addField('AddressFormat.zip_leadtext'); se.addField('AddressFormat.zip_zip'); se.addField('AddressFormat.zip_length'); se.addField('AddressFormat.zip_flags'); se.addField('AddressFormat.zip_mask'); se.addField('AddressFormat.extraFlags'); se.addField('AddressFormat.labelLayout'); se.addField('AddressFormat.registered'); se.addField('AddressFormat.registered_associate_id'); se.addField('AddressFormat.updated'); se.addField('AddressFormat.updated_associate_id'); se.addField('AddressFormat.updatedCount'); se.addField('AddressFormat.labelLayout2'); se.addField('AddressFormat.isBuiltIn'); se.addCriteria('AddressFormat.addressformat_id', 'In', '211,212,213,214'); //print(se.executeHTMLTable()); SearchEngine sequence; sequence.addField('sequence.id'); sequence.addField('sequence.next_id'); sequence.addField('sequence.TableName'); sequence.addField('sequence.TableNumber'); sequence.addCriteria('sequence.id', 'In', '67'); sequence.execute(); Integer next = sequence.getField('sequence.next_id').toInteger(); //Copy the rows from the search engine to 4 new rows, named "Other - 2 address lines" for(se.execute(); !se.eof(); se.next()){ SearchEngine insert; insert.addData('AddressFormat.addressformat_id', next.toString()); insert.addData('AddressFormat.name', 'Other - 2 address lines'); insert.addData('AddressFormat.layout_id', se.getField('AddressFormat.layout_id')); insert.addData('AddressFormat.atype_idx', se.getField('AddressFormat.atype_idx')); insert.addData('AddressFormat.address1_line', se.getField('AddressFormat.address1_line')); insert.addData('AddressFormat.address1_subpos', se.getField('AddressFormat.address1_subpos')); insert.addData('AddressFormat.address1_leadtext', se.getField('AddressFormat.address1_leadtext')); insert.addData('AddressFormat.address1_zip', se.getField('AddressFormat.address1_zip')); insert.addData('AddressFormat.address1_length', se.getField('AddressFormat.address1_length')); insert.addData('AddressFormat.address1_flags', se.getField('AddressFormat.address1_flags')); insert.addData('AddressFormat.address1_mask', se.getField('AddressFormat.address1_mask')); insert.addData('AddressFormat.address2_line', se.getField('AddressFormat.address2_line')); insert.addData('AddressFormat.address2_subpos', se.getField('AddressFormat.address2_subpos')); insert.addData('AddressFormat.address2_leadtext', se.getField('AddressFormat.address2_leadtext')); insert.addData('AddressFormat.address2_zip', se.getField('AddressFormat.address2_zip')); insert.addData('AddressFormat.address2_length', se.getField('AddressFormat.address2_length')); insert.addData('AddressFormat.address2_flags', se.getField('AddressFormat.address2_flags')); insert.addData('AddressFormat.address2_mask', se.getField('AddressFormat.address2_mask')); insert.addData('AddressFormat.address3_line', '0'); insert.addData('AddressFormat.address3_subpos', '0'); insert.addData('AddressFormat.address3_leadtext', '0'); insert.addData('AddressFormat.address3_zip', se.getField('AddressFormat.address3_zip')); insert.addData('AddressFormat.address3_length', '0'); insert.addData('AddressFormat.address3_flags', se.getField('AddressFormat.address3_flags')); insert.addData('AddressFormat.address3_mask', se.getField('AddressFormat.address3_mask')); insert.addData('AddressFormat.city_line', '3'); insert.addData('AddressFormat.city_subpos', se.getField('AddressFormat.city_subpos')); insert.addData('AddressFormat.city_leadtext', se.getField('AddressFormat.city_leadtext')); insert.addData('AddressFormat.city_zip', se.getField('AddressFormat.city_zip')); insert.addData('AddressFormat.city_length', se.getField('AddressFormat.city_length')); insert.addData('AddressFormat.city_flags', se.getField('AddressFormat.city_flags')); insert.addData('AddressFormat.city_mask', se.getField('AddressFormat.city_mask')); insert.addData('AddressFormat.county_line', se.getField('AddressFormat.county_line')); insert.addData('AddressFormat.county_subpos', se.getField('AddressFormat.county_subpos')); insert.addData('AddressFormat.county_leadtext', se.getField('AddressFormat.county_leadtext')); insert.addData('AddressFormat.county_zip', se.getField('AddressFormat.county_zip')); insert.addData('AddressFormat.county_length', se.getField('AddressFormat.county_length')); insert.addData('AddressFormat.county_flags', se.getField('AddressFormat.county_flags')); insert.addData('AddressFormat.county_mask', se.getField('AddressFormat.county_mask')); insert.addData('AddressFormat.state_line', se.getField('AddressFormat.state_line')); insert.addData('AddressFormat.state_subpos', se.getField('AddressFormat.state_subpos')); insert.addData('AddressFormat.state_leadtext', se.getField('AddressFormat.state_leadtext')); insert.addData('AddressFormat.state_zip', se.getField('AddressFormat.state_zip')); insert.addData('AddressFormat.state_length', se.getField('AddressFormat.state_length')); insert.addData('AddressFormat.state_flags', se.getField('AddressFormat.state_flags')); insert.addData('AddressFormat.state_mask', se.getField('AddressFormat.state_mask')); insert.addData('AddressFormat.zip_line', '3'); insert.addData('AddressFormat.zip_subpos', se.getField('AddressFormat.zip_subpos')); insert.addData('AddressFormat.zip_leadtext', se.getField('AddressFormat.zip_leadtext')); insert.addData('AddressFormat.zip_zip', se.getField('AddressFormat.zip_zip')); insert.addData('AddressFormat.zip_length', se.getField('AddressFormat.zip_length')); insert.addData('AddressFormat.zip_flags', se.getField('AddressFormat.zip_flags')); insert.addData('AddressFormat.zip_mask', se.getField('AddressFormat.zip_mask')); insert.addData('AddressFormat.extraFlags', se.getField('AddressFormat.extraFlags')); insert.addData('AddressFormat.labelLayout', se.getField('AddressFormat.labelLayout')); insert.addData('AddressFormat.registered', se.getField('AddressFormat.registered')); insert.addData('AddressFormat.registered_associate_id', se.getField('AddressFormat.registered_associate_id')); insert.addData('AddressFormat.updated', se.getField('AddressFormat.updated')); insert.addData('AddressFormat.updated_associate_id', se.getField('AddressFormat.updated_associate_id')); insert.addData('AddressFormat.updatedCount', se.getField('AddressFormat.updatedCount')); insert.addData('AddressFormat.labelLayout2', se.getField('AddressFormat.labelLayout2')); insert.addData('AddressFormat.isBuiltIn', 'false'); insert.insert(); next = next + 1; } //Update sequence with the new next_id sequence.addData('sequence.next_id', next.toString()); sequence.addCriteria('sequence.id', 'In', '67'); sequence.update();   This Does not work however. I'm getting the following error, that does not really provide me with any help:   So do i really have to send a SQL command to support for them to execute, or what is best practise for me to create a custom address format with the tools available?   Thanks!  
Dennis Aagaard Mortensgaard
3
8
21. März 2025 | 12:29 PM
Thema:
Service and CRMScript Discussion

Letzte Antworten

Well if you update something using the SearchEngine you are bypassing all business logic, so it is not strange that the cache is not updated in that case. It should be updated when you do it through the API/List agent.  If you call DiagnosticsAgent.FlushCaches() after updating and before retrieving, do you the get the correct id's back? so: #setLanguageLevel 4; Integer countryId = 827; Integer customAddressFormatId = 17; NSListAgent listAgent; NSDiagnosticsAgent diagnosticsAgent; NSCountry customCountry = listAgent.GetCountry(countryId); customCountry.SetAddressLayoutId(customAddressFormatId ); customCountry.SetForeignAddressLayoutId(customAddressFormatId ); customCountry.SetDomesticAddressLayoutId(customAddressFormatId ); customCountry = listAgent.SaveCountry(customCountry); diagnosticsAgent.FlushCaches(); customCountry = listAgent.GetCountry(countryId); printLine(customCountry.GetAddressLayoutId().toString()); printLine(customCountry.GetForeignAddressLayoutId().toString()); printLine(customCountry.GetDomesticAddressLayoutId().toString());
by David Hollegien
16. Apr. 2025 | 12:04 PM
push_pin lock

Get data from custom object selections via crmscript

I have tried to fetch the data from a custom object selection (dynamic) with these functions but they don´t give me the result i was looking for.  The function GetSelectionMembersArchiveRows on the NSSelectionAgent does only return the selectionId in its columndata when i loop the rows. I also tried to fetch the restrictions from the function GetDynamicSelectionCriteria which crashes because there is no registered plugin for that specific archive. (In this case (ExtraTable databaseField + DynamicSelection)) Are there any other functions / ways to retrieve data from a custom object selection(Dynamic) via crmscript?

FL

Fredrik Larsson
3
7
11. Apr. 2025 | 06:24 AM
Thema:
Service and CRMScript Discussion

Letzte Antworten

Hi Fredrik, The best ways to work with dynamic selections, and to use the Search API's in general, is to understand how the Find and Selection APIs actually work. This applies to both RESTful and CRMScript APIs.  Spending 30 minutes reading the Search API section will save you months in head-scratching.  Hope this helps!
by Tony Yates
14. Apr. 2025 | 08:08 AM
push_pin lock

How can we fetch the users local settings language

Hi, As the topic states, how can we fetch the user license using the Netserver? The closest we have actually found is the homecountry from SoContext.CurrentPrincipal, but, that does not really work :) Do we have to use the findagent and fetch the language from userprefference table or something?
Pär Pettersson
2
2
11. Apr. 2025 | 07:49 AM
Thema:
Online development and web service API's

Letzte Antworten

Wow, thanks alot man! Really appreciate it
by Pär Pettersson
11. Apr. 2025 | 08:01 AM
push_pin lock

Rest API: Filter Ticket by status

Hi, I want list tickets which are Active. - using "status" give zero or all tickets. - using "BaseStatus" give zero tickets. I'm tring various oprators: eq, contains, etc

SK

Sebastian Kaczmarkiewicz
1
1
2. Apr. 2025 | 01:44 PM
Thema:
Online development and web service API's

Letzte Antworten

Solved

SK

by Sebastian Kaczmarkiewicz
9. Apr. 2025 | 10:34 AM
push_pin lock

Setting Quote Version Custom Address through API

Hi community. I'm trying to set custom delivery address in SuperOffice using scripts, and I can't get it to work 100%. It seems like there is a bug, such that this cannot be set using crmscript, so I'm trying to do it using the Agent API. For some reason only Address1 and Address2 can be set, but not Zipcode and City, and I can't figure out why. Look at the following two code-snippets. The first one, is the one I set using contactAgent/SaveQuoteVersionAddressAsync, and the second is from the network-tab using normal Quote in SuperOffice directly. What am I doing wrong? Object I send with the contactAgent/SaveQuoteVersionAddressAsync request: { "quoteVersionId": 52061, "address": { "tableRight": null, "fieldProperties": {}, "wgs84Latitude": 0, "wgs84Longitude": 0, "localizedAddress": [ [ { "tableRight": null, "fieldProperties": {}, "name": "Address1", "value": "Adresse 1", "tooltip": "", "label": "SR_AL_ADDRESS1", "valueLength": 80, "addressType": "PersonPrivateAddress" } ], [ { "tableRight": null, "fieldProperties": {}, "name": "Address2", "value": "Adresse 2", "tooltip": "", "label": "SR_AL_ADDRESS2", "valueLength": 80, "addressType": "PersonPrivateAddress" } ], [ { "tableRight": null, "fieldProperties": {}, "name": "Zipcode", "value": "6000", "tooltip": "", "label": "SR_AL_POSTCODECITY", "valueLength": 12, "addressType": "PersonPrivateAddress" }, { "tableRight": null, "fieldProperties": {}, "name": "City", "value": "Kolding", "tooltip": "", "label": "", "valueLength": 80, "addressType": "PersonPrivateAddress" } ] ], "street": { "atypeIdx": "QuoteShippingAddress", "address1": "", "address2": "", "address3": "", "city": "", "county": "", "state": "", "zipcode": "", "formatted": "" }, "postal": null, "formatted": null }, "addressType": "QuoteShippingAddress", "countryId": 208 } Object I've fetched from dev-tools: { "QuoteVersionId": 52061, "Address": { "TableRight": null, "FieldProperties": {}, "Wgs84Latitude": 0, "Wgs84Longitude": 0, "LocalizedAddress": [ [ { "TableRight": null, "FieldProperties": {}, "Name": "Address1", "Value": "Adresse 11", "Tooltip": "", "Label": "SR_AL_ADDRESS1", "ValueLength": 80, "AddressType": "PersonPrivateAddress" } ], [ { "TableRight": null, "FieldProperties": {}, "Name": "Address2", "Value": "Adresse 22", "Tooltip": "", "Label": "SR_AL_ADDRESS2", "ValueLength": 80, "AddressType": "PersonPrivateAddress" } ], [ { "TableRight": null, "FieldProperties": {}, "Name": "Zipcode", "Value": "6000", "Tooltip": "", "Label": "SR_AL_POSTCODECITY", "ValueLength": 12, "AddressType": "PersonPrivateAddress" }, { "TableRight": null, "FieldProperties": {}, "Name": "City", "Value": "Kolding", "Tooltip": "", "Label": "", "ValueLength": 80, "AddressType": "PersonPrivateAddress" } ] ], "Street": { "AtypeIdx": "QuoteShippingAddress", "Address1": "Adresse 1", "Address2": "Adresse 2", "Address3": "", "City": "Kolding", "County": "", "State": "", "Zipcode": "6000", "Formatted": "Adresse 1\nAdresse 2\n60000 Kolding\n" }, "Postal": null, "Formatted": null }, "AddressType": "QuoteShippingAddress", "CountryId": 208 }       dfd

KR

Kasper Rosenlund
2
1
8. Apr. 2025 | 08:00 AM
Thema:
Online development and web service API's

Letzte Antworten

Hi Kasper, Try only posting the required fields instead of setting LocalizedAddress/street/post/formatted. If you want to set the QuoteShippingAddress, only set the Street portion, if you want to set the QuoteBillingAddress, only set the Postal portion. Do note that this should work in CRMScript, see this thread for a code sample: https://community.superoffice.com/en/technical/forums/api-forums/service-crmscript/set-userdefined-delivery-address-from-quote-by-scripts/
by David Hollegien
8. Apr. 2025 | 03:39 PM
push_pin lock

Open a link in another tab

Hi all   we are looking for a way to open a link in another tab.  Vi can easily change to the correct tab by calling     SuperOffice.ClientCrossMessaging.executeSoProtocol("project."+tab+"?project_id="+id);    but we can't find a way to specify the URL to open. I fairly sure this was possible in the windows version.

IT

Inge Simon Thorbjørnsen
2
3
3. Apr. 2025 | 01:37 PM
Thema:
Online development and web service API's

Letzte Antworten

Hi Inge!  OK, so soprotocol is used as a means to perform navigation in SuperOffice. It does not support passing extra parameters other than known currents, i.e. contact_id=2, project_id=2, etc.  The last example provided targets a web panel with extra unknown parameters. As you know, but for those who do not, a web panel is an pre/defined iFrame in the Web Panel list, with a PRE_DEFINED URL and query string parameters. We support template variables as values for those known template variables, which also generally map to known currents.  What you are seeking is something other than the built-in / supported mechanisms. Perhaps a feature wish? One way you could perform such a mechanism is to use the API to change the web panel URL, and then issue the soprotocol to simply "contact.gadgettab" and it would navigate to where you set in the previous update. Of course, this is global and would affect ALL users.  Alternatively, you could use known template variables and pass that into the sprotocol string, which should then be respected by the web panel definition and populated and sent to your pre-defined url accordingly. There are other mechanisms, such as Foreign Keys, that you could use associate with said project_id and link it up before the invocation and handle it in the destination page accordingly. Best regards.  
by Tony Yates
4. Apr. 2025 | 11:48 AM
push_pin lock

WebAPI 10: error on QuoteAgent SaveQuoteLineImageAsync function

Hello everyone, In our custom app, we are supposed to replace product images for products in the quote. We first search the quote lines And after that we replace the image for each line using the function SaveQuoteLineImageAsync. Unfortunately, we get a "Not Implemented" error on this call: We have tried WebAPI in versions 10.2 and 10.5, with the same result. This customer is using one of our quote connectors.  We have searched, but could not find the proper method for overwriting. Does the error have to do with the Quote connector or is the method really not yet implemented in Rest API? Thank you in advance! Best regards, Andrey

AS

Andrey Stupak
1
10
1. Apr. 2025 | 10:57 AM
Thema:
Online development and web service API's

Letzte Antworten

https://community.superoffice.com/en/product-releases/bugs-wishes/product-issue/?bid=74847&azure=1
by Georg Diczig
3. Apr. 2025 | 03:05 PM
push_pin lock

Adding Message to Ticket object in Online REST API

Having existing Ticket with given ID, how I can create full (with body) TicketMessage and add it to mentioned Ticket. I could not see field TicketId in any  endpoint of /TicketMessage https://docs.superoffice.com/en/api/reference/restful/rest/TicketMessage/index.html Am I missing something? I see field “Ticket”, but I assume it can’t work this way that I’m put whole Ticket object just to referenced. (esp. that in example I see it is null) Please help me with that one.

SK

Sebastian Kaczmarkiewicz
1
0
2. Apr. 2025 | 07:23 AM
Thema:
Online development and web service API's
No items to display