Application Programming Interface forums

0 Subscribers

3 Topics

4826 Conversations

Area for questions and answers about SuperOffice API's.

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

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
2
3 Apr 2024 | 06:14 AM
Topic:
Online development and web service API's

Last reply

Did you find a way? I gave up and created a database table to keep track of when users last read a message.

VS

by Vidar Sollie
15 Apr 2024 | 12:00 PM
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
push_pin lock

Bug in trigger script for projectmember before and after save ?

It looks like it only triggers when you try to register new project members.  If I try to update an exisiting member it will not trigger. I've tried this in V10.3.3 online and in V10.3.4 SOD. Can be tested by writing ed.getInputValues() to log.

UT

Ummair Tahir
2
1
11 Apr 2024 | 10:31 AM
Topic:
Service and CRMScript Discussion

Last reply

This is a known bug, see: https://community.superoffice.com/en/product-releases/bugs-wishes/product-issue/?bid=49119&azure=1
by David Hollegien
11 Apr 2024 | 10:38 AM
push_pin lock

The Cirrus-project

Hello,  During expander world there was a demo of the Cirrus-project.  I was wondering if this is still 'alive', and if it will be developed/updated frequently? I see the project is 'alive' but nothing has really happened in the last 5-6 months:  https://github.com/SuperOffice/vscode-crmscript   Having an external editor for CRMscripts is really neat! Is there any plans/ideas regarding doing something ground-breaking for Custom Screens as well?  I know this is probably a lot harder but maybe there is some things in development/pipeline that could be nice to know about (?) //Eivind
Eivind Johan Fasting
4
4
13 May 2019 | 12:00 AM
Topic:
Service and CRMScript Discussion

Last reply

Hi Dan, took a quick look on your partner in our developer portal and found the error which indicates that you're using a redirect URL that is not on the app configurations allowed list: Message: Application was denied: invalid redirect url http://localhost:4300/callback
by Margrethe Romnes
10 Apr 2024 | 01:09 PM
push_pin lock

New service GUI and relational fields

Hello In the old service we were able to manipulate what could and would be shown in the ticket fields i.e edit ticket screen.  Lets say we have a field on ticket from an entity (sale/project/appointment or another table) and in the dropdown/search field I only want to list only those projects that have status != closed and are connected through erp.   What approach does our fellow community developers have to solve issues like this ?

UT

Ummair Tahir
2
2
9 Apr 2024 | 02:57 PM
Topic:
Service and CRMScript Discussion

Last reply

Thank you for replying @David. Do you know if there has been registered a wish for this kind of functionality to work ?

UT

by Ummair Tahir
9 Apr 2024 | 03:09 PM
push_pin lock

HTTP class getDebug method can be empty after a NetServer exception occurs

Hi, I noticed some weird behavior in one of our CRMScripts in SOD, and think I've pinpointed the issue, althoug I don't understand quite why it happens. The problem is that when we have an instance of the HTTP class, then call save on an ExtraTable object, then the HTTP object gets messed up. Here is a proof of concept script. #setLanguageLevel 4; HTTP http; http.setDebugMode(true); String response = String(http.post("https://whatever.requestcatcher.com")); printLine(http.getDebug().getLength().toString()); printLine(http.getDebug().getLength().toString()); ExtraTable row = getExtraTable("y_temp"); row.save(); // This causes HTTP to reset printLine(http.getDebug().getLength().toString()); printLine(http.getDebug().getLength().toString()); When running this you'll see that the getDebug() method returns strings before saving the ExtraTable row, but has lost its info afterwards. 3861 3861 0 0 It doesn't behave like this in production, only in SOD. Issue seems to have come in the last month. I'm running "SuperOffice CRM Online 10.3 Build Release_10.3.4_2024.04.08-01" in SOD.
Frode Lillerud
2
3
9 Apr 2024 | 08:36 AM
Topic:
Service and CRMScript Discussion

Last reply

Thanks for troubleshooting Stian! So in essence the .getDebug() method is only reliable immediately after making the HTTP call. HTTP http; http.setDebugMode(true); String response = String(http.get(URL)); String debug = http.getDebug(); // Grab the string as soon as possible. /* * Doing anything here which might cause a NetServer exception can lead to getDebug() being cleared. * Because Service will internally use the HTTP class to report error to Application Insights, which will reuse the static variable used for holding debuginfo. */ String nogo = http.getDebug(); // This will be blank if a NetServer exception occured internally above here. Great work, now we know and can work around the issue.
by Frode Lillerud
9 Apr 2024 | 12:26 PM