Application Programming Interface forums

0 Subscribers

3 Topics

4830 Conversations

Area for questions and answers about SuperOffice API's.

push_pin lock

Correct url parameters for opening appointments?

Hi, We have had numerous issues with openening existing/new entities within SuperOffice using SOProtocol in the latest releases, some have been fixed now (see bug  52109 , 53660, 54066 ), but since release 10.3.4 we had a customer experience another issue, opening a existing appointment or creating a new appointment using a SOProtocol url would always open the latest appointment. We open the existing appointment like this; /default.aspx?appointment.main?appointment_id=<appointment id> And create a new appointment like this: /default.aspx?appointment.main?appointment_id=0&contact_id=0&person_id=0&calendarassociate_id=<id>&doby=<start date>&endDate=<end date>   We changed this now, to make it work again: Existing appointment: /default.aspx? appointment[mainmode=edit]? appointment_id=<appointment id> New appointment: /default.aspx? appointment[mainmode=edit&new=true] ?appointment_id=0&contact_id=0&person_id=0&calendarassociate_id=<id>&doby=<start date>&endDate=<end date>   Question is, is this the correct syntax now? Or is this going to break again in the next release?
David Hollegien
2
4
22 Apr 2024 | 08:43 AM
Topic:
Online development and web service API's

Last reply

Hi Tony, Thanks for the info. Would this mean that the way we are doing it now would break in next release? (then I know how much time we have once they are upgraded to 10.3.5 😅)
by David Hollegien
10 h, 24 m ago | 11:53 AM
push_pin lock

Show script-based selection in CRM

Hi, Is it possible to show and edit a script-based selection in SuperOffice CRM?  (I would like to pass in a value as well for the selection so that it can update depending on the value. ) Regards Fredrik  

FL

Fredrik Larsson
2
1
22 Apr 2024 | 12:51 PM
Topic:
Service and CRMScript Discussion

Last reply

Hi Fredrik, No, Script based selections aren't available in the CRM client. 
by David Hollegien
22 Apr 2024 | 04:20 PM
push_pin lock

SSL peer certificate or SSH remote key was not OK

Hi dear Support, I  send in crm scripts Data to URL for our Web Apps, and got Error back: HTTPConnection::endRequest(): SSL peer certificate or SSH remote key was not OK. Therefore the Data in SO Cloud is not sent. I checked the URL has valid Certificate but with common Name: *.xxx.de The Web Apps of URL is hosted on our Webserver, According to our IT Support, it is about Wildcard Certificate with "*" in its name, so that its all Sub-Domain will be certifiable. however, it's a valid Certificates. How could I get around with this problem?   Thanks!
Jianchun You
3
5
22 Apr 2024 | 10:12 AM
Topic:
Service and CRMScript Discussion

Last reply

Thanks Alexander, it's removed.
by Jianchun You
22 Apr 2024 | 12:28 PM
push_pin lock

Setting Integer and Bool values in triggers

I'm making a new message trigger that should set an extra field on a ticket/request. for extra fields of type String this works as expected, but for Integer and Boolean I'm unable to set the value:   Integer ticketId = Integer(ed.getInputValue("outbox.ticketId"));   NSTicketAgent ticketAgent;   NSTicketEntity ticket = ticketAgent.GetTicketEntity(ticketId);   Map extras;   extras.insert("x_snorre", "string value inserted");    //works   extras.insert("x_snorre2", "34");       //don't work   extras.insert("x_snorre2", "[34]");     //don't work   extras.insert("x_snorre2", "[I:34]");   //don't work   ticket.SetExtraFields(extras);   ticketAgent.SaveTicketEntity(ticket);   Any suggestions?

SG

Snorre Garmann
2
2
22 Apr 2024 | 05:45 AM
Topic:
Service and CRMScript Discussion

Last reply

Hi Snorre, Extra Fields (for service entities) and User-Defined Fields (for Sales entities) are in transition to unifiy. If you use the CustomFields property instead, you should get better results. CustomFields is the new replacement that unifies them when applicable. Best regards. 
by Tony Yates
22 Apr 2024 | 07:18 AM
push_pin lock

