CS extra fields in Rest API

Hi.

We have a lot of CS extra fields on our objects.

Contact has an x_objectguid and x_code.

I am not able to see or change/create this using REST API.

How do I do this?

Espen

RE: CS extra fields in Rest API

Hi Espen, 

The Rest APIs does not support the Service module as of this date - it is under implementation, and if you want to fetch the extra fields, you'll need to create a CRMScript that fetches it for you, or fetch it directly from the database.

 

By: Simen Mostuen Iversen 5 Feb 2019

RE: CS extra fields in Rest API

This is really really bad!

When we chose to upgrade from CS 7 to 8 it was because Sverre Hjelm in a meeting told us that CS was now fully supported in REST. We had a lot of other CS-systems that we considered, but because of this we chose to do this.

We have really been struggling to make this work and now we feel we have been fooled!

We need to create and read contacts, persons and tickets from code with x_parameters.

I have been using SODB class to do some of this, but I am not able to make this work after the upgrade so I was going to move this to REST. 

What is the timeline for this now??

Espen

By: Espen Fosshaug 5 Feb 2019

RE: CS extra fields in Rest API

If Sverre has said it is supported, then it must be.

I knew it was in planning, but not that it was already available.

 

Then I apologize for giving my 2 cents, because then I honestly have no idea.

By: Simen Mostuen Iversen 5 Feb 2019

RE: CS extra fields in Rest API

Hi Espen,

Don't worry, the REST API's are under continous development, and I believe you have already been testing some of them. Information just flows slowly sometimes :-) The current status is that our latest release supports Tickets/Message CRUD operations with standard extra fields (x_*), as well as extra table (y_*) CRUD operations.

We currently do not support REST operations for CS extra fields on company/contact, but it is on the backlog and I hope we will get that fixed quite soon. Stay posted for updates.

Sverre

By: Sverre Hjelm 5 Feb 2019

RE: CS extra fields in Rest API

Thanks Sverre - we are currently not able to create companies the way we used to.

But then I have to figure out what is wrong there. Looks like some login-problem on the SODB class.

Espen

By: Espen Fosshaug 5 Feb 2019

RE: CS extra fields in Rest API

SODB is unfortunately outside my knowledge area. Perhaps someone else can help out. Do you have any more specifics about your problem? Perhaps some failing code?

Sverre

By: Sverre Hjelm 5 Feb 2019

RE: CS extra fields in Rest API

I have SO gurus in the building. We will figure it out :-)

Espen

By: Espen Fosshaug 5 Feb 2019

RE: CS extra fields in Rest API

Hi Espen,

When you say SODB, are you referring to the COM API? This is not the forum for COM questions...use the Windows Client forums.

With regards to  REST, are you not able to select x fields using the dynamic archive provider?

/api/v1/Archive/dynamic?$select=contact.name,contact.x_objectguid,contact.x_code

Frode Lillerud has created a nice blog post that describes how to use CRMScript to build custom REST endpoints in Service that may fix your existing limitations. 

Hope this helps!

By: Tony Yates 5 Feb 2019

RE: CS extra fields in Rest API

Hello Sverre,

The current status is that our latest release supports Tickets/Message CRUD operations with standard extra fields (x_*), as well as extra table (y_*) CRUD operations.

This is awesome news! Just pulled the latest NetServer Services release from NuGet and found the "Extra" StringDictionary on the TicketEntity, TicketMessageEntity!

But where is the functionality you mention to do CRUD on a CS extra table? Can't find it in the 8.4 R5 release. (both REST and NetServer Services).

By: David Hollegien 5 Feb 2019

RE: CS extra fields in Rest API

The Extra field will shortly be renamed to ExtraFields to match the other entities in the service API. Continuously evolving.

By: Christian Mogensen 5 Feb 2019

RE: CS extra fields in Rest API

CRUD operations on extra tables will come in the upcoming release 8.4 R06.

There is a new agent there called "DirectDatabase" agent. It is also accessible through the WebAPI.

In Online, I think the agent is still restricted, so you will need to ask for access to it untill it is white listed. In Onsite it should be ready to go (from R06 of course).

By: Stian Andre Olsen 5 Feb 2019

RE: CS extra fields in Rest API

Hello Stian,

Thanks for the update! Looking forward to 8.4 R6 for OnSite!

By: David Hollegien 5 Feb 2019

