Application Programming Interface forums

0 Abonnenter

3 Emner

4891 Samtaler

Area for questions and answers about SuperOffice API's.

push_pin lock

open URL as Popup in addcell?

Hi,   to "addcell" in table.setFieldValue in Custom Screen, how could i insert "url" in Map() with <script>, so that User open the URL in a Popup instead of in a new Page? Map map;              map.insert("label", <my Label>);  map.insert("url", "https://...");  // popup? table.setFieldValue("addCell", map);   Thanks!
Jianchun You
2
2
29. nov. 2024 | 12:09 a.m.
Emne:
Service and CRMScript Discussion

Siste svar

HI Espen, sorry for my delay. I have custom Screem to list my spcial Documents in a Static table v2. Yes, you are right, in the crm scripts to this Table there is no possible to write JavaScripts for Popup my URL. I have also created Button, in the Scripts for this Button I have no iea to get Popup.  Maybe do you have example in which HTML-Element I can write Java Scripts to get Popup like this: myPopup=window.open([url to my Popup],'','height=200,width=300'); setTimeout(Function(){myPopup.close();}, 1000); The URL goes to my next Screen in Popup to run Logic for download selected Document like this:         NSDocumentAgent documentAgent;         NSDocumentEntity documentEntity = documentAgent.GetDocumentEntity(docId.toInteger());          NSStream documentStream = documentAgent.GetDocumentStreamFromEntity(documentEntity);         print("Content-Type: application/octet-stream; name=" + documentEntity.GetName() + "\n");         print("Content-Disposition: attachment; filename=" + documentEntity.GetName() + "\n");         print("Expires: Tue, 01 Jan 2030 12:00:00 GMT\n\n");         Byte[] docBytes = documentStream.GetStream();         print("Content-Length: " + docBytes.length().toString() + "\n\n");         printBinary(documentStream.GetStream()); Thanks a lot!  
by Jianchun You
4. des. 2024 | 02:51 p.m.
push_pin lock

Relation direction isn't consistent when calling API

Sometimes (approx 25%-10%), when calling the "/api/v1/Relation" endpoint, the direction of the given relations will be switched - i.e. the source and target attributes have switched. As relations in Superoffice are directional, it is rather essential that this doesn't happen. Does anyone know if there is any way to get a result consistent with the underlying data?

BM

Bertram Madsen
1
0
4. des. 2024 | 11:18 a.m.
Emne:
Online development and web service API's
push_pin lock

Determine if a FAQ has a link or an attachment attached in the customer centre

Is it possible to determine in the customer centre files if a FAQ has a link or an attachment attached to it? I wanna do different things depending on if it´s a link or if it´s an attachment.

FL

Fredrik Larsson
1
0
3. des. 2024 | 01:10 p.m.
Emne:
Service and CRMScript Discussion
push_pin lock

FAQ with attachment can´t be accessed in customer centre

When i try to access FAQs with an attachment attached in the customer centre, does the login screen prompt up and when i login, i´m greeted with an "You can´t access this page" message. Does that mean that i don´t have access to the file?  (It´s been uploaded via the upload link in the FAQ) I could download the file if i pressed the "View in Customer centre" button but not when i´m trying to access it from the customer centre. Do you need specific settings for the FAQ in order for it to be available for the customer centre?

FL

Fredrik Larsson
2
5
25. nov. 2024 | 09:07 p.m.
Emne:
Service and CRMScript Discussion

Siste svar

For those who stumble upon this question later,  the answer to it was that the folder settings were set to private which explains why i couldn´t access the files from the customer centre.

FL

by Fredrik Larsson
3. des. 2024 | 01:04 p.m.
push_pin lock

CRMscript: Prevent delete of contact person - no BeforePersonDelete exist

Hello, I need a small script (trigger script) that checks if a user tries to delete a contact person who is linked to an extra table. If there is a link, the delete should be blocked, and a message should be displayed. Unfortunately, it seems that such a "trigger event" still does not exist, and the delete action does not generate a "before person save event" nor a “after save person event”. Patrik had a similar question several years ago in this thread https://community.superoffice.com/en/technical/forums/product-forums/crm-web-application/crmscript-trigger-for-delete/ The problem seems to be that when you press the delete button and then accept, it is not done via the event system but in some other way? (eg setting deleted date) I think at least an after save event should be triggered by delete commands in SuperOffice GUI Then we at least could reverse the delete if meet a certain criteria Are there any plans of adding these kind of trigger events? The whole situation arise because there will be orphans in the extra table. There should be setting I admin for each extra table stating: Remove Orphan records : true/false (eg if linked Id , in my case personId) does not exist. It should then be cleaned up by the nightly maintenance jobs.  //Anders
Anders Larsson
2
3
29. nov. 2024 | 09:38 a.m.
Emne:
Service and CRMScript Discussion

