Application Programming Interface forums

0 Prenumeranter

3 Ämnen

4791 Samtal

Area for questions and answers about SuperOffice API's.

push_pin lock

REST SaveQuoteLine - Error when creating a new QuoteLine

Hello, When I try to create a new QuoteLine a get: "Message": "Object reference not set to an instance of an object.",   I'm using Postman and .Net and I get the samme error. First I get a new QuoteLine using /Agents/Quote/CreateQuoteLine with {     "QuoteAlternativeId": "9",     "ERPProductKey": "SUO_1" }    as body.   When I copy the Json and add it as body in /Agents/Quote/SaveQuoteLine and POST the request I get the error.   I've tried to modifed the Json to just include a couple of fields, but I get the same result.   What am I doing wrong?  

FF

Frode Follerås
1
1
5. dec 2023 | CET 04:18
Ämne:
Online development and web service API's

Senaste svar

It's now solved. I missed "QuoteLine": { }   property in the Json.

Community.Data.Models.ForumConversationDetails?.AuthorInitials

by Frode Follerås
7. dec 2023 | CET 11:42
push_pin lock

The new CRMScript Editor - Some feedback

Hi, We noticed this morning that you have launched a new CRMScript "editor". But, we quickly found a few errors that is causing our day to day to become much harder. 1. Indentation does no longer work. Ctrl + A and then Shift + Tab would indent the code, not it just moves everything to the left. 2. Bracket highlights does not always work. Works just fine The else does not. Seems quite hard to recreate when i try to do it "manually", but we have seen this issue in multiple customer enviroments, and, the code works just fine 3. String highlights does not always work. As you see on the log, the debug16 part should be green. Any suggestions?
Pär Pettersson
3
2
6. dec 2023 | CET 02:14
Ämne:
Service and CRMScript Discussion

Senaste svar

New editor Old editor   Highlighting goes wrong here in new editor.   ===== New intellisense - maximum of 7 items in window Old Intellisense Much more items are available in the intellisense window.   ======== "F11" for "full-screen" editing not working anymore      
by Bas Kreijveld
7. dec 2023 | CET 10:43
push_pin lock

REST: otherGroups in /User endpoint

Hello. It seems the otherGroups field in the /User endpoint returns the same value as 'usergroup'. I assume this is is not the correct behaviour?

ES

Einar Quizon Stavnes
0
0
5. dec 2023 | CET 04:13
Ämne:
Client libraries and tools
push_pin lock

Instant error message: Script is taking too long to execute. Negative User CPU time.

Hi, One of our customers has a custom screen built in Service. First, the user uploads a .csv-file, Then, they click "Upload" which executes a CRMScript and redirects them to another screen. The CRMScript parses and saves the csv data in an extratable. The data is then displayed in another Screen using a static table.  After confirming that the data is correct, the user click "Import" which executes another CRMScript. This script contains some business logic and calculations, some of the data is saved again to another extratable.   We're encountering an issue where users sporadically receive the error message below. The error message usually appears instantly, rather than after the script has been running for a while.  Script is taking too long to execute. Execution time: 1066117.28,  User CPU time: -6871.58 After retrying 3-4 more times, it works without any issues. Does anyone have any idea what could be causing this error? Not sure if it helps, but i've also seen the error occurring in other customer's enviroments when custom screens are loaded. Let me know if you need more details.
Thomas Roesen
3
1
28. nov 2023 | CET 01:32
Ämne:
Service and CRMScript Discussion

Senaste svar

If you retry it, are you using the same file for import? I assume you are storing the file you want to import as a attachment in service, maybe a timeout occurs there because it took to long to same/retrieve it? I would add some logging between each step you mentioned and see where it fails.
by David Hollegien
29. nov 2023 | CET 11:03
push_pin lock

Expanded documentation of how SCIM treats retired / inactive users