RE: CS extra fields in Rest API

DirectDatabase will be known as DatabaseTable because Direct turned out to be confusing

By: Christian Mogensen 5 Feb 2019

RE: CS extra fields in Rest API

DirectDatabase will be known as DatabaseTable because Direct Database turned out to be confusing.

By: Christian Mogensen 5 Feb 2019

RE: CS extra fields in Rest API

None of this fixes the original problem. Extra field info will not appear on contract or person results from service.

By: Christian Mogensen 5 Feb 2019

RE: CS extra fields in Rest API

Why not ExtraTable? (instead of DirectTable / DatabaseTable)

Seems usefull to keep the name in line with how it's called in the UI / CRMScript. 

By: David Hollegien 5 Feb 2019

RE: CS extra fields in Rest API

Down the line the custom tables in CDD and Extra tables in CS will merge, so the name needs to be more general. 

 

By: Christian Mogensen 5 Feb 2019

RE: CS extra fields in Rest API

Thanks for the explanation. Lots of exciting stuff happening on the API front it seems :)

By: David Hollegien 5 Feb 2019

RE: CS extra fields in Rest API

Just upgraded to 8.4 R07.

Still no extrafields on person or contact.

Just an empty <ExtraFields/>

Shouldn't this come in R06?

Espen

By: Espen Fosshaug 11 Apr 2019

RE: CS extra fields in Rest API

Hi Espen,

No, unfortunately, CS extra fields on Person/Contact are not supported in the API. It is not on our immediate backlog either. What we have delivered, is API access to Tickets/Messages with extra fields, and API access to CS Extra tables.

I understand that you have Persons/Contacts with CS extra fields. They can be read using the Dynamic ArchiveProvider (the dot-syntax provider). Currently, there is no specific API to write to these fields. The only way I can think of right now is to use the CRMScriptAgent to call a CRMScript which writes to these fields (using SearchEngine or Customer/Company). It is not optimal, but should solve your problem for the time being. 

Sverre

By: Sverre Hjelm 12 Apr 2019

RE: CS extra fields in Rest API

Any update on this.

We are using the extrafields as an important key on contact/person.

Since you have them on the original ejournal tables it really should work on these to as well.

