Import New Data ihRIS

Asked by Ajhar

I am using import_chw.php to imort excel data to database. It works for most of the fields but for some it is not getting mapping data to object

for example:
$confObj = $this->ff->createContainer('confirmation');
        $confObj->getField("parent")->setValue($this->person_id);
        $confObj->getField("date")->setValue($this->format_date($this->mapped_data["date"]));

in above code new row creates in table and parent column get update wit the value but not date column. But date is mapped from excel file

Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
iHRIS Manage Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Gerard Bisama (gerbis2000) said :
#1

Hi,

Of course there is a need to pay attention on date format. This standard
y/m/d should be converted to I2CE_Date type to be able to solve it in DB.
Please see the exemple in this link to see how to record date:
https://bazaar.launchpad.net/~gerbis2000/ihris-ebola-rdc/trunk/view/head:/tools/update_person_mission.php
Cheers,

Le mar. 9 oct. 2018 à 13:43, Ajhar <email address hidden> a
écrit :

> New question #674903 on iHRIS Manage:
> https://answers.launchpad.net/ihris-manage/+question/674903
>
> I am using import_chw.php to imort excel data to database. It works for
> most of the fields but for some it is not getting mapping data to object
>
> for example:
> $confObj = $this->ff->createContainer('confirmation');
> $confObj->getField("parent")->setValue($this->person_id);
>
> $confObj->getField("date")->setValue($this->format_date($this->mapped_data["date"]));
>
> in above code new row creates in table and parent column get update wit
> the value but not date column. But date is mapped from excel file
>
> Thanks
>
> --
> You received this question notification because your team iHRIS Answers
> is an answer contact for iHRIS Manage.
>

--
Gérard Bisama
Tel:+243810890810

Revision history for this message
Ajhar (mohamedajhar) said :
#2

Ok Thank you very much for this and I have sorted out this and I have one more last issue.

$benObj->getField("amount")->setValue(trim($this->mapped_data["amount"]));

All other fields working only the above amount part. amount is mapped in mapped data

Thanks

Revision history for this message
Gerard Bisama (gerbis2000) said :
#3

Hi,
if amount refers to a mapped form. Use this synthax
$benObj->getField("amount")->setValue(array('formname',trim($this->mapped_data["amount"])));
When formname is the formname to which the amount is mapped and amount is
the id that refers to the amount mapped.

Thanks

Le mer. 10 oct. 2018 à 06:57, Ajhar <email address hidden>
a écrit :

> Question #674903 on iHRIS Manage changed:
> https://answers.launchpad.net/ihris-manage/+question/674903
>
> Status: Answered => Open
>
> Ajhar is still having a problem:
> Ok Thank you very much for this and I have sorted out this and I have
> one more last issue.
>
> $benObj->getField("amount")->setValue(trim($this->mapped_data["amount"]));
>
> All other fields working only the above amount part. amount is mapped
> in mapped data
>
> Thanks
>
> --
> You received this question notification because your team iHRIS Answers
> is an answer contact for iHRIS Manage.
>

--
Gérard Bisama
Tel:+243810890810

Can you help with this problem?

Provide an answer of your own, or ask Ajhar for more information if necessary.

To post a message you must log in.