Customer has unread messages

Hi I'm trying to figure out an efficient way to make a method that through the api return true/false if the customer has any new tickets or any unread messages to existing tickets. I see that there is a ReadByCustomer field on the Ticket entity, so I might be able to use this in some way.  Any suggestions as to how I should approach this?  

SG

Snorre Garmann
2
3
3 Apr 2024 | 06:14 AM
Topic:
Online development and web service API's

Last reply

I found a couple of ways, but none are very satisfying. There is a way to set the ReadByCustomer field through crm script, but then I would have to create a custom Rest api endpoint and connect the script to that. I am currently trying to set a boolean extra field on ticketentity in a crm script trigger to True whenever a message is added to a ticket. Then I can set the extra field to false when the ticket is displayed in my customer portal. I'm anxious to see how this performs when I create a request to check if the customer has any new messages or not.

SG

by Snorre Garmann
22 Apr 2024 | 05:51 AM
push_pin lock

Limit size of attachment (Customer Service)

Is it possible to limit size of attachments in Customer Service? Our customer's smtp-mailserver doesn't support sending files larger than 20MB so it would nice to show some error upfront.

MT

Mikko Tillikainen
3
1
18 Apr 2024 | 09:09 AM
Topic:
Service and CRMScript Discussion

Last reply

Hi Mikko, You could create a trigger outbox script to block outgoing messages with attachments larger then 20 MB, and add a message to the ticket that the attachment is too larger for example.
by David Hollegien
18 Apr 2024 | 12:28 PM
push_pin lock

Columns from extra tables in archive providers

I'm trying to fetch a list of contacts using the SuperOffice.WebApi C# library, and I want to include some attributes from an extra table y_whatever/x_name . The table has a key x_contact defined as a relation to the contact entity.  I tried var result = await agent.GetArchiveListByColumns2Async(                 "Contact",                 "contactUdef/My:SpecialID, name, registeredDate, contactExtra/y_whatever/x_name",                 "name",                 restrictions.ToString(),                 "contact",                 0,                 10             ); The result contains data for all but the last column. There is probably a way to retrieve extra data that I'm just too inexperienced to find.  Please help? Bonus question: While I have been testing fetching a simple text field from the extra table, the data I really want is defined in another extra table, call it y_codeTable .  The y_whatever table is defined with an "Extra table relation" field to this.  How can I follow that relation to find y_codeTable/x_description ?

PK

Peder Klingenberg
4
4
10 Apr 2024 | 08:40 AM
Topic:
Client libraries and tools

Last reply

Thank you. Lot's of useful information here. It turns out my first attempt had missed that I needed the x_contact_id as part of the path. After looking at the available columns, it was a trivial fix.

PK

by Peder Klingenberg
18 Apr 2024 | 10:21 AM
push_pin lock

The API returns an empty message body when the message is long

I convert images to base64. When someone posts a message with 2+ large images, the message displays correctly in SuperOffice. However, the REST API returns the message with no value for both ‘body’ and ‘htmlbody'. Is the character limit lower for loading messages with the REST API then the character limit for posting messages?

VS

Vidar Sollie
2
7
15 Apr 2024 | 11:39 AM
Topic:
Online development and web service API's

Last reply

Hi Vidar, I can't confirm is this issue is related to Bug ID: 34693 , but there was some issues with TicketMessage that was fixed in 10.1.8.  Best regards.
by Tony Yates
16 Apr 2024 | 08:39 AM
push_pin lock

Set userdefined delivery address from Quote by scripts

Is it possible to setup the values for the userdefined delivery address fields in the quote module by using scripts?  

FL

Fredrik Larsson
2
1
25 Mar 2024 | 05:04 PM
Topic:
Service and CRMScript Discussion

Last reply

