Skip to main content
Solved

Easiest way to insert complex data records into existing screens.

  • December 8, 2022
  • 1 reply
  • 338 views

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!

Best answer by bpickleskcm

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.

 

View original
Did this topic help you find an answer to your question?

1 reply

bpickleskcm
Jr Varsity II
Forum|alt.badge.img
  • Jr Varsity II
  • 20 replies
  • Answer
  • June 13, 2023

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings