Script selection of udefs

Hi

I need to implement a script-based service selection to select tickets based on user defined fields of the company - user defined fields created in the sales part of SuperOffice. While the selection is technically no problem the user will not see any user defined fields in the selection result. Also, it is not possible to filter the result by user defined fields. It is not practical for our users. They want to see user defined fields in the result and be able to filter according to user defined fields as well.

The only workaround I can think of is to duplicate user defined fields as extra fields of the company, and to populate those extra fields in a scheduled task. Then I can use regular dynamic service selection based on the redundant extra fields.

Is there any other way? Without having to create redundant data?

Best regards
Marc

RE: Script selection of udefs

Hi Marc,

If I understand you correctly, I believe I had a question much like this 2017... :)

https://community.superoffice.com/en/developer/forum/rooms/topic/superoffice-product-api-group/customer-service/field-syntax-search-criteria/

If I remember it correctly, I had some success when it came to showing related udef-fields. At least if it wasn't related to an UDEF-list.

But according to Sverre, this is an undocumented and unsupported feature that isn't the result of an intended design, so officially there is no such support. :)

Also, this feature have the same weakness calling UDEF-fields as SearchEngines, in the way that specific database-fields need to be used. There is no ProgID-support or anything like that. So if the udef-fields are reallocated, the wrong data might be shown. Though, given that this is a known fact, this can be documented and also handled in a controlled way, if changes to udef-fields are made that could lead to a reallocation.

I haven't tried this lately, so I don't know how newer versions of SO handles this syntax.

If it works, it might be a good enough solution for now and if/when it breaks, a more advanced solution might be needed (but it might break when you least expect it, so be warned). If we are lucky, more advances have been made when it comes to the integration and handling of udef/extra fields at that time! :)

 

Best Regards
Marcus

By: Marcus Svenningsson 4 Nov 2020

RE: Script selection of udefs - Working proof of concept

Working proof of concept in SO 9.2 Online:

  • Create a dynamic selection in Service with the source "contact" (Company).
  • Go to the tab [Profile]
  • In the field-selector field, manually add the text "userdef_id/string01", add a descriptive field label and table width, press "Add Column"
    • If ok, the field will be added to the column list, otherwise you will get an error
  • Note that you cannot use the whole path as shown in the column list "contact.userdef_id.string01" as syntax, you have to ONLY add the part of the path extending the used root table, the other part will be added automatically
  • The separator character is NOT "." but "/" when adding the field to the column list
  • Though, when shown in the column list, the separator character "." is used

 

Result:
Note 1. ERPID is dimmed but shows the correct data from the UDEF-field string01
Note 2. ERP Country is connected to an udef-list and shows the id of the list-item

 

Best Regards
Marcus

By: Marcus Svenningsson 4 Nov 2020

RE: Script selection of udefs

After some more testing with the udef-list field it seems that neither of the below path-strings works:

  • userdef_id/long13/UDList_id/name
  • userdef_id/long13/udlist_id/name

Probably because there is no implicit under-the-cover relation between those tables.


/Marcus

By: Marcus Svenningsson 4 Nov 2020

RE: Script selection of udefs

Hi Marcus,

thanks for your valuable and detailed hints. And you are right: relations beyond udef fields do not work:

ticket.cust_id.contact_id.userdef_id.long01 -- Yields e.g. associate_id
ticket.cust_id.contact_id.userdef_id.long01.name -- Does not work

Unfortunately, for our customer, this is not useful either.

Best regards
Marc

By: Marc Eberhard 5 Nov 2020

RE: Script selection of udefs

Hi,

Not sure exactly which version your customer is running, but I am sure you are aware of opportunities described in this post. This is a huge step in breaching the gap between our two worlds (CRM.web and Service). 

If this is not an option for your customer I think you would have to create a syncronization task and duplicate fields. Important to consider that it should perhaps only be 1-way. Keep in mind that down the line you might have to remove duplicate fields due to feature described in post.

By: Michel Krohn-Dale 5 Nov 2020

RE: Script selection of udefs

Hi Marcus,

thanks for your valuable and detailed hints. And you are right: relations beyond udef fields do not work:

ticket.cust_id.contact_id.userdef_id.long01 -- Yields e.g. associate_id
ticket.cust_id.contact_id.userdef_id.long01.name -- Does not work

Unfortunately, for our customer, this is not useful either.

Best regards
Marc

By: Marc Eberhard 5 Nov 2020