Application Programming Interface forums

0 Subscribers

3 Topics

4882 Conversations

Area for questions and answers about SuperOffice API's.

push_pin lock

Some images can be loaded through customer.fcgi and some does not

Hi fellas, Im looking for help from you old-school onsite folks with an extremy odd issue. An onsite (belive me, we are pushing for them to migrate..) have the issue that neighter them, or their customer can see some images using customer.fcgi, but, using rms.fcgi as an logged in agent works fine. It also seems very random, in the same ticket, some images works, and some does not. For example the logo from the customer works in one message, the exact same logo doesn´t in the next. Fetching the base64 from Attachment works just fine and is the correct image, as well as renaming the file from /attachments Scenario:  An external ticket, the message is external. Running: http*://XXXXXX/service/scripts/ customer.fcgi /getAttachment/2133444-c9lqX8IQjZNj7p8J0EMhq2g4xdhK8R9opUiaH7L8Sp0GMOeGTPd9njEpWyBJhiJP-0/image002.jpg returns a 401 But, running http*://XXXXXX/service/scripts/ rms.fcgi /getAttachment/2133444-c9lqX8IQjZNj7p8J0EMhq2g4xdhK8R9opUiaH7L8Sp0GMOeGTPd9njEpWyBJhiJP-0/image002.jpg works just fine. SuperOffice: 10.2.5 Pretty standard setup, SSO, Sales in the same site, no split attachments, old customer from around ~v.6.x Clues: The customer told me that they also have noticed that an image can work just fine, but, after some mails back and forth to the customer, the previous image(s) starts behaving this way. Can be reproduced in test enviroment. Database entries: Attachment_path: C:\SuperOffice\Service\attachments cgi_bin: /Service/scripts cgi_url: https://....se cgi_url_internal: https://....se Path or URL to www folder: /Service/ Big bag of swedish candy for anyone that have an idea, im loosing my mind here :) Edit: tried turning of SSO, users are promted with login, but, still customer.fcgi does throw a 401 Regards Pär Pettersson
Pär Pettersson
1
1
22 Oct 2024 | 06:59 AM
Topic:
Service and CRMScript Discussion

Last reply

Hi, We have found the reason for this error.. Whenever the agent and customer sends emails back and forth, the ticket_attachment tables looks like this: What we found out, is, if we delete / or set the same content_id and inline_image as the first row to the following rows (needs to be added to all rows) it starts working. Anyone know how to fix this?
by Pär Pettersson
5 Nov 2024 | 01:49 PM
push_pin lock

Weird Timezone issue

Hi All, I am writing a script to create an appointment 15 mins from now when a SuperOffice form is processed.  However when I initialize a datetime variable it is setting it for 1 hour in the future.  I have written a test script below to show the issue. #setLanguageLevel 4; DateTime now; print (now.toString() + "<BR>"); TimeZone ltz = getLocalTimeZone(); print (ltz.getTimeZone() + "<BR>"); print (ltz.getTimeZoneSecs().toString()); If I run this script on my test on-premise environment, these are the results I get. If I run the same script on the customer's online environment, I get the following results. I originally thought it was because Timezones, were not enabled on the customer's environment, but I have enabled these, and the system default, and my personal default is  set to "United Kingdom", as it is in my test system, so I don't understand whilts I am getting different results.  It may be because my on premise server is hosted on a server configured for the UK, whereas the online environment would be, I assume, configured for Norway, and I guess British Summer Time is also causing part of the issue.  But how do I get the current datatime for the UK, that will work all year round, both in and out of BST. Many thanks, Trevor
Trevor Sharp
1
2
18 Oct 2024 | 11:17 AM
Topic:
Service and CRMScript Discussion

Last reply

Hi Michel, Thanks for this. I should be able to work around this, but it is good to understand how this is working. Trevor
by Trevor Sharp
28 Oct 2024 | 09:08 AM
push_pin lock

CRMscript: Ticket.sendMessages function - How to build a correct StringMatrix?

