Application Programming Interface forums

0 Abonnenter

3 Emner

4871 Samtaler

Area for questions and answers about SuperOffice API's.

push_pin lock

Get content from conceptual tables from mirrored DB

Hello, I would like to look up which progid a specific user-defined field has. For instance when I look at userdefined fields connected with the Project entity in the dbo.udprojectsmall table in our mirrored DB, I would like to know which specific field in the user interface that the field 'string03' corresponds to. I am halfway there when combining info from the table above with dbo.project and dbo.udeffield however, I seem to be missing a link between dbo.udprojectsmall and dbo.udeffield and my understanding is that I need to look something up in either conceptualtable or conceptualfield ( https://docs.superoffice.com/en/database/getting-started/special-tables.html ) which unfortunately are not included in the mirrored db. Does anyone know if: I can access the information (the link between the tables) in another way I can query those two conceptual tables via api     I hope someone can help :-) Best Regards, Henrik
Henrik Povlsen
2
1
4. okt. 2024 | 02:03 p.m.
Emne:
Online development and web service API's

Siste svar

Conceptualtable and concepttual field are obsolete tables from the previous database dictionary model (pre-cdd).   If you want to map the udeffield to the database column name, you need to use the columnId field. You can find some info about it here: https://docs.superoffice.com/en/api/netserver/entities/howto/custom-objects/get-udef-field-value.html#field-offset See also this thread: https://community.superoffice.com/en/technical/forums/api-forums/client-libraries-and-tools/superoffice-udef---columnid/
by David Hollegien
4. okt. 2024 | 05:20 p.m.
push_pin lock

encodeSHA256 gives wrong hash?

Hi, I'm implementing support for HTTP Message Signatures (https://www.rfc-editor.org/rfc/rfc9421.html), and it requires SHA256 hashing. Up until now I've lived in a happy little bubble where I've assumed that encodeSHA256 produces the correct hash, but now I realize it doesn't. The SHA256 hash of 'foobar' should be 'c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2'. Here are a few ways to verify it:  https://gchq.github.io/CyberChef/#recipe=SHA2('256',64,160)&input=Zm9vYmFy Linux:   echo -n foobar | sha256sum Windows:  echo|set /p="foobar" > %TMP%/hash.txt |certutil -hashfile %TMP%/hash.txt SHA256 | findstr /v "hash" However, using the encodeSHA256 method in CRMScript I get a totally different hash. String NULL; printLine(encodeSHA256("", "foobar")); printLine(encodeSHA256(NULL, "foobar")); Byte[] bytes = encodeHMACSHA256("", "foobar"); foreach (Byte b in bytes) print(b.toHex(2)); // All of these give hash 'd7af9ac43019eb74b1787bc22cc8e81791045f48a94b334dab1a54213c4fc609', not the expected 'c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2' Do we know why?
Frode Lillerud
0
0
3. okt. 2024 | 07:37 a.m.
Emne:
Service and CRMScript Discussion
push_pin lock

Remove company when saving a person

I have a customer where persones in SuperOffice 9 out of 10 times is not connected to a company.  Hence the customer want company to be automatically removed when creating a person. I expected to be able to use a "Before saving contact" trigger, and set PersonEntity.Contact.ContactId = 0 But person is still added to a company (active company). This is the unsuccesfull code: #setLanguageLevel 4; EventData ed = getEventData(); // remove company on person ed.setOutputValue("PersonEntity.Contact.ContactId","0"); // <== does not work :(   I have also tried these properties: ed.setOutputValue("ActiveContactId","0"); ed.setOutputValue("ContactId","0");   Does anyone have an idea how to remove company on person when a person is created?
Morten Larsen
0
1
1. okt. 2024 | 03:08 p.m.
Emne:
Service and CRMScript Discussion

Siste svar

Hello Morten,  I will have to look into this, but it should in theory be possible to do what you are doing.. A workaround, while you wait for me to get back to you, would be to use the AfterSaveContact instead, and load/edit the personEntity there: #setLanguageLevel 4; EventData ed = getEventData(); if(ed.getInputValue("IsNew").toBool()){ NSPersonAgent pAgent; NSPersonEntity pEntity = pAgent.GetPersonEntity(ed.getInputValue("PersonEntity.PersonId").toInteger()); NSContact contact; contact.SetContactId(0); pEntity.SetContact(contact); pAgent.SavePersonEntity(pEntity); } I will update the thread when i figure out if this is a bug or if I've missed something.  //Eivind
by Eivind Fasting
2. okt. 2024 | 07:11 a.m.
push_pin lock

WebTools auto login not working due to download service being offline/unavailable

We are having an issue with webtools auto login (double click on the owl in the tray area), it doesnt work and the log file shows the following: Error    2024-04-30T09:02:31.15    SuperOffice.TrayApp.Server.TrayAppServer>Execute<TRequest, TResponse> SuperOffice.TrayApp.TrayApp2.GetAlarmsRequest SuperOffice.TrayApp.Server.TrayAppServer+OnExecute`2[SuperOffice.TrayApp.TrayApp2.GetAlarmsRequest,SuperOffice.TrayApp.TrayApp2.GetAlarmsResponse] MSSQL - 12 \\\ 1501235947 SuperOffice 10.3.3 NetServer 10.3 Release (Build: Release_OnSite_10.3.3_2024.04.17-01) 10.3.0.0 10.3.3.617 Release_OnSite_10.3.3_2024.04.17-01 Default ACRMWEB02 NetServer        TrayAppServer.Execute implementation failed SuperOffice.TrayApp.TrayApp2.GetAlarmsRequest DH (1993) - Authorized (Employee)Gebruikersniveau 0+:  MSSQL - 12 \\ACRMSQL10\SuperOffice_AllCRM (crm_AllCRM), Database serial #: 1501235947, Database Expiration Date: Friday, July 12, 2024 ACRMSQL10 SuperOffice_AllCRM 1501235947 SuperOffice 10.3.3 NetServer 10.3 Release (Build: Release_OnSite_10.3.3_2024.04.17-01) 10.3.0.0 10.3.3.617 Release_OnSite_10.3.3_2024.04.17-01 Default ACRMWEB02 NetServer Response status code does not indicate success: 502 (Bad Gateway).    at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()    at SuperOffice.Util.HttpHelper.GetObjectFromHttpSyncWithContent[T](String url, HttpServiceJwtConfig config, RequestType requestType, HttpContent content)    at SuperOffice.DCF.Web.WebTools.WebToolsVersionService.GetVersionResponse(String clientVersion)    at SuperOffice.TrayApp.Server.TrayAppServer.ApplyVersioningRules[TResponse,TRequest](TResponse response, TRequest request)    at SuperOffice.TrayApp.Server.TrayAppServer.Execute[TRequest,TResponse](TRequest request, OnExecute`2 implementation) System.Net.Http           Exception Message:Response status code does not indicate success: 502 (Bad Gateway).       Exception Source:System.Net.Http       Exception Target:System.Net.Http.HttpResponseMessage EnsureSuccessStatusCode()          at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()          at SuperOffice.Util.HttpHelper.GetObjectFromHttpSyncWithContent[T](String url, HttpServiceJwtConfig config, RequestType requestType, HttpContent content)          at SuperOffice.DCF.Web.WebTools.WebToolsVersionService.GetVersionResponse(String clientVersion)          at SuperOffice.TrayApp.Server.TrayAppServer.ApplyVersioningRules[TResponse,TRequest](TResponse response, TRequest request)          at SuperOffice.TrayApp.Server.TrayAppServer.Execute[TRequest,TResponse](TRequest request, OnExecute`2 implementation)   The download service is offline, so i guess that is the underyling issue (https://www3-superoffice-com.azurewebsites.net/DownloadService/) WebTools should still work when this isn't available... SuperOffice Version: SuperOffice CRM OnSite 10.3 Release_OnSite_10.3.3_2024.04.17-01 WebTools version:   
David Hollegien
1
5
30. apr. 2024 | 07:05 a.m.
Emne:
Online development and web service API's

Siste svar

They are working on it. https://status.superoffice.com/incidents/w8hwbhkvm44l
by Tony Yates
27. sep. 2024 | 08:49 a.m.
push_pin lock

NSSource and UserDefinedFields GetDeleted();

Hello Team,   I am trying to set up a script that will prevent our users to close sales that have depracated Sources or in our case, "Sale Department" (Custom Field). After reviewing the documentation, I noticed the Source does not have the GetDeleted() method, and I can't seem to find any information on UserDefinedFields, other than getting them from EventData or mapping them via the Sale Entity. Do you know how I could go about getting the "Deleted" flag for these two? Thank you! #setLanguageLevel 3; EventData ed = getEventData(); /*Source*/ Integer sourceId = ed.getInputValue("SaleEntity.Source.Id").toInteger(); Integer saleId = ed.getInputValue("SaleEntity.SaleId").toInteger(); NSSaleAgent saleAgent; NSSaleEntity saleEntity = saleAgent.GetSaleEntity(saleId); NSSource source = saleEntity.GetSource(); String name = source.GetValue(); /*Sale Dpt*/ //“SaleEntity.CustomFields.SuperOffice:3:DisplayText": "1234 SaleDepartment", //"SaleEntity.CustomFields.SuperOffice:3:DisplayTooltip": "Tolltip", //"SaleEntity.CustomFields.SuperOffice:3:org": "[I:45]" String saleAzetsCompany = ed.getInputValue("SaleEntity.UserDefinedFields.SuperOffice:3");

AB

Andrei Berianu
3
4
15. jul. 2024 | 12:26 p.m.
Emne:
Service and CRMScript Discussion

Siste svar

Everything you ever wanted to know about lists... https://docs.superoffice.com/en/api/netserver/lists/index.html
by Tony Yates
23. sep. 2024 | 05:54 a.m.
push_pin lock

GetDeleted() and text color

Hello Team, Would it be possible to set all values in a field where GetDeleted() = 1 to Red? Currently deleted values cannot be selected, but if already there, can be saved without issues. Having them listed with red text will provide a visual indication that these need to be changed. Some classes also do not have the getDeleted() method, which means that we can't easily make CRM scripts, without actually tagging the Name or description with a something that we can later use to determine if the value is disabled or not. For example, I am tagging departments that are no longer active with DISABLED_ so that I can script behaviour based on this, which is not really ideal...     Having red text for deleted items and getDisabled() method available for all classes that have the Deleted flag in the DB it would help.   Thank you!

AB

Andrei Berianu
1
0
19. sep. 2024 | 08:30 a.m.
Emne:
Service and CRMScript Discussion
push_pin lock

change subject for the message on fly while sending it

Hello there In service there is only one subject you can modify if needed and all messages will be sended by using this subject. However, some times if you want to discuss with third party and send out message with different subject, it is not possible without changeing ticket title and after sending it, change it back as it was. Is it possible to show also subject for every message and also changeing it before sending message?  Thanks Regards Ingar

IM

Ingar Mölder
2
1
18. sep. 2024 | 06:30 a.m.
Emne:
Service and CRMScript Discussion

Siste svar

Hi Ingar,   If required, some custom logic could be added to your solution which would allow for dynamically updating the title of a request (or the subject of an e-mail). I would recommend contacting your local consultancy team for assistance.
by Bas Kreijveld
18. sep. 2024 | 06:33 a.m.
push_pin lock

Automatic e-mail notification to SecondaryPersons(?) about new answers.

Hi, My users can see tickets belonging to their colleagues, and some want to get notifications about tickets that doesn't belong to them. When adding someone to a ticket's SecondaryPersons the persons email appers over the message when writing a new reply in SuperOffice, but SuperOffice only e-mails the person who created the ticket. Can I get SuperOffice to notify SecondaryPersons?

VS

Vidar Sollie
2
2
16. sep. 2024 | 01:08 p.m.
Emne:
Online development and web service API's

Siste svar

Sorry, I meant the external users of our customer frontend. They can mark tickets as favorites (stored in an external DB; I didn’t see a way to do it using the SuperOffice API), but they now want email notifications for favorite tickets. When a ticket has SecondaryPersons, their emails appear above the message when writing a reply, but SuperOffice only notifys the first email. Why?

VS

by Vidar Sollie
17. sep. 2024 | 08:19 a.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
44
23. mai 2024 | 08:04 a.m.
Emne:
Service and CRMScript Discussion

Siste svar

Hi David, We have made some additional improvements when it comes to reserved keywords in coming release (10.3.10). Thank you for pointing this out.
by Michel Krohn-Dale
11. sep. 2024 | 11:12 a.m.
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
2
5
4. sep. 2024 | 12:22 p.m.
Emne:
Online development and web service API's

Siste svar

Public now and marked as fixed for 10.3.9. Can confirm it is fixed in my SOD tenant.
by David Hollegien
10. sep. 2024 | 12:14 p.m.