Skip to main content

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!

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