All our progress on using REST in stuck on this. Still using SOAP to handle all external user updates/creates :-(

Espen

By: Espen Fosshaug 30 Aug 2019

RE: CS extra fields in Rest API

ExtraFields are now supported in the REST and WCF apis for contact + person.

var row = GetJson("/api/v1/contact/40");
Assert.AreEqual(40, row.ContactId);
Assert.AreEqual("10049", row.Number2);
Assert.AreEqual("[I:123]", row.ExtraFields.x_contact_default_integer);
Assert.AreEqual("[I:0]", row.ExtraFields.x_contact_hidden_integer);
Assert.AreEqual("[I:666]", row.ExtraFields.x_contact_integer);
Assert.AreEqual("This is a big long text with <c>HTML</c>", row.ExtraFields.x_contact_longtext);
Assert.AreEqual("Saab", row.ExtraFields.x_contact_dropdown);

Also available in archives with contact and person entities.

                var archiveProvider = ArchiveProviderFactory.Create(PersonProvider.ProviderName);
                archiveProvider.SetDesiredColumns("personExtra/x_person_integer", "personExtra/x_person_float", "personExtra/x_person_longtext", "personExtra/x_person_date", "personExtra/x_person_datetime", "personExtra/x_person_time", "personExtra/x_person_boolean", "personExtra/x_person_timespan", "personExtra/x_person_shorttext", "personExtra/x_person_shorttext_list", "personExtra/x_person_user_relation", "personExtra/x_person_category_relation", "personExtra/x_person_priority_relation", "personExtra/x_person_contact_relation", "personExtra/x_person_appointment_relation", "personExtra/x_person_user_relation");
                archiveProvider.SetDesiredEntities("person");
                archiveProvider.SetRestriction(new ArchiveRestrictionInfo("personId", "=", "95"));
                archiveProvider.SetPagingInfo(10, 0);
                var rows = archiveProvider.GetRows("").ToArray();
                Assert.AreEqual("[I:678]", rows[0].ColumnData["personExtra/x_person_integer"].DisplayValue);
                Assert.AreEqual("[F:678.9]", rows[0].ColumnData["personExtra/x_person_float"].DisplayValue);
                Assert.AreEqual("Six Seven Eight Six Seven Eight Six Seven Eight Six Seven Eight", rows[0].ColumnData["personExtra/x_person_longtext"].DisplayValue);
                Assert.AreEqual("[D:03/28/2019]", rows[0].ColumnData["personExtra/x_person_date"].DisplayValue);
                Assert.AreEqual("[DT:03/28/2019 13:52:00.0000000]", rows[0].ColumnData["personExtra/x_person_datetime"].DisplayValue);
                Assert.AreEqual("[T:03/28/2019 19:25:00.0000000]", rows[0].ColumnData["personExtra/x_person_time"].DisplayValue);
                Assert.AreEqual("[I:1]", rows[0].ColumnData["personExtra/x_person_boolean"].DisplayValue);
                Assert.AreEqual("[I:6]", rows[0].ColumnData["personExtra/x_person_timespan"].DisplayValue);
                Assert.AreEqual("Black", rows[0].ColumnData["personExtra/x_person_shorttext_list"].DisplayValue);
                Assert.AreEqual("Administration", rows[0].ColumnData["personExtra/x_person_category_relation"].DisplayValue);
                Assert.AreEqual("High", rows[0].ColumnData["personExtra/x_person_priority_relation"].DisplayValue);
                Assert.AreEqual("5te Etage", rows[0].ColumnData["personExtra/x_person_contact_relation"].DisplayValue);
                Assert.AreEqual("Discuss test document 2. See doc link.", rows[0].ColumnData["personExtra/x_person_appointment_relation"].DisplayValue);
                Assert.AreEqual("SER4", rows[0].ColumnData["personExtra/x_person_user_relation"].DisplayValue);

Extra fields can also be used as restrictions

var archiveProvider = ArchiveProviderFactory.Create(PersonProvider.ProviderName);
archiveProvider.SetDesiredColumns("personId", "personExtra/x_person_integer", 
   "personExtra/x_person_float", "personExtra/x_person_longtext", 
   "personExtra/x_person_date", "personExtra/x_person_datetime", 
   "personExtra/x_person_time", "personExtra/x_person_boolean", 
   "personExtra/x_person_timespan", "personExtra/x_person_shorttext", 
   "personExtra/x_person_shorttext_list", "personExtra/x_person_user_relation", 
   "personExtra/x_person_category_relation", "personExtra/x_person_priority_relation");

archiveProvider.SetDesiredEntities("person");
archiveProvider.SetRestriction(new ArchiveRestrictionInfo("personExtra/x_person_float", "=", "678.9"));
archiveProvider.SetPagingInfo(10, 0);
var rows = archiveProvider.GetRows("").ToArray();

Assert.AreEqual(95, rows[0].ColumnData["personId"].RawValue);
By: Christian Mogensen 30 Aug 2019

RE: CS extra fields in Rest API

Thanks - this is great.

In which version was this released?
I can't see it in our.

We are still on 8.4 R07

Will do an upgrade to 8.5 R03 on test server now.

Espen

By: Espen Fosshaug 30 Aug 2019

RE: CS extra fields in Rest API

The ExtraField properties may be in  8.5 R04, but the archive provider changes will release soon in  8.5 R05.

By: Christian Mogensen 30 Aug 2019

RE: CS extra fields in Rest API

Hi, are there any plans for making it possible to do CRUD operations on data in extratables via the REST API?

By: Frode Lillerud 28 Oct 2019

RE: CS extra fields in Rest API

Hi Frode,

According to this thread, DatabaseTable agent (https://community.superoffice.com/documentation/sdk/SO.NetServer.Web.Services/html/Reference-WebAPI-Agents-DatabaseTable_Agent-DatabaseTable_Agent.htm) could be used for this, however it looks like this is restricted in Online.

By: Michel Krohn-Dale 28 Oct 2019

RE: CS extra fields in Rest API

Hi Frode,

It is available via REST as both a RESTful endpoint and Agents, as Michel points out.

 

Best regards.

By: Tony Yates 28 Oct 2019

RE: CS extra fields in Rest API

Thanks guys, I'll check it out!

By: Frode Lillerud 28 Oct 2019

RE: CS extra fields in Rest API

Actually - we liftet restrictions from the DatabaseTable back in June, I'll make sure the documentation is updated. 

By: Margrethe Romnes 28 Oct 2019