Application Programming Interface forums

0 Subscribers

3 Topics

4932 Conversations

Area for questions and answers about SuperOffice API's.

All conversations (4932)

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
2
4
11 Apr 2025 | 06:24 AM
Topic:
Service and CRMScript Discussion

Last reply

Hi David, This is the version: Release_10.5.4_2025.04.03-04. I have checked the company relation field and the hide field parameter is unchecked. This is the code I´m trying to run. NSSAgent.GetSelectionMembersArchiveRows(selectionId, "id,x_company"); And this is the response. {"id":"[I:123456]","selectionId":"7455"} However in the GetLinkHint function do I receive data for the field. nav=customobject&tableName=y_test&id=342670&x_company=1&PkName=id

FL

by Fredrik Larsson
11 Apr 2025 | 11:14 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
Topic:
Online development and web service API's

Last reply

Wow, thanks alot man! Really appreciate it
by Pär Pettersson
11 Apr 2025 | 08:01 AM
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
1
0
11 Apr 2025 | 07:49 AM
Topic:
Client libraries and tools
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
Topic:
Online development and web service API's

Last reply

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
Topic:
Online development and web service API's

Last reply

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
Topic:
Online development and web service API's

Last reply

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
Topic:
Online development and web service API's

Last reply

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
Topic:
Online development and web service API's
push_pin lock

fetch deleted data from Webhook

Hi, I want to fetch the Stakeholder (in my case buyer, supplier, enduser, saleperson, etc) Data in the UDF of its Sale. It runs well by Trigger After Saving Stakeholder, but by Deleting Stakeholder, I expect the UDF should be empty. The Trigger doesn't work for Deleting. Alternative i have registered a Webhook and there i added Events "salestakeholder.deleted". Now I can implement the Logic what should happen by this Events, namely i want to fetch the sale id and stakeholderrole id, and if stakeholderrole id is sth.(buyer, supplier, enduser, saleperson), then the filled UDF of sale id should be empty. But it doesn't work, if i trace this to end, the sale id and stakeholderrole id has still no Values, no matter via SearchEngine, or via Entity NSSaleStakeholder. I unterstand at this moment of Webhook, the Stakeholder was deleted therefore no Values of both. But I see in the trace, the value was saved in the map Values (green framed in the Screenshots). How could I fetch the data of Values? because it is not available in crm scripts, or any better advice? Thanks!   By the way, is there a way to get current SoProtocal where the User is having? I want to update the current Page of User with setNavigateTo soProtocol.
Jianchun You
3
2
1 Apr 2025 | 01:36 PM
Topic:
Service and CRMScript Discussion

Last reply

Thanks David. I got the Values from getCgiContent(), that's Requests of Webhook in Json-Format, then fetch the SaleId and StakeholderId from Token "Values".
by Jianchun You
1 Apr 2025 | 09:03 PM
push_pin lock

SearchEngine vs Selections on company category

Wondering why when i make a Selection of companies that have the category of "Eksisterende Kunde", i get a total of 487 companies, however when i try to make a script to catch all of these existing companies, i get a total of 244? (Category "Eksisterende kunde" is category_idx = 1)   SearchEngine se ; se . addFields ( "contact" , "name,contact_id,category_idx.name,category_idx" ); se . addCriteria ( "contact.category_idx" , "OperatorEquals" , "1" ); Integer count = 0 ; for ( se . execute (); !se . eof (); se . next ()) {   print ( se . getField ( 0 ) + " | " + se . getField ( 1 ) + " | " + se . getField ( 2 ) + " | " + se . getField ( 3 ) + "\n" );   se . next ();   count++ ; } print ( count . toString ());

FL

Frederic Lien
0
1
27 Mar 2025 | 05:59 AM
Topic:
Service and CRMScript Discussion

Last reply

Hi Frederic You are running se.next() twice, both in your if statement and inside your code block. That makes you skip counting every other contact. 🙂 By the way, you could also just run se.countRows(), that will give you the correct amount of rows (just note that count won't be limited if you've limited the result with se.setLimit()).
by Espen Steen
27 Mar 2025 | 07:28 AM