Event calling sequence in application designer in peoplecode - peoplesoft

As there are following event sets in Peoplecode
Record Field,
Component Record Field,
Component Record,
Component, etc.
And also they contain events which are common in one or more event sets like
field change event is present in both Record Field and Component Record Field..
Then in this case if we have written the field change event, from whose event set does this event gets called?

The "PeopleSoft Component Processor Flow Chart" is very helpful for determining the sequence of PeopleCode events.
http://peoplesoftcomponentprocessorflowchart.blogspot.com/
A basic flow of useful PeopleCode events when component is first loaded are:
Search Record - SearchInit
Search Record - SearchSave
Component - PreBuild
Record Field - FieldDefault
Record Field - FieldFormula
Record Field - RowInit
Component - PostBuild
Page - Activate

Related

Google Calendar API V3: Identifying edited one-offs of recurring events?

I am currently listing all events from a Google Calendar using the "singleEvents" parameter set to true, which splits recurring events into individual events – which is good. However, I'm running into an issue when an instance of a recurring event is edited, and the edits are saved with the "Only this event" option in the Calendar UI.
What I need to do is be able to identify which of these recurring event instances have been edited, and which have not. It seems the API response data does not provide any indications of whether this is an instance of the unedited recurring event, or an edited one-off. The response for an unedited instance of a recurring event and an edited instance are more-or-less the same, save the description field, which was edited.
The reason I need to differentiate edited versus unedited recurring event instances is that I am dynamically creating event detail pages from the list of single events. I would like to have one page be for the recurring event itself, and another for a "one-off" of that recurring event. E.g:
allmyevents.com/events/my-recurring-event --> page showing recurring event with recurrence information
allmyevents.com/events/my-recurring-event/16-4-2020 --> page showing specific instance of recurring event, which has been edited
Currently, I'm able to do this by creating an entirely new event at the same date and with the same title as the recurring event instance I want to replace, and writing hacky comparison logic to tell if this is a replacement event, but this is counter-intuitive for event/content management.
Answer:
You can use the Calendar API Events: instances endpoint to return all instances of a recurring event. All the events which have been edited on their own will not be returned.
More Information:
The Events: instances endpoint of the Calendar API will return all instances of a recurring event for a calendarId and eventId specified. Any of these that have been edited are omitted.
It's a bit of a workaround, as these events can't be obtained directly, but by obtaining the list of events as you have already been doing and then removing the events which are returned by Events: instances, you can build a list of all the events which have been edited with the 'Only this event' option.
Psuedo-code:
You can do something like this:
eventsList = Calendar.Events.List(calendarId, singleEvents=true)
eventsInstances = Calendar.Events.Instances(calendarId, recurringEventId)
singleEvents = eventsList
for each instance in eventsInstances :
if eventsList.items contains instance :
singleEvents.remove(instance)
return singleEvents
Where the returned singleEvents variable will be a list of all the events that have been edited manually.
References:
Events: instances | Calendar API | Google Developers
Recurring Events | Calendar API | Google Developers
I've been puzzling through this same issue, and I think I've found a way forward that doesn't involve going through every single instance to check if they've been moved/edited:
Each event returned by the Calendar API has an iCalUID field. For a standalone event, this should match the event's id, with an #google.com suffix. e.g. an event with the id of abcdef has an iCalUID of abcdef#google.com.
When it comes to recurring series, every single instance of that event has the same iCalUID value - and, most importantly, you can use iCalUID as a filter when listing events, which will return the main recurring series event and all modified instances. Unmodified instances are not returned.
Tracking which instances have been deleted is slightly more fiddly. They might be returned in the list with the matching iCalUID, but with a status set to cancelled. Or, they may be specified within the recurrence property (an array of strings) on the main series event as timestamps (within the given time-zone, which should match whichever time-zone the main series event uses):
[
"RRULE:FREQ=WEEKLY,COUNT=5",
"EXDATE;TZID=Australia/Melbourne:20211227T110000,20220103T110000"
]
I haven't figured out why some recurring events use the specific-instances-as-cancelled approach, and others use the EXDATE approach (and I think they can also be combined, so don't presume the presence of one rules out the other). Given both are possible, you'll have to allow for that.

