Application Programming Interface forums

0 Abonnenten

3 Themen

5005 Gespräche

Area for questions and answers about SuperOffice API's.

done
Answered
push_pin lock

Incoming or outgoing ?

Hi, how can I detect  if an email is outgoing or incoming ?   Rest-API, mirror database query, whatevet method is fine.  

IT

Inge Simon Thorbjørnsen
1
0
11 h, 56 m vor | 02:14 PM
Thema:
Client libraries and tools
done
Answered
push_pin lock

Number and Date Formatting not working when using "NSQuoteAgent.GetOrderConfirmation"

Hi, You may have seen from a previous post (where I raised a question on document filename formats), that I have written a script that uses the "NSQuoteAgent.GetOrderConfirmation" function, to allow one of our customers to produce multple order documents against the same quote, but using different document templates for each document. Our customer needs multiple templates against the quote, for things such as Works Order Sheet, Picking Form etc., and the "GetOrderConfirmation" function works really well, as it allows you to save in SuperOffice multiple "Order Confirmation" documents, using different "Order Confirmation" templates against the same quote.  Below is a screenshot of the script, that runs from the Sale Task menu. The trouble is, that it does not seem to respect the user's Number and Date format when producing the document. Below is a screenshot of part of an order confirmation document produced when raising the document in the normal manner (at the point of placing the order, which can only be done against one of the document templates for any given quote).  The date correctly shows in the UK date format, as per the customer's number and date format. When I produce the same document via a CRM Script, using the following code. NSQuoteAgent quoteAgent; String quoteDoc = quoteAgent.GetOrderConfirmation(quoteVersionId, confirmationTemplateId); This is the document it produces, with the user's number and date format being ignored. As the script runs from the Sale Task menu, I expected the script to run in the context of the user, and therefore use the user's number and date format settings, but this seems not to be the case. Am I missing something in my code, or is this a bug with the function in SuperOffice? Many thanks, Trevor
Trevor Sharp
2
2
17 h, 16 m vor | 08:54 AM
Thema:
Service and CRMScript Discussion

Letzte Antworten

Hi David, Thank you for this, this is really helpful. I will give this a go tomorrow. Thanks again for your help, really appreciated. Trevor
by Trevor Sharp
15 h, 57 m vor | 10:14 AM
done
Answered
push_pin lock

How do I all tickets via Archive agent?

I try to get tickets, using this NSArchiveAgent agent; NSArchiveListItem[] result = agent.GetArchiveListByColumns2 ("FindTicket", "ticketId,title,status,person/personId", "", "ticketId>'0'", "ticket", 0, 200); printLine ("Row count: " + result.length().toString()); foreach (NSArchiveListItem i in result) { Map col = i.GetColumnData(); col.first(); while (!col.eof()) { print(col.getKey() + ": " + col.getVal() +" - "); col.next(); } }   But it only seem to return open tickets. Why is that - what am I missing?  
Morten Larsen
1
2
13. Juli 2026 | 10:57 AM
Thema:
Service and CRMScript Discussion

Letzte Antworten

wow easy! Thanks
by Morten Larsen
13. Juli 2026 | 11:09 AM
done
Answered
push_pin lock

Pretty format json?

Is it possible to pretty format a json string: Map m = Map (data); printLine(m.toJson()); Outputs: { "First": "Martin", "Last": "Andersen"} I would like to have it like this: {   "First": "Martin",   "Last": "Andersen" }   Regards Martin
Martin Andersen
2
2
10. Juli 2026 | 10:54 AM
Thema:
Service and CRMScript Discussion

Letzte Antworten

OK, that is good! Thank you!
by Martin Andersen
10. Juli 2026 | 11:08 AM
done
Answered
push_pin lock

Send email from a CRMScript

Simply put, I want to send an email when certain criteria are meet, but I can't find any documentation about the subject. I found a forum post with the class name NSEmailAgent, but it does not exist? Maybe it used to exist? It should of cause be from within SuperOffice, and be shown in the archives, and not some mail-chimp Rest call. Regards Martin
Martin Andersen
2
2
9. Juli 2026 | 10:19 AM
Thema:
Service and CRMScript Discussion

Letzte Antworten

Thank you.
by Martin Andersen
9. Juli 2026 | 10:32 AM
done
Answered
push_pin lock

