Playlist Header validations

The Playlist Header data fields are as follows:

  • No.: This is the ID number for this instance of a radio show; its contents are user defined
  • Radio Show No.: This is selected from the Radio Show table
  • Description: This is displayed by means of a FlowField from the Radio Show table
  • Broadcast Date: This is the show's scheduled broadcast date; it also serves as the Posting Date for any data analysis filtering
  • Start Time: This show's scheduled broadcast start time
  • End Time: This show's scheduled broadcast end time
  • Duration: This show's broadcast length, displayed by means of a FlowField from the Radio Show table
  • PSAs Required and Ads Required: These show if PSAs and Ads are required for broadcast during the show; they are copied from the Radio Show table, but are editable by the user
  • News Required, Sports Required, and Weather Required: This checks whether or not each of these program segments are required during the show; they are copied from the Radio Show table, but are editable by the user

When the user chooses the Radio Show to be scheduled, we want the five different feature requirements fields in the Playlist Header to be filled in by C/AL logic, as shown in the following screenshot:

Even though the Radio Show No. was entered in the data field, our validation code needs to read the Radio Show record (here, defined as the Global variable RadioShow). Once we have read the Radio Show record, we can assign all five show feature requirements fields from the Radio Show record into the Playlist Header record.

Then, because two fields in the Playlist Header record are Lookup FlowFields, we need to Update the page after the entry of the Radio Show No. The Update is done through a CurrPage.UPDATE command, as shown in the following screenshot:

The next Validation we need is to calculate the show End Time as soon as the Start Time is entered. The calculation is simple: add the length of the show to the Start Time. We have defined the Duration field in the Playlist Header to be a Lookup reference to the source field in the Radio Show record. As a result, to calculate with that field would require using a CALCFIELDS function first, Instead, we'll obtain the show length from the Radio Show record:

Now, we see we have one of those situations we sometimes encounter when developing a modification. It might have been better to have the Playlist Header Duration field be a Normal data field rather than a FlowField. If this is the only place where we will use Duration from the Playlist Header for calculation or assignment, then the current design is fine. Otherwise, perhaps, we should change the Duration field to a Normal field and assign Run Time from Radio Show to it at the same time the several requirements fields are assigned. At this point though, for the purposes of our WDTU scenario, we will stick with what we have already created.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.30.19