Yes this is possible, but a bit awkward due to the handling of localized addresses and such, sample below (NOT production ready): #setLanguageLevel 4; Integer quoteId = 76; NSQuoteAgent quoteAgent; NSContactAgent contactAgent; NSQuoteEntity quoteEntity = quoteAgent.GetQuoteEntity(quoteId); NSQuoteVersion quoteVersion = quoteAgent.GetQuoteVersion(quoteEntity.GetActiveQuoteVersionId()); quoteVersion.SetHasOwnDeliveryAddress(true); quoteAgent.SaveQuoteVersion(quoteVersion); // complex type, see https://docs.superoffice.com/en/globalization-and-localization/address/index.html // and https://docs.superoffice.com/en/globalization-and-localization/address/howto/crmscript/set-address.html NSAddress[] quoteVersionAddressses = contactAgent.GetQuoteVersionAddresses(quoteVersion.GetQuoteVersionId()); NSAddress quoteDeliveryAddress; foreach (NSAddress address in quoteVersionAddressses) { // delivery if (address.GetStreet().GetAtypeIdx() == NSAddressType.QuoteShippingAddress) { NSStructuredAddress structuredDeliveryaddress = address.GetStreet(); structuredDeliveryaddress.SetAddress1("test delivery 1"); structuredDeliveryaddress.SetAddress2("test delivery 2"); structuredDeliveryaddress.SetAddress2("test delivery 3"); structuredDeliveryaddress.SetCity("delivery city"); structuredDeliveryaddress.SetZipcode("zip"); address.SetStreet(structuredDeliveryaddress); quoteDeliveryAddress = address; } } // list: general - country Integer countryId = 527; contactAgent.SaveQuoteVersionAddress(quoteVersion.GetQuoteVersionId(), quoteDeliveryAddress, NSAddressType.QuoteShippingAddress, countryId);
by David Hollegien
12 Apr 2024 | 02:37 PM
push_pin lock

How to work with NSSelectableMDOListItem and child items in CRMScript

Hi, I am unable to get a nested contact/company interest set to selected using CRMScript, a interest without a heading works correctly. How should this be done? Sample script to test: #setLanguageLevel 4; Integer contactId = 6827; NSContactAgent contactAgent; NSContactEntity contactEntity = contactAgent.GetContactEntity(contactId); NSSelectableMDOListItem[] contactInterests = contactEntity.GetInterests(); Integer interestToSelectId = 6; // enable for (Integer i = 0; i < contactInterests.length(); i++) { NSSelectableMDOListItem interest = contactInterests[i]; if (interest.GetId() == interestToSelectId) { interest.SetSelected(true); printLine("found main " + interest.GetName() + " => " + interest.GetId().toString()); } NSSelectableMDOListItem[] childItems = interest.GetChildItems(); for (Integer y = 0; y < childItems.length(); y++) { NSSelectableMDOListItem subInterest = childItems[y]; if (subInterest.GetId() == interestToSelectId) { subInterest.SetSelected(true); printLine("found an enabled sub " + subInterest.GetName() + " => " + subInterest.GetId().toString()); } } } // check what is enabled for (Integer i = 0; i < contactInterests.length(); i++) { NSSelectableMDOListItem interest = contactInterests[i]; if (interest.GetSelected() == true) { printLine(interest.GetName() + " => " + interest.GetId().toString() + " ENABLED"); } NSSelectableMDOListItem[] childItems = interest.GetChildItems(); for (Integer y = 0; y < childItems.length(); y++) { NSSelectableMDOListItem subInterest = childItems[y]; if (subInterest.GetSelected() == true) { printLine(subInterest.GetName() + " => " + subInterest.GetId().toString() + " ENABLED"); } } } contactEntity.SetInterests(contactInterests); contactEntity = contactAgent.SaveContactEntity(contactEntity);   Can be enabled/selected: Can't be enabled/selected: Tested on SOD SuperOffice CRM Online 10.3 Build main_10.3.5_2024.04.10-01
David Hollegien
2
2
10 Apr 2024 | 11:53 AM
Topic:
Service and CRMScript Discussion

Last reply

Thanks, that works!
by David Hollegien
12 Apr 2024 | 08:47 AM