This topic is locked
[SOLVED]

 Can Calendar Edit Insert or Update be modified?

2/27/2014 7:24:19 AM
Calendar Template general questions
A
Anapolis author

I have added 2 fields to the calcalendar table to adapt it so it can be used in an existing project.
When the Calendar is edited to change an existing appointment the User winds up working with the caldaily_edit.php page.
The calcalendar table now saves the account number (kdnr field) from the pharmacy where the appointment will take place.
For the application office administrator and for the trainer who makes an appointment

I wanted to pull extra information from the master pharmacy table so that the User could confirm and have visual access to such things as a phone number or email, etc. To do this I had to alter the caldaily Custom View already in the Calendar application.
The SQL for "caldaily" view now looks like this:
SELECT

calcalendar.id,

calcalendar.DateField,

calcalendar.Description,

calcalendar.Theme,

calcalendar.TimeField,

calcalendar.EndTime,

calcalendar.DayEvent,

calcalendar.EndDate,

calcalendar.Period,

calcalendar.Recurrence,

calcalendar.Category,

calcalendar.OwnerID,

calcalendar.kdnr,

calcalendar.trainerid,
//here I added the pharmacy table to pick up the record in the calcalendar where the fields "kdnr" match
alesapo.kdnr AS kdnr1,

alesapo.kunde,

alesapo.inhaber,

alesapo.strasse,

alesapo.land,

alesapo.plz,

alesapo.ort,

alesapo.ad,

alesapo.kdgruppe,

alesapo.kategorie,

alesapo.telefon,

alesapo.fax,

alesapo.email,

alesapo.internet,

alesapo.pkategorie,

alesapo.dezil

FROM calcalendar

INNER JOIN alesapo ON calcalendar.kdnr = alesapo.kdnr
and in the Editor I have This:


which results in this view in a browser:


Big Question:
Is there a way by using PHPRunner 7.1 settings to ONLY SHOW fields from the linked pharmacy table that are simply VIEWS only.

I want the user to see data from the linked table but I don't want those extra fields to be included in the INSERT or UPDATE query pointed at the calcalendar table.
So that when the record is modified in the existing Calendar fields that the SAVE action does NOT fail because it has now included the Pharmacy table fields in the INSERT or UPDATE to the master "calcalendar" table?
In other words I must change the underlying Query for Editing this record in the calcalendar table so that it does NOT INCLUDE the extra Custom View fields from the Pharmacy table.
If PHPRunner 7.1 cannot do this with native functions does it require a script to override the SAVE and UPDATE Records in the Events to use just the calcalendar fields with a revised custom query?
Thank you for your help.

A
Anapolis author 2/27/2014

I have solved this problem. I have created an Events using the getCurrentRecord() function--