✨ Community just got smarter! Our all-new AI search is live! ask anything in the search bar, get instant answers.

Application Programming Interface forums

0 Prenumeranter

3 Ämnen

4998 Samtal

Area for questions and answers about SuperOffice API's.

All conversations (4998)

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
8 h, 36 m sedan | 10:13 fm
Ämne:
Service and CRMScript Discussion

Senaste svar

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
8 h, 22 m sedan | 10:27 fm
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 em
Ämne:
Service and CRMScript Discussion

Senaste svar

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
8 h, 22 m sedan | 10:27 fm
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
1
0
9 h, 6 m sedan | 09:43 fm
Ämne:
Online development and web service API's
done
Answered
push_pin lock

Handle extrafield of type datetime for tickets in new service via script and UI

Hi,  I have created a new datetime field on the request entity for a customer that uses new service, however I have noticed that the field seems to be using my local timezone to calcuate the current time instead of just displaying the value that´s being set like the field "Created_at" does. (In the UI (Find Request List)) This seems to only be in new service module (Old service displays the value without adding a offset) so should i always store the UTC value of the datetime (so it looks correct in the UI for the customer) and handle the timezone myself or should i store the actual value instead and have a mismatch in the UI? I need to use the field to do some simple calculations. Thanks in advance Regards Fredrik

FL

Fredrik Larsson
1
0
22. juni 2026 | 02:53 em
Ämne:
Service and CRMScript Discussion
done
Answered
push_pin lock

SOProtocol Refresh not refreshing archive grid on a sale

Hi, After creating a document via a CRM script, on a sale I am trying to refresh the Archive grid to show the newly created document, but I cannot seem to get it to refresh, meaning the user has to manually refresh the grid. I have tried: ev.setNavigateTo("soprotocol:main[refresh=true]");   Plus various varieties of this, flush/reload etc. but cannot get the Archive grid to refresh.  Is there a different soprotocol method I can use to refresh this.   Many thanks,   Trevor
Trevor Sharp
3
5
16. juni 2026 | 01:24 em
Ämne:
Service and CRMScript Discussion

Senaste svar

Thanks Tony/David for your clarifications on this, really helpful 🙂
by Trevor Sharp
18. juni 2026 | 12:46 em
done
Answered
push_pin lock

Equivalent to VB.Net's Chr() or C's (char)i in CRM Script

Hi, Is there an equivilent in CRMScript to VB's Chr() where you can obtain a character from its ASCII code.  I think the C equivelent is (char)i.  But I cannot see how to do this is CRM Script.  Bascially I need to change all instances of one character in a string into another character, but the original character is unprintable.  I wanted to use the Ascii code to get the find part of the substitution, and replace it with a printable character such as a ~. Many thanks, Trevor  
Trevor Sharp
2
2
22. maj 2026 | 09:29 fm
Ämne:
Service and CRMScript Discussion

Senaste svar

Hi Sverre, Thank you for this, looks promising.  I will give this a go 🙂. Trevor
by Trevor Sharp
26. maj 2026 | 08:37 fm
done
Answered
push_pin lock

Scheduled task started at wrong time

Hi, In our Service Module each Ticket we worked is also Billing to our Customer will be billed til end of the Month. We have scheduled Tasks in week Inteval and startet in all 7 days (that means daily Jobs), in Scripts it will be checked if current Date is End of the month, then run the logic to create a couple of Tickets for Partial invoicing to our Cutomer for the Tickets running over more Months, means, if the original Tickets till End of Month not be closed then transfer its Working time (UDF) as Billing amount to the new closed Tickets for the Partial invoicing and set it to zero in original Ticket where our User go on working till anytime it will be finally closed. To limit the runtime < 60 Sec., i have implemented the Scripts in 3 Scripts, in Logic I allocated to create new tickets for Partial invoicing by created date of the original tickets, then  start three jobs for each Scripts at  diff. Time 22:05/22:25/22:45 each with less Runtime, see below green marked Jobs. Here one Jobs in Details: The three Jobs works till now fine started correctly at diff. planed Time 22:05, 22:25, 22:45 for several Monthes, but on Apr. 30th all three jobs were started from 01:00, Date is correct, but started 21h earlier as planed, so our User missed during this day to check his Tickets which in the Evening will be partially invoiced. See here new Tickets automatically created from jobs at incorrect time. The Question is, how could we or SuperOffice make sure that all planed Jobs started at corrrect Time. We have asked our local SO Support Teams, but no Feedbacks. Thanks!  
Jianchun You
1
0
7. maj 2026 | 08:42 fm
Ämne:
Service and CRMScript Discussion
done
Answered
push_pin lock

message_header.type field

Hi, I am doing some scripting which queries the message_header table via a search engine, to basically check if a request has sent/recieved messages to/from specific email addresses. But there is a field in the message_header table called "Type". SuperOffice Docs (https://docs.superoffice.com/en/database/tables/message-header.html) details this field as below. type The type for this header entry. type ● But there is no explantion on what type options there are.  From what I have found looking at existing data, this appears to be either 1 or 2, but what is the difference, and is the type something I need to be considering, when querying this table via scripting. Many thanks, Trevor
Trevor Sharp
2
2
29. apr. 2026 | 04:20 em
Ämne:
Service and CRMScript Discussion

Senaste svar

Hi Sverre, Indeed, it has been a long time, I hope you are doing well.  Thanks for clarifiying this, this kind of makes sense now, every email I send via a CRM Script sets the value to 2, whereas general replies to requests are all set to 1. Thanks again, Trevor
by Trevor Sharp
30. apr. 2026 | 08:25 fm
done
Answered
push_pin lock

Using VBA in Super Office and access to internal database?

Hi all, Is it possible to use VBA in Super Office to query our own database to retrieve data? Does Super Office allow access to that?   Thank you.   Regards

CB

Christian Behrendt
2
1
1. apr. 2026 | 11:30 fm
Ämne:
Application Programming Interface forums

Senaste svar

Hi Tony. Thanks for your reply. We use the online version of Super Office. We use message templates for newsletters and want to automate more the work, hence, using our internal database to retrieve the text and have them populated automatically in the template in Super Office. Would that be possible? Regards Christian

CB

by Christian Behrendt
2. apr. 2026 | 09:14 fm
done
Answered
push_pin lock

Basic scripts dont seem to run as a button, trigger or task item for onsite 10.5.4 but fire in the edit script area - getEventData does not seem to work with OnSite at all

Hi All, I need to create a script for an onsite client as part of a move to online, my recently learnt basic scripting seems to be going no where. I'm using the same script logic that works on all the online tenents but nothing not even a company.load seems to work onprem.  Can anyone see what I'm missing from the below ? Does anyone else find that getEventData brings back nothing for OnPrem CRM ? I get "something went wrong" on more than one Onprem site even with a basic company.load. I cant seem to get anywhere - thanks for your help :-)  
Dave Walsh
2
2
31. mars 2026 | 09:52 fm
Ämne:
Service and CRMScript Discussion

Senaste svar

Perfect! Happy that it helped :-) It is a bit strange, and not always easy to find out. Some scripts work but not others. Kudos also goes to @David Hollegien, that helped me with this type of strange error some year ago. (that time it was the REST API.s not working correct if the Symetric Keys/secrets did not match)
by Anders Larsson
31. mars 2026 | 12:04 em