NTLM as authenticationMethod removed?

Hi, we have an Online customer who has been using CRMScript to get data from a webservice which is protected by NTLM auth. Somewhere around the time they were upgraded to version 12 all calls from CRMScript using NTLM started to fail. It seems to use basic auth even though authenticationMethod is set to ntlm. Example code: HTTP http; http.setOption("authenticationMethod", "ntlm"); http.setOption("username", "foo"); http.setOption("password", "bar"); http.get("https://testing.requestcatcher.com"); On an older onprem solution I see that setting http.setOption("authenticationMethod", "ntlm") causes the Authorization header to be "Authorization: NTLM ****", but in Online v12 the Authorization header is set to "Authorization: Basic *****". Has NTLM support been removed from version 12? It is still mentioned in the documentation: https://docs.superoffice.com/en/automation/crmscript/reference/CRMScript.Native.HTTP.html
Frode Lillerud
3
3
2. Juli 2026 | 06:56 AM
Thema:
Service and CRMScript Discussion

Letzte Antworten

Hello,  We have located the issue and it will be hotfixed in our upcoming release.  Thank you for bringing it to our attention! :)  //Eivind
by Eivind Fasting
8. Juli 2026 | 12:12 PM
done
Answered
push_pin lock

Calling CRMscript as webservice from the outside world (Umbraco) but with data in the body as json

I saw this https://community.superoffice.com/en/technical/blogs/archive/building-custom-rest-api-methods-using-crmscript/?epslanguage=en And it works out of the box you could say. But I need a big chunk of data in the body of the request, can I do that?
Martin Andersen
2
1
1. Juli 2026 | 12:12 PM
Thema:
Service and CRMScript Discussion

Letzte Antworten

That was fast, I could not even eat a ice before you answered. Thank you.
by Martin Andersen
1. Juli 2026 | 12:25 PM
done
Answered
push_pin lock

ERP Sync list mappings: should SuperOffice send the mapped ERP list value to the connector?

Hi there - i need clarification on ERP Sync list mappings, specifically for list fields such as Country. I made a custom Business Central ERP connector exposing country list items from BC through WSGetList. Example ERP country   codes include:   - UK = United Kingdom   - NL = Netherlands   - CZ = Czechia   In SuperOffice ERP admin, we map the ERP list item UK to the SuperOffice country item “Storbritannien” / Great   Britain.   Our expectation was that when SuperOffice later calls the ERP connector, it would send the mapped ERP list key, i.e.   UK.   However, in our connector logs we see SuperOffice sending SuperOffice/internal country values instead:   During advanced search:   {     "FieldKey": "COUNTRY",     "Operator": "oneof",     "ScalarValue": "GB",     "Values": ["GB"]   }   During create actor:   {     "a:Key": "COUNTRY",     "a:Value": "GBR"   }   Business Central rejects this because GBR does not exist in the BC Country/Region table. The valid ERP value is UK.   So the question is:   When a list field is mapped in ERP Sync admin, should SuperOffice apply that mapping before calling connector methods   like WSCreateActor, WSSaveActors, and WSSearchActorsAdvanced?   Or are list mappings only used when importing/displaying ERP values in SuperOffice, meaning the connector must itself   translate SuperOffice values like GB/GBR back to ERP keys like UK (for example by receiving the mapping from netserver)?   Related questions:   1. Does the ERP connector SOAP contract ever receive the saved list mappings?   2. Is IErpSyncAgent.GetConnectionListMappings the right function to call IF i have to go and fetch the mapping manually, which honestly feels really stupid?   3. For CRM -> ERP flows, is the connector expected to receive CRM list values or ERP list values?   4. Is search different from save/create in this regard?   I have added connector-side aliases as a workaround, but I need to understand the intended contract. If the ERP admin   maps ERP UK to SuperOffice “Great Britain”, it seems logical that CRM -> ERP calls should send UK, not GB or GBR.   Can anyone confirm the expected behavior, before i end up ripping all my hair out? :)
Dennis Aagaard Mortensgaard
2
2
25. Juni 2026 | 09:43 AM
Thema:
Online development and web service API's

Letzte Antworten