Hi forum I have a customer running the SCIM integration, and they are asking for some more information on the specifics of how SCIM handles retired users, and users who just had their user plan revoked. I explored the SuperOffice documentation regarding SCIM (System for Cross-domain Identity Management), but I couldn't find specific details on when a user synced from Azure AD to SuperOffice via SCIM is marked as retired/deleted, or when their license is simply removed without the user being set to retired (By being removed from the userplan AD group, but staying in the group specifying role and group). Unfortunately, the specific scenarios i am looking for does not seem to be covered in the documentation. Example ruleset for my SCIM configuration: License groups in AD: so_salesprem //Provides access to Sales Premium so_marketing //Provides access to Marketing so_serviceprem //Provides access to Service Premium so_salespremservicepremmarketing //Provides access to the full plan Role groups in AD: so_role_0 //Sets the user up with role 0 so_role_1 //Sets the user up with role 1 Primary groups in AD: so_group_management //For the users in the management so_group_sales //For the users in the sales department so_group_marketing //For the users in the marketing department A typical user will therefore be assigned three groups in AD, depending on what we would like them to end up with in SuperOffice The SCIM configuration will then have the following rules: In AD Group so_role_0: Primary group - Always: Fallback group In AD Group so_role_1: Primary group - Always: Fallback group NOT In AD Group so_salesprem: Plan - Always: Not selected NOT In AD Group so_marketing: Plan - Always: Not selected NOT In AD Group so_serviceprem: Plan - Always: Not selected NOT In AD Group so_salespremservicepremmarketing: Plan - Always: Not selected In AD Group so_role_0: Primary group - Always: Fallback group In AD Group so_role_1: Primary group - Always: Fallback group The above rules are their to provide default settings, if the AD user does not meet any other rules, like those defined below: In AD Group so_salesprem: Plan - Always: Sales Premium In AD Group so_marketing: Plan - Always: Marketing In AD Group so_serviceprem: Plan - Always: Service Premium In AD Group so_salespremservicepremmarketing: Plan - Always: Sales Premium - Service Premium - Marketing In AD Group so_group_management: Primary group - Always: Management In AD Group so_group_sales: Primary group - Always: Sales department In AD Group so_group_marketing: Primary group - Always: Marketing   My tests are the following: For a user that is decommisioned/retired in AD, the following happens: User is marked as retired, and license is revoked. This is what i expect:  User is marked as retired, and license is revoked and made available for other users. For a user that is NOT decommisioned/retired in AD, but having their license group removed, keeping the two others, the following happens: User is ALSO marked as retired, and license is revoked and made available for other users. This is what i expect: License is revoked, and made available for other users   Is this the correct behaviour? How would i setup SCIM rules to make sure a user is not marked as retired just because of loosing it's license plan?   
Dennis Mortensgaard
2
1
23. nov 2023 | CET 11:35
Ämne:
Client libraries and tools

Senaste svar

Hi Dennis, Currently there's no way to achieve what you want. If user is not assigned any license after all rules are processed - SCIM will set both "retired" and "deleted" flags on this user.
by Oleg Deribas
27. nov 2023 | CET 02:11
push_pin lock

Issues saving appointments that are created via GUI

