Home > Forum > Actions > SDK CustomAction return data to ItemsList

SDK CustomAction return data to ItemsList
0

Hello Gurus
I'm trying to do such action:
In my VS solution, I have made CustomAction that gets data from an external system as a list. I would like to return that list to ItemsList in my workflow. I have code like this:

[ConfigEditableFormFieldID(DisplayName = "Pozycje nagłówka ", FormFieldTypes = WorkFlow.SDK.Objects.Enums.FormFieldTypes.ItemsList)]
public List Lista_Poz { get; set; }

public class Nagl_OT
{
[ConfigEditableFormFieldID(DisplayName = "Numer SAT", FormFieldTypes = WorkFlow.SDK.Objects.Enums.FormFieldTypes.TextSingleLine)]
public string Sat_ID { get; set; }
[ConfigEditableFormFieldID(DisplayName = "Podnumer SAT", FormFieldTypes = WorkFlow.SDK.Objects.Enums.FormFieldTypes.TextSingleLine)]
public string Podnr_ID { get; set; }
[ConfigEditableFormFieldID(DisplayName = "Data dokumentu", FormFieldTypes = WorkFlow.SDK.Objects.Enums.FormFieldTypes.TextSingleLine)]
public string DataDok { get; set; }
[ConfigEditableFormFieldID(DisplayName = "Data odniesienia", FormFieldTypes = WorkFlow.SDK.Objects.Enums.FormFieldTypes.TextSingleLine)]
public string DataOdn { get; set; }

}

In Run() I put records from an external system to Lista_Poz. In Designer Studio I have created Items List with columns like in Nagl_OT.

When I call my action in the workflow I get an error:Invalid cast from 'System.String' to 'WebCon.SAP.CustomActions.NaglowekOT+Nagl_OT

How should I implement Items List in my solution that I could be able to return data in workflow?
Please help!!! :)

Greetings Kate.

MVP

Hi Kate,

I've done something similar, the external system was a Xml file which contents has been "copied" to an item list.
Here you can find a "documentation" as well as a link to the source code
https://daniels-notes.de/posts/2021/custom-action-xml-to-item-list

https://daniels-notes.de/posts/2021/custom-action-xml-to-item-list#download

I hope this helps.

Best regards,
Daniel

Privacy overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognizing you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.


To see a full list of the cookies we use and learn more about their purposes, visit our Privacy Policy.