Excel to CI PeopleCode Usage

I am trying to get a better understanding how how a Excel to Component Interface definition uses Component and/or Record PeopleCode to execute business logic/validations.
If I open a Component definition (that my Component Interface (CI) uses) and click on the Structure tab I have a list of all the records and fields in the component. I can expand a record and right click on a specific field and it brings up a "Component PeopleCode" editor window. I've noticed that for a specific field on a record, the Component PeopleCode does not have any code in it, however the actual Record PeopleCode does has PeopleCode for the same field. My question is when the Excel to CI runs, does it execute the PeopleCode only associated to the Component, and/or the Record PeopleCode? Here are a couple screenshots to illustrate the above:
Record PeopleCode for field ITM_STATUS_FUTURE (has code):
Component PeopleCode for same Record/field ITM_STATUS_FUTURE:
I'd like to know whether the CI will execute both the Component and Record Peoplecode above. Thanks in advance.
The Component Interface will execute both the Record PeopleCode and the Component Record PeopleCode. You can find more information in the PeopleCode Developer's Guide, PeopleCode and the Component Processor section.
The ordering is that it processes by record, and for each record, it processes record PeopleCode and then component PeopleCode.

Input data on Table OnCreate

Please what the best way to solve this problem
I have a form to insert data on model_request.
(I have other model: model_approver with Type Of Expense, Approver)
I need that when onCreate event from model_request one other field receive information from model_approver.
Example:
An user will be create a request and choose a type of expense (Field from model_approver) via dropdown after this when submit , the field ResponsabileApprover [from model_request] receive Approver [from model_approver].
Dropdowns was working fine
Thanks for clarifications
Call server script with all necessary date from client (https://developers.google.com/appmaker/scripting/client#call_a_server_script), and create item on the server side,
onCreate event is useful to set some default values (date_created) or validate input data to prohibit creating a new record in a model

How can I overwrite/control the default lookup on a form's super() call for a lookup?

Specifically \Forms\SalesCreateOrder\Data Sources\SalesTable\Fields\CustAccount\lookup
Where does the super() call go to? What determines the fields that are populated with this?
The EDT is CustAccount, and I don't see a "FormHelp".
The super() calls the performDBLookup method of the control, which creates the lookup form .
You can read all about it on Axaptapedia.
Axapta uses a simple system to determine which fields to display in an automatically created lookup.
If no special changes are made, then the fields shown on the lookup are determined by the following information from the base table:
The field(s) responsible for the relation
TitleField1
TitleField2
The first field of every index of the table (in the order of the index-id)

Orbeon xforms: Is there a way to force constraint validation of fields populated by an action?

I have several fields on an Orbeon xform that are populated by a database service and action. There are constraints on these fields (example field must be equal to zero). When the action is triggered by activation of a button, data is populated in these fields from the database service.
I get the constraint error message at the bottom, but the field does not highlight after the action is triggered. If I enter and exit the field, then the field is highlighted.
I can understand that this behavior makes sense when you are expecting the use to fill out every field on the form. But some fields may be automatically populated or calculated.
Is there a way to force validation of the constraint without having the user enter the field? Actually, what it seems the user must do is enter the field and then enter another field to get this highlight to appear.
I have tried including the value of another field in the constraint. This works for Read-Only and Visibility validations. When the value of the other field changes, these validations are re-evaluated. But Constraint does not seem to be re-evaluated or at least the method that generates the field highlight is not re-evaluated.
(I assume that this is related to a form you created with Form Builder.)
Controls are revalidated when a service is called, but the error indicator, both next to the field and in the error summary, only shows after users visited the field. You can programmatically tell the error summary to consider all the controls visited by sending a fr-visit-all, doing a refresh, and sending a fr-update. (Let me know if you're having any trouble using this in Form Builder, and I can add some more information about this to this response.)

Resources