Hi Dennis,  I think SuperOffice is supposed to translate list values to ERP keys before calling WSCreateActor, WSSaveActors and WSSearchActorsAdvanced. That said it looks like WSSearchActorsAdvanced do not follow the same translation layer so we would have to investigate/debug this to figure out if its a bug or by design. It would be interesting to see what is stored in the `ERPLISTITEMEMAPPING` in your database and verify the CrmItemKey value match the actuall integer IDs from the SuperOffice country table. If that row is missing or has a wrong ErpFieldId the code falls back to the raw internal value which could be GBR in your case (?) Do you have access to the database directly?  I suggest you send send an email to appdev@superoffice.com so we can investigate //Eivind
by Eivind Fasting
30. Juni 2026 | 08:02 AM
done
Answered
push_pin lock

What does the "Enable batch webhook in Service" option do in a custom object

Hi, I have added a custom object, and I wanted web hooks to fire on this custom object when a record is edited, even if records are updated using the SuperOffice Bulk Update routine.  I assumed that I would need the "Enable batch webhook in Service" option ticked to allow this, but it seems that my web hook runs when using SuperOffice Bulk Update to update these records, without this option being ticked. With this in mind, what does ticking this option actually do? Many thanks, Trevor
Trevor Sharp
2
2
25. Juni 2026 | 10:13 AM
Thema:
Service and CRMScript Discussion

Letzte Antworten

Hi David, That is perfect, thank you for clarifying this, I probably will not need to enable this for this site (as I don't want to create any unnecessary performance hits), and this customer does not have access to the old service module, and we are not updating the records via a CRMScript. Thanks again for your help on this. Trevor
by Trevor Sharp
25. Juni 2026 | 10:27 AM
done
Answered
push_pin lock

Having a unique filename generated, when creating a document via a CRM script

Hi, I have created a script that generates a quote order confirmation from a sale with a quote.  The customer needs to produce a number of different documents from the quote lines when the quote is sold, but out of the box, only one order confirmation document can be created at the point the Place Order button is pressed (by selecting the "Send order confirmation via e-mail" option). I have created other order confirmation documents in SuperOffice for things such as Works Orders, and then use "quoteAgent.GetOrderConfirmation(quoteVersionId, confirmationTemplateId)" to get a Base64 string of the document, and create a document in SuperOffice based on this Base64 string. It all works well, the script runs on the Task Menu and shows a form with a list of all available Order Confirmation templates, and then creates a document based on the selected template. The one issue though is that SuperOffice does not seem to create a unique filename for each of the documents generated via the CRM script, so if the same document template is generated twice for the same quote (filename is based on the template type and quote number), they both get the same filename, and both documents in SuperOffice are linked to the same physical file.  This also means that when one of these documents is deleted in SuperOffice, you get an error opening the other document, as the physical file linked to this document is now deleted. I have worked around the issue by adding a datetime stamp at the end of each filename, so that it is always unique, but this is not ideal, as when the user uses the "Send as email" option for this document, the file is attached using the messy filename (instead of the better solution which the legacy Outlook Mail Link does, of generating a new clean filename based on the document subject). If you use the doc.SetName or doc.SetHeader, some tidying of the filename is performed, I.E. if I set the filename to "Works Order Sheet - Quote 10084 v2.pdf", it will set the filename to "works-order-sheet-quote-10084-v2.pdf", but you would think that if this filename was already in use in that SO_Arc folder, that it would rename it to something like "works-order-sheet-quote-10084-v2[2].pdf". I have looked to build a search engine to see if the filename is already in use and then increment a number at the end of the filename, but only if the original filename has been used before.  However the text stored in the name field is sometimes with spaces, sometime with dashes, but either way the actual filename created is always with the dashes, so this is inconsistent. Is there any simple way with the Document Agent, to specify a desired filename for a document, and have SuperOffice automatically adjust this, to keep the basic format of your filename, but ensure the filename of the file created in unique to that SO_Arc folder. Many thanks, Trevor
Trevor Sharp
2
3
16. Juni 2026 | 02:29 PM
Thema:
Service and CRMScript Discussion

Letzte Antworten

The SetName on the document entity does not actually do any logic related to the file name,. the SetDocumentStreamFromId call should, when the content is uploaded, validate if the name set is unique, and possibly modify it if not.    
by David Hollegien
25. Juni 2026 | 10:27 AM