Siste svar

Hum, seems like my last replay got truncated...or at least not visible in MS Edge? Why is it so when you replay on a thread?  No I do not exaclty know what I wrote. But I think it was something like this: (ah I think i no why message was truncated. I did us greater than samaller then signs i tex...bad...?) I think that each entity could benefit from having BeforeEntityDelete and AfterEntityDelete like Before Person Delete. Yes the persons and companies end up in the paperbin. And a sort of cleanup/restore from that state could be done. (that was my initial thought but I wanted to have a script blocking contacts with link/entry in an extra table to be deleted).  Yes webhooks could be used I think but no integration back to gui then I think. A colleague of mine also said that a custom sentry should work to block delete of person that has reference into the extra-table. What does RND say about more triggers like BeforeDeletePerson, AfterDeletePerson or  even BeforeSoftDeletePerson, AfterSoftDeletePerson ? What does RND say about my sugestion to offer auto cleanup of orphan records in extra tables? //Anders
by Anders Larsson
29. nov. 2024 | 01:22 p.m.
push_pin lock

New CRMScript editor (again): Monaco

Hi all, We have been testing whether it is possible to replace Codemirror as our CRMScript editor with Monaco (the basis of VSCode). We have currently implemented this as a testable feature in our latest build, hoping that some of you will try it out and tell us what is not working :-) You can enable Monaco as your CRMScript editor by using the "rms.fcgi?action=debug" panel and tick the Monaco-checkbox. The setting is stored as a cookie in your browser and will only affect you in that particular browser, other users will not be affected. This setting is available in build "main_10.3.7_2024.05.23-01". Sverre
Sverre Hjelm
13
45
23. mai 2024 | 08:04 a.m.
Emne:
Service and CRMScript Discussion

Siste svar

Any news on the fullscreen mode @Michael or Eivind ?
by Ummair Tahir
26. nov. 2024 | 03:55 p.m.
push_pin lock

SQL command: get attachment info for a ticket SuperOffice 10.x

In the database documentation there is a relation described: ticket - ej_message - ticket_attachment - attachment  Problem: I have a lot of tickets and attachments, but table ej_message is empty. But in the CS interface all data is shown the right way. I tried to join like below, but that seems to be the wrong relation. What is the right way? select  .... from crm7.ticket t1 left join crm7.TICKET_ATTACHMENT ta1 on t1.id = ta1.message_id left join crm7.ATTACHMENT at1 on ta1.attachment_id = at1.id   Thanks for some info

CK

Christian Kogel
1
2
22. nov. 2024 | 02:21 p.m.
Emne:
Online development and web service API's

Siste svar

Thanks, I looked to a wrong database where ej_message was empty. My mistake.

CK

by Christian Kogel
25. nov. 2024 | 08:37 a.m.
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
2
2
13. nov. 2024 | 09:17 a.m.
Emne:
Online development and web service API's

Siste svar

Hi Atle, Glad to know you got the soprotocol working in the end. The documentation has always listed the parameters in the correct way, so I'm not sure where the misinformation came from. If you ever run across the source for that, please let us know so that we can correct it there as well. Yes, pagebuilder was very forgiving. Best regards.  
by Tony Yates
19. nov. 2024 | 10:11 a.m.
push_pin lock

Sth. keep still running after File downloaded

Hi,   I have create a HtmlElement table in Custom Screen linked to Sale Section Tab to list some special Documents of current Sale. It works fine. User select one Document and click Button to download this file in background. The Implementation to this Button for Download works also. The Problem is, after File downloaded it's  still running sth. in Background so that the Page keeps still endless inactive. Does someone has same Experience what's runnning here and How I can fix?   Many Thanks!
Jianchun You
1
0
18. nov. 2024 | 09:17 a.m.
Emne:
Service and CRMScript Discussion
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 a.m.
Emne:
Service and CRMScript Discussion

Siste 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 p.m.