Field action with REST API

Hi all,

Is there a possibility to execute field actions using REST API?

Best Regards

  • It really depends on what you are trying to achieve, REST is based on representations and classes, field actions come from the classic environment, can you please describe in more detail, maybe than we can suggest a shortcut. Thanks.

  • Hi Martins,

    Actually, I come from the old school of X3 programming. I still don't really understand the advantages of using Representations and classes over Masks and Windows. 

    Our need is to create and modify records of several X3 objects using a third-party application. The communication protocol would be Web Services.

    I want to be sure that when I create a new record, all standard and specific actions will be executed.

    Also, in the third party application, I want to execute field checks on each field in the 3party app before sending the create query. the aim is to guide the user while he/she inputs data.

    I hope that I explained clearly what I want to achieve.

    Best regards

  • Yes, understand now.

    I think you would not get this easily, the first part, the same business logic... 2 options on the fly: 1 - replicate the code in classes, so when you call create record in REST it will run the same logic; 2 - Create a Class/Representation (Shadow of the object you want to create) just to receive the request, then generate a file and import as an import model, as we do in standard, this way the class will be the request and the classic object will be the same object as you have;

    Regarding the the field checks problem, usually we do this by creating specific views with columns and filters as necessary, and then you create a class and representation over the view and therefore you can then call the REST webservices with the result you want. This is a blind suggestion, if you give us some more info, maybe we can provice more efficient solution.

    This reply is based on our experience around classes and representations, believe it is very handy, these days we build a lot around hybrid objects, using the mask and windows interface, but then using classes for the server business logic, easier to manage multiple child and easier to control the behavior and business logic. Initially it takes more time, and usually developers are afraid of change...

    If you need specific support call me on teams ([email protected]), we can show you some examples we did to communicate with a website for stock online. Cheers.

  • Hi Martins,

    Thank you very much for this valuable information.

    I must first learn the concepts of class and representation before I start using the REST protocol.

    Thanks again

More Content