This topic is locked

copy value from one to another, with a twist.

1/29/2009 10:25:09 AM
PHPRunner General questions
W
wildwally author

I have a table that has values entered after the record has been added. Using the insert into table feature. I was able to even get the ID number from the page using $key (pretty cool stuff). Now I need to know how to inset a value not from any tables. I want each ticket created (insert) to start with the status being "Open". Would it be $Value["Status"] = "Open", need some insight on this.

G
garethpDevClub member 1/29/2009

Hi
You are close!
I know of a couple of easy options to do this...

  1. include the field status on the add page as a read only and default the value to "OPEN" - do this in visual editor by double clicking the field to open properties.
    or
  2. if you do not want the field showing on the add page then add the event "before record added" and put the custom code
    $values["status"]="OPEN";

    return true;
    must include the return true for record to be added.
    Hope this helps and is what you were asking.
    Gareth

T
thesofa 1/29/2009

Maybe even easier make the default value in the MYSQL table to be "Open"

W
wildwally author 1/29/2009

I appreciate your help, and will give your suggestions a try. Only a portion of the information from table A is being passed along to table b, and then I have a couple new fields being added to the Table b. The status just happens to be one of the new fields that I want defaulted to "Open".
Now I seeking suggestions on the best approach to handle this next task. I have table b that contains multiple fields about a job, and one of them fields is the status of the job. I want two buttons or links that say Complete or Hold. When the user pushes the hold button a couple of things happen. First the job status changes to "Holding", then the a date box of the hold is populated and a reason (all fields within table <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=37281&image=1&table=forumreplies' class='bbc_emoticon' alt='B)' />. then some how switch it back at a later date with the job status changing back to "Open". The complete button of course does what it says changes the status to complete and logs the date and couple other fields.
Any suggestion on the buttons and making this work with as little work as possible, would be greatly appreciated.