Hello! I'm currently experiencing some major issues in a customer environment(online) since the last SuperOffice update. I'm no longer able to save any appointments that has been created by the users via the GUI, I and the users are still able to edit these appointments via the GUI. Appointments that are created by CRMScripts can still be edited via CRMscripts.   try{ Integer appointmentId = 12129; NSAppointmentAgent appointmentAgent; NSAppointmentEntity appointmentEntity = appointmentAgent.GetAppointmentEntity(appointmentId); appointmentAgent.SaveAppointmentEntity(appointmentEntity); } catch{ log("Error: " + error); printLine(error); } Running above code on an appointment created via GUI results in the following: No error is ever printed or logged, the icon just keeps spinning. I have checked all of the extrafields connected to Follow-up and none of them are mandatory.   I have also checked that the NSAppointmentEntity is loaded by the agent: try{ Integer appointmentId = 12129; NSAppointmentAgent appointmentAgent; NSAppointmentEntity appointmentEntity = appointmentAgent.GetAppointmentEntity(appointmentId); printLine(appointmentEntity.GetCompleted().toString()); //appointmentAgent.SaveAppointmentEntity(appointmentEntity); } catch{ log("Error: " + error); printLine(error); }   Has anyone else experienced any similiar issues or have any suggegestions on how to proceed to solve the problem?

LK

Ludwig Kleiser
3
3
23. nov 2023 | CET 02:25
Ämne:
Service and CRMScript Discussion

Senaste svar

This should be fixed now. 
by Tony Yates
27. nov 2023 | CET 08:26
push_pin lock

Updating the Visible For field on Sales

Hello, I am not the most experienced person regarding CRMscript, I am sorry for the newbie mistakes. I am trying to update the Visible For field, but it seems that the values from the Even Data are not the correct. ED keeps returning database values rather than the actualy ED values. For example if the Visible for is set to me, and then I change it to someone else, it will change to that person in the UI, but when looking up the field in ED, I get myself, not that person. Considering this "bug" I've looked for a way to change it "After" saving the sale rather than "Before" trigger, but it seems that I am unable to save the array[]. I've also tried to ed.SetOutput but I can't seem to be able to change the Visible for value whe using the "Before saving" trigger.   Is there something I am missing or doing wrong? Any help would be grately apreciated. #setLanguageLevel 3; //Event Data EventData ed = getEventData(); /*---------------------------------------------------------------------------------------------*/ //Get required fields from ED String saleVisibleFor = ed.getInputValue("SaleEntity.VisibleFor.length"); String saleVisibleForId = ed.getInputValue("SaleEntity.VisibleFor[0].VisibleId"); String saleVisibleForValue = ed.getInputValue("SaleEntity.VisibleFor[0].DisplayValue"); /*---------------------------------------------------------------------------------------------*/ //Get Sale Integer sale_id = ed.getInputValue("SaleEntity.SaleId").toInteger(); NSSaleAgent saleAgent; NSSaleEntity saleEntity = saleAgent.GetSaleEntity(sale_id); //GetVisibleFor NSVisibleFor[] visibleFor = saleEntity.GetVisibleFor(); //GetVisibleFor Values Integer visibleForId = visibleFor[0].GetVisibleId(); String visibleForIdString = visibleForId.toString(); String visibleForValue = visibleFor[0].GetDisplayValue(); /*---------------------------------------------------------------------------------------------*/ //Confidential sale //3164 visibleFor[0].SetVisibleId(3164); saleAgent.SaveSaleEntity(saleEntity); ed.setMessage("saleVisibleFor = "+saleVisibleFor+"\n"+ "saleVisibleForValue = "+saleVisibleForValue+"\n"+ "saleVisibleForId = "+saleVisibleForId+"\n"+ "-----------------\n"+ "visibleForIdString = "+visibleForIdString+"\n"+ "visibleForValue = "+visibleForValue+"\n" );

AB

Andrei Berianu
2
2
13. nov 2023 | CET 03:42
Ämne:
Service and CRMScript Discussion

Senaste svar

Thank you David! I've also adapted to make it work for documents.

Community.Data.Models.ForumConversationDetails?.AuthorInitials

by Andrei Berianu
15. nov 2023 | CET 06:59
push_pin lock

SelectionEntity.MemberCount data type inconsistency

Hi,   In the Swagger file of the Agents Web API, the "MemberCount" property, that belongs to "SuperOffice.CRM.Services.SelectionEntity", is defined like this:   "MemberCount": { "format": "int32", "description": "How many selectionmembers (for progress bar calculations) - estimate, -1 (or 4294967295) means we don't know", "type": "integer" }   4294967295 is the max value for an unsigned integer. Obviously, -1 cannot be assigned to an unsigned integer, so there is some inconsistency regarding the intended data type here.   In package SuperOffice.NetServer.Services.10.2.9.778, SelectionEntity.MemberCount is declared as an unsigned integer:   // // Summary: // How many selectionmembers (for progress bar calculations) - estimate, -1 (or // 4294967295) means we don't know [DataMember] public virtual uint MemberCount { get; set; }   And indeed, when we make a REST call to the Web API, we receive UInt32.MaxValue as the MemberCount for selections with an unknown number of members:   ... "IncludePerson": 0, "MemberCount": 4294967295, "Name": "DataBridge 20170705143636 new person", ...   The client we generate using OpenAPI Generator declares SelectionEntity.MemberCount as an int, so it crashes when it tries to deserialize a selection with an unknown member count.   JSON integer 4294967295 is too large or small for an Int32. Path 'MemberCount', line 1, position 973.   The only way to get OpenAPI Generator to declare MemberCount as a uint is to add a flag --openapi-normalizer ADD_UNSIGNED_TO_INTEGER_WITH_INVALID_MAX_VALUE=true and change the Swagger file as follows:   "MemberCount": { "format": "int32", "description": "How many selectionmembers (for progress bar calculations) - estimate, -1 (or 4294967295) means we don't know", "type": "integer", "minimum": 0, "maximum": 4294967295 }   Can you let us know if you are able to automatically add the minimum and maximum fields in the Swagger file? We would like to avoid having to change the Swagger file manually as much as possible.   Thank you
Véronique Borel
2
1
13. nov 2023 | CET 10:17
Ämne:
Online development and web service API's

Senaste svar

Hi Véronique, We are sorry the inconvienence. Logged as bug 49487. Best regards.
by Tony Yates
15. nov 2023 | CET 03:40
push_pin lock

SuperOffice 8 on premise and ADO connection

Hi guys I'm having a problem with a customer running an old SO 8 instance, without maintenance agreement active.  As you can see here, license is active until 2099.   The problem is, that all modules using the ADO com Database API has stopped working recently, returning the message: The license has expired and the SuperOffice API will not allow log in. Renew the license using soadmin.   Everything works, SO Web, Service, SO Win etc. But if i run any Amesto apps for example, i suddenly get the above error. If i create a simple shell script like Set DB = CreateObject("SuperOfficeDB.Database") If IsObject(DB) then DB.Login "xxxx", "xxxxxxxxxx" Set con = DB.GetContact(1) MsgBox "Contact Id 1, Name: " & con.Name else MsgBox "Unable to connect to database" end If Set DB = Nothing I get the same error.   I thought it wouldn't make much sense to ask support about this, before some of you could maybe point out what specific license it is they are missing, cause from what i can tell from the admin interface, everything's fine?   Thanks in advance.
Dennis Mortensgaard
2
3
13. nov 2023 | CET 11:51
Ämne:
Client libraries and tools

Senaste svar

Hi, that seems to be a date far in the past, so I don't think that is the issue here. (unless this has not been working/tried for a very long time) Not sure what date is checked by the COM API, I assumed it was the expiration date but that clearly is not the case. I think best case here is to contact support and ask if they can give you a license file with an updated date or something?
by David Hollegien
14. nov 2023 | CET 02:02
push_pin lock

ArchiveAgent, getting the email address of ticket person

I need to find the email, personId, and ticketId of all tickets closed before a specific date. Is this possible in a singe query?   I have tried the following, but no column data for email. var ticketsWithOwner = await archiveAgent.GetArchiveListByColumnsAsync("Dynamic", new[] { "ticket.id", "ticket.cust_id","ticket.person.email.email_address" }, null, new[] { new ArchiveRestrictionInfo() { Name = "ticket.closed_at", Operator = "Before", Values = new[] { "2020-11-05" }, IsActive = true, InterOperator = InterRestrictionOperator.And, } }, new[] { "ticketdisplayclosed" }, 0, 10);

SG

Snorre Garmann
4
9
8. nov 2023 | CET 08:03
Ämne:
Client libraries and tools

Senaste svar

Ok, thanks for the input! In most cases it has probably not been a faulty behaviour from the API, but rather a lack of understanding from my side when it comes to certain implicit joins (or lack of docs ;)). So joins may have been made on another primary key than I might have assumed or something like that. For example if there are two different personId's in the same PK-table or something like that. It was a while ago a had such a problem, so don't remember exactly. But I know that I would have appreciated a way of seeing the end result of the query to verify that it actually queried what I was expecting. I understand the ideal of keeping a healthy distance from the database, especially from a write-perspective. But from a pure dev-view-perspective it would still have been a valuable feature. But we will probably have to solve that in other ways if needed then. :) /Marcus
by Marcus Svenningsson
9. nov 2023 | CET 02:46