Hi! I am trying to send a mail from trigger and would like to use the built in function ticket.sendMessages The documentation in that function lacks a complete example I think?  I am struggling with creating a correct StringMatrix of the recipients. It would be nice with an complete example actually showing how to create a stringMatrix and other parameters and code for actually using the sendMessages function. Does anyone having an example I have tried this: == String strSendMatrix ="To | Anders Larsson <anders.larsson@amesto.se>"; StringMatrix SendMatrix; SendMatrix.addCell(strSendMatrix); String MessagesId = m.getValue("messageId"); Bool SendTicketStatus = t.sendMessages(t.getValue("ticketId"),SendMatrix,true,MessagesId,-1,"TestHeader"); == But geting : Index out of range exception //Anders
Anders Larsson
3
6
15 Oct 2024 | 08:10 AM
Topic:
Service and CRMScript Discussion

Last reply

Hi, Just a sidenote related to ticket.SendMessages, this actually was used in previous version of Forward messages in CS (still accessible from Batch operation), and one of the less optimal sideeffects was the lack of actually being able to visually see what was forwarded. So suggest using what Eivind points out with message.send() or using Email class.   
by Michel Krohn-Dale
22 Oct 2024 | 10:20 AM
push_pin lock

Strange behavior regarding saving documents

Hi, We have a major problem regarding saving documents for a company, its a bit of a "come and go" issue that has escalated for the last few days. The problem is that NSDocumentAgent saves the wrong document, and directly after its saved, it says that the document has been checked out by another user, (that does not have anything to do with the sale, or customer, or even country) We have the exact same code in multiple enviroments, but, its only happening for this customer. They are using Webtools, and SO for documents. The code NSListAgent listAgent; Byte[] TheFileInByte = decodeBase64(getCgiVariable("base64")); NSDocumentTemplate documentTemplate = listAgent.GetDocumentTemplate(346); NSContact contactEntity; contactEntity.SetContactId(MyContact.toInteger()); NSPerson personEntity; if(personId != "") personEntity.SetPersonId(personId.toInteger()); NSSale saleEntity; DateTime now; NSDocumentAgent documentAgent; NSDocumentEntity documentEntity = documentAgent.CreateDefaultDocumentEntity(); documentEntity.SetName(saleName + '.docx'); //documentEntity.SetHeader('Abax-OrderProposal-v' + NewVersion.toString()); documentEntity.SetHeader(saleName); documentEntity.SetContact(contactEntity); documentEntity.SetPerson(personEntity); documentEntity.SetSale(saleEntity); documentEntity.SetDate(now); documentEntity.SetDocumentTemplate(documentTemplate); NSAssociateAgent associateAgent; documentEntity.SetAssociate(associateAgent.GetAssociate(assId.toInteger())); NSDocumentEntity FUSO = documentAgent.SaveDocumentEntity(documentEntity); DocId = FUSO.GetDocumentId(); NSStream stream; stream.SetStream(TheFileInByte); documentAgent.SetDocumentStreamFromId(DocId, stream); It crashes with the following message: NetServerException: NetServer exception: Service call Document.SetDocumentStreamFromId failed Document ID 2487527, extref is locked and not checked out to current user Checked out by <another user> But, the document is created, and, the content in the file is something else, in this specific case, a quote from 34 days ago, for another customer, another sale and has nothing in common with the document created, or hasnt been opened or modified since it was created. And, we have verified that the base64 that comes in is in fact the document we wanted to save. Anyone have any experience or ideas regarding this? Regards Pär Pettersson
Pär Pettersson
4
4
15 Oct 2024 | 11:39 AM
Topic:
Service and CRMScript Discussion

Last reply

Margrethe is right, its been running fine for a few days now. And, it makes sense, since this customer pretty much always have the same heading in their sales, and therefore we havent noticed it at other customers. Thanks ALOT  
by Pär Pettersson
22 Oct 2024 | 08:25 AM
push_pin lock

update Contact name using Custom Contact Button

I have a Custom button linked to a CRMscript/Edit Contact that pops up up a dialog box to select a name based on whatever was first typed in the Name field, this works however then updating the contact name does not work. There is no Trigger that can be used for this scenario, please help       I have tried: ed.setOutputValue("ContactEntity.Name", "TEST"); getHtmlElement('Name').setValue("TEST"); ed.setNavigateTo("javascript:document.getElementById('Name').value = 'TEST';"); setVariable("url", "javascript:document.getElementById('Name').value = 'TEST';");  

DE

Dan Einarsson
4
4
16 Oct 2024 | 11:53 AM
Topic:
Service and CRMScript Discussion

Last reply

Hi Dan, The statement "There is no Trigger that can be used for this scenario" is not entirely accurate. Knowing what we know so far, I will agree with Kasper. Use before save and you will get the same results you want to achieve.  If we are missing some context as to why 'no trigger can be used...', please elaborate.  Best regards.
by Tony Yates
17 Oct 2024 | 10:24 AM
push_pin lock

Get functional rights via REST API?

Hey, I'm porting an app from the old SOAP API to use the new REST API. In the new REST API I can't seem to find a good way to figure out which Functional Rights the current user has without using the Dynamic provider to dig into the underlying table structure, like this. /api/v1/Archive/Dynamic?$filter=UserRoleLink.associate_id equals 1665&$select=UserRoleLink.role_id.(FunctionRightRoleLink->roleId).functionRightId.(FunctionRight->FunctionRight_id).name Is there a better way I'm not seeing?
Frode Lillerud
1
2
15 Oct 2024 | 02:24 PM
Topic:
Online development and web service API's

Last reply

Perfect! Thanks, David!
by Frode Lillerud
15 Oct 2024 | 02:55 PM
push_pin lock

Dependant dropdowns

Hello Team, I’ve noticed that, in SuperOffice, using the Screen Designer and Sale Types, we can control which fields users have access to based on the selected Sale Type. I’m wondering if it’s possible to apply similar logic at the dropdown level, to create relations between dropdowns.  For example, can the available options in one dropdown be filtered based on the selection made in another dropdown? If this functionality isn’t currently available, is it something that might be considered for future updates or is this on the roadmap?   Thank you!  

AB

Andrei Berianu
1
0
15 Oct 2024 | 08:19 AM
Topic:
Service and CRMScript Discussion
push_pin lock

Dependant dropdowns

Hello Team, I’ve noticed that, in SuperOffice, using the Screen Designer and Sale Types, we can control which fields users have access to based on the selected Sale Type. I’m wondering if it’s possible to apply similar logic at the dropdown level, to create relations between dropdowns.  For example, can the available options in one dropdown be filtered based on the selection made in another dropdown? If this functionality isn’t currently available, is it something that might be considered for future updates or is this on the roadmap?   Thank you!  

AB

Andrei Berianu
1
0
15 Oct 2024 | 08:19 AM
Topic:
Service and CRMScript Discussion
push_pin lock

Accept request button into viewticket edit entity menu

Hello Because of our customer service request amount, we have been inserted "Accept request" directly into ticket view. It saves a lot of time in total run. However, we inserted it as follow: Into default profile we inserted button Accept request. URL = https://ourcrmsystem/cs/scripts/ticket.fcgi?_sf=3&action=quickChangeTicket&accept=true&oldOwnedBy=1&ticketId= Target = _Top AppendID = 1 It works well when our customer service employee proceed of handling the ticket right away, but it does not work, if you would like at first to pick up more than one from the list. It simply opens this ticket and leaves selection view with preview in right side. What parameters we should use, if we would like the view to stay as it is, when we clicking on Accept request? Thanks Regards Ingar

IM

Ingar Mölder
1
0
15 Oct 2024 | 06:01 AM
Topic:
Service and CRMScript Discussion
push_pin lock

Last update - why did you block .js files from external documents?

We can understand exe, dll etc, but, can you please reconsider remove the restriction for .js since its used quite frequent when rebuild Customer Center and is a great helper not to clutter the html files. Regards Pär Pettersson
Pär Pettersson
5
3
14 Oct 2024 | 06:44 AM
Topic:
Service and CRMScript Discussion

Last reply

Hi,  As indicated by David it is supposed to listen to this preference, however we have found an issue that will be fixed in upcoming release (10.3.11). This file extension check to block unsafe filetypes has been implemented as a security improvement across application, if needed to bypass it it should be possible by defining your own list in preference.
by Michel Krohn-Dale
14 Oct 2024 | 08:25 AM