Application Programming Interface forums

0 Prenumeranter

3 Ämnen

4884 Samtal

Area for questions and answers about SuperOffice API's.

push_pin lock

Stange value in udef fields in SOD online

When I get the udef fields for an appointment, a stange value is in the list: Map appUdefs = appEntity.GetUserDefinedFields();   The result in debug: GetUserDefinedFields(): "["SuperOffice:6=False","SuperOffice:6:Displa...=[SR_NO]"]" (Map)   And this makes it imposible to set the value, it is ignored if I try to set the value for "SuperOffice:6" to "1".   What is wrong here? Why is the SuperOffice:6 repeated and with the :Displa... after it?
Martin Andersen
4
2
14. nov. 2024 | 09:53 fm
Ämne:
Service and CRMScript Discussion

Senaste svar

Unfortunately the API's pollute some response data with properties containing a second colon in the name for the SuperOffice web client purposes only. These can be safely ignored. To set the custom object field, use the "SuperOffice:6" property only.   The following should be ignored: {PropertyName}:DisplayText {PropertyName}:DisplayTooltip Sorry for the inconvenience.   
by Tony Yates
15. nov. 2024 | 12:43 em
push_pin lock

SOProtocol - Create new Document with document.main[mode=new&edit=true] does not work

Hi. According to this post, the bug 63033 should be fixed:  https://community.superoffice.com/en/technical/forums/api-forums/online-web-services/opening-document-dialog-using-soprotocol-on-company-entity-level-broken-since-1038/ I still have problems with this in 10.3.11. A command below worked nice before - populating the dialogue with the correct company and template - allowing the user to fill inn information and create the document. Now the Company card changes to the specified contact_id, but the document-dialogue comes up with an existing document (the current I guess).  The link we are using is:  https://online3.superoffice.com/Cust0000/default.aspx?document.main[mode=new&edit=true]?document_id=0&contact_id=27130&person_id=32486&doctmpl_id=187 Is this another problem - or was it not solved. If there is required to change the URL - please advise me. 
Atle Bjerck
1
0
13. nov. 2024 | 09:17 fm
Ämne:
Online development and web service 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
2
22. okt. 2024 | 06:59 fm
Ämne:
Service and CRMScript Discussion

Senaste svar

If I'm not completly mistaken, at least in older releases of SO onsite, you had this admin-setting named something like "Exposed to internet" or something similar. I think i discussed this setting with Stian a long while ago, and that he mentioned that this setting also controlled if images would be embedded or linked in emails. Internal = embedded, Exposed = linked. But that may have changed and the above more seems lika a bug or something as some links works where other don't. But I quite often experience similar behaviours in Outlook, especially when it comes to images in the signature. Different clients offers and handles embedded images in different ways, and some of them block certain methods. I suppose that given a back and forth in a ticket, maybe using a combination of different mail clients, images might be disrupted over time. But spontainously, I would probably report this as a bug. Thought, cannot say for sure that it is. When it comes to Onsite-environments and later releases, especially if SSO is enabled. There is an additional impersonation configuration that you need to add to the web.config. If HTTPS and SSO is enabled, this settings is needed for the calls from NetServer to work as expected against the Service-module. As I understand it, when using certain Service-API-calls on NetServer, it will work as a API-proxy and then call the Service-module using these impersonation credentials. My best practices is also to use the same SymmetricKeys settings for all installed SO-components (NetServers, Service, etc). But I suppose that it is mainly important if the Service NetServer and Service uses the same encrypted keys. That might be things that is at least worth verifying as well. https://docs.superoffice.com/en/online/identity/single-sign-on/onsite-sso.html#superoffice-service /Marcus
by Marcus Svenningsson
12. nov. 2024 | 06:42 em
push_pin lock

Opening document dialog using soprotocol on company entity level broken since 10.3.8

Hi, We use the following soprotocol to open a newly created document from a task menu: soprotocol:document.details?document_id=<document id> Now that customers have been upgraded to 10.3.8, we gotten reports that the above soprotocol does not work anymore on company level. Exactly the same soprotocol does work on project level. (You can reproduce this by creating a button in the screen designer that executes above soprotocol on company level and project level) For both company and project level I did notice that the following console message is logged when executing the soprotocol: Are we using the wrong soprotocol here? (I also tried main instead of details, no change), or is this a bug that was introduced during the work for the SCILified document dialog?  
David Hollegien
3
6
4. sep. 2024 | 12:22 em
Ämne:
Online development and web service API's

Senaste svar

I have problems with this in 10.3.11. A command below worked nice before - populating the dialogue with the correct company and template - allowing the user to fill inn information and create the document. Now the Company card changes to the specified contact_id, but the document-dialogue comes up with an existing document (the current I guess).  The link we are using is:  https://online3.superoffice.com/Cust0000/default.aspx?document.main[mode=new&edit=true]?document_id=0&contact_id=27130&person_id=32486&doctmpl_id=187 Is this another problem - or was it not solved. If there is required to change the URL - please advise me. 
by Atle Bjerck
12. nov. 2024 | 10:46 fm
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. okt. 2024 | 11:17 fm
Ämne:
Service and CRMScript Discussion

Senaste svar

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. okt. 2024 | 09:08 fm
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. okt. 2024 | 08:10 fm
Ämne:
Service and CRMScript Discussion

Senaste svar

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. okt. 2024 | 10:20 fm
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. okt. 2024 | 11:39 fm
Ämne:
Service and CRMScript Discussion

Senaste svar

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. okt. 2024 | 08:25 fm
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. okt. 2024 | 11:53 fm
Ämne:
Service and CRMScript Discussion

Senaste svar

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. okt. 2024 | 10:24 fm
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. okt. 2024 | 02:24 em
Ämne:
Online development and web service API's

Senaste svar

Perfect! Thanks, David!
by Frode Lillerud
15. okt. 2024 | 02:55 em
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. okt. 2024 | 08:19 fm
Ämne:
Service and CRMScript Discussion