Solved

Easiest way to insert complex data records into existing screens.

  • 8 December 2022
  • 1 reply
  • 205 views

Userlevel 2

Firstly, this is a two-part question:

Part One, is it possible to use the API endpoint interface to insert data into existing screens from within the same customisation project? I obviously don’t want to write POST or PUT requests externally as the data transfer is within the same application, but the API endpoints are easy to use for data insertion in a global JSON format and I would avoid situations like below.

Any opinions or thoughts would be appreciated.

 

Part Two, I am trying to make new records of a time sheet in the EP305000 screen and this requires entering data into the main page and a tab in that page.

 

 

I have successfully inserted data into pages in the past using the View / VewDelegate, method where you create a new instance. This time I need to insert data into two parts of the page and I have no idea how to do this, my attempt is below.  

// View - using EPT Time card as its the header, I'm inserting data into header and Tab - error

        public PXSelect<EPTimeCard> Inserting; 

        public virtual IEnumerable<object> TimesTimes() // ViewDelegate

        {

            EPTimeCard record = new EPTimeCard() 

            {

                TimeCardCD = "<new>",

                EmployeeID = 00000003,

            };

            // EPTimecardsDetail is a Tab in the main page relating to TimeCardMaint

            EPTimecardDetail record2 = new EPTimecardDetail()

            {

                Date = DateTime.Now,

                EarningTypeID = "RG",

                TimeSpent = 8,

                IsBillable = true,

                BillableTimeCalc = 7,

                Day = "Monday"

            };

            // Attempting to pass the values though as a list, it didnt work.

            List<object> returnRecord = new List<object>() 

            { record, record2 };

            yield return Inserting.Insert(returnRecord); //Didnt work

        }

I have a feeling I am completely “off the mark” with the View / ViewDelegate method of data insertion, and perhaps there is a better way. When I google everyone seems to use the View / ViewDelegate method.

 

A final note, I also need to pass a file in with my timesheet, the API method would make it much easier. 

 

If you read this and don’t have time to respond, any links or opinions would be appreciated.  

 

Thank you all! Happy coding!

icon

Best answer by bpickleskcm 13 June 2023, 23:10

View original

1 reply

Userlevel 3
Badge

Just saw this; not sure if you’ve got your scenario sorted out, but reminded me of our situation importing time cards.

Going to use file sync and import scenarios on a daily schedule.  Little bit of excel formatting etc. to get them to work, but it seems to be going well.

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved