This topic is locked

Excel Import Issue in 8.1

7/19/2016 12:06:32 PM
PHPRunner General questions
A
Abul author

If I want to have autoinsert $_SESSION["UserID"] into a field of a Table Field called "UserID" then I have to use Before Record Added/Updated events on both Add/Edid page. This works fine if I use GUI to add/edit records. But if I like to import records from Excel file then only the event "Before Insert Record" on Import Page does not work. I have to select the field "UserID" from the table both in Import Preview page in application as well as Project Field Setup steps to fireup this event in Import Excel functionality. Otherwise no records are imported successfully. This was not necessary in 7.1.
Is it something needs to be addressed? Because, UserID field we need to capture User's ID in background process without user's knowledge.

Sergey Kornilov admin 7/19/2016

You need to use BeforeInsert event for this purpose:

http://xlinesoft.com/phprunner/docs/before_insert_record.htm
Sample code:

$values["UserID"]=$_SESSION["UserID"];
A
Abul author 7/19/2016



You need to use BeforeInsert event for this purpose:

http://xlinesoft.com/phprunner/docs/before_insert_record.htm
Sample code:

$values["UserID"]=$_SESSION["UserID"];



Thanks Admin! I totally agree with you and it should be as it happened in 7.1. I followed this logic in 8.1 too, with no result. Unless I select "UserID" field for Import Page at Field Setup step in project building as well as select this field on the Import Preview Page step in Application running before Import, this event does not fireup to capture $_SESSION["UserID"]. In this way user can know that the application is capturing their ID in background. I don't want user to know from front end that application is capturing their ID in background.

lefty 7/19/2016



Thanks Admin! I totally agree with you and it should be as it happened in 7.1. I followed this logic in 8.1 too, with no result. Unless I select "UserID" field for Import Page at Field Setup step in project building as well as select this field on the Import Preview Page step in Application running before Import, this event does not fireup to capture $_SESSION["UserID"]. In this way user can know that the application is capturing their ID in background. I don't want user to know from front end that application is capturing their ID in background.


Do you use dynamic permissions? If so setup audit log in the security settings to log any modifications for your table. Then you can just look at the user log to see the date and who made a modification on your table. maybe not what your looking for , but I have used to see modifications and login time and date to identify user.

Sergey Kornilov admin 7/19/2016

Not sure what else I can say without seeing the project and data. If you have a support contract post your project to Demo Account and contact support directly.

A
Abul author 7/19/2016



Not sure what else I can say without seeing the project and data. If you have a support contract post your project to Demo Account and contact support directly.


Thanks Admin. I have seen the Import Log file in template_c folder and see this comment:

Import into data

7/20/2016 2:35:54 AM
0 out of 1 records processed successfully.

0 records added.

0 records updated.

1 records processed with errors:
Column count doesn't match value count at row 1

"","90","90","70","012345","2016-07-20 02:35:54"


It seems my $_SESSION["UserID"] = "012345" and $_SESSION=now() have been captured in temp file but failed to insert into db table rather throw error. I have put both $_SESSION in Before Insert Record event on Import page. I have selected all 6 fields in project field setup but Mapped only first 4 columns in Import Preview page. Any clue? Thanks in advance.
I also try to use tip from forum

http://www.asprunner.com/forums/topic/23966-get-names-labels-of-imported-columns/



in this regard. But I could not understand the logic in this tip. Probably this tip has some point for me.