23. Juli 2015 14:22
//LOOP
CustomerFilter := CustomerFilter.Customers_Filter();
CustomerFilter.Field := ?????????? ;
CustomerFilter.Criteria := 'ZK*';
MyCustomerList := CustomerService.ReadMultiple(CustomerFilter,'',100);
FOR i := 0 TO MyCustomerList.Length() -1 DO BEGIN
Customer := MyCustomerList.GetValue(i);
MESSAGE('Looping Customers: %1 %2', Customer.No, Customer.Name);
END;
23. Juli 2015 14:54
case 'listEmployeeAbsenceEntries': //listet alle vorhandenen Abwesenheitseinträge des MA auf (Employee Holiday Absence)
$i = 0;
$return_arr = array();
$return_arr['aaData'] = array(); //array which contains data for each column and row
$return_arr['sEcho'] = $_REQUEST['sEcho']; //just ping back the value that the client has send
$filterarray[] = array('Field' => 'Employee_No', 'Criteria' => $_REQUEST['pEmployee']);
if ($debug) print_r($filterarray);
$paramsAsArray = array('filter' => $filterarray, 'setSize' => 0);
$Obj = $ws->__Action('ReadMultiple', rawurlencode($_REQUEST['pCompany']).'/Page/EmployeeHolidayAbsWS', $paramsAsArray);
if ($debug) print_r($Obj);
if (!empty($Obj->ReadMultiple_Result->EmployeeHolidayAbsWS)) {
$resultarray = array();
// single row result is object, multi row result is array !
if (!is_array($Obj->ReadMultiple_Result->EmployeeHolidayAbsWS)) {
array_push($resultarray, $Obj->ReadMultiple_Result->EmployeeHolidayAbsWS);
} else $resultarray = $Obj->ReadMultiple_Result->EmployeeHolidayAbsWS;
foreach ($resultarray as $obj_) {
$list[] = get_object_vars($obj_);
//row order must match table order from html doc!
$row = array();
$row['entry'] = $list[$i]['Entry_No'];
//Datum erfasst - 01.01.1970 in -nicht bekannt- umwandeln
if ($list[$i]['Created_WS'] == '0001-01-01') {
$row['created'] = 'über NAV';
} else {
$row['created'] = date( 'd.m.y', strtotime($list[$i]['Created_WS']));
}
$row['employee'] = $list[$i]['Employee_No'];
$row['begin'] = date( 'd.m.y', strtotime($list[$i]['From_Date']));
$row['end'] = date( 'd.m.y', strtotime($list[$i]['To_Date']));
$row['cause'] = $list[$i]['CauseOfAbsence'];
$row['quantity'] = $list[$i]['Quantity'];
$row['description'] = $list[$i]['Description'];
$row['status'] = $list[$i]['Status'];
array_push($return_arr['aaData'],$row);
$i++;
}
}
$return_arr['iTotalRecords'] = $i; //number of records total
$return_arr['iTotalDisplayRecords'] = $i; //if pagination, number of visible records
break;
23. Juli 2015 15:13
JoergR hat geschrieben:Bei ReadMultiple erwartet der WS einen Array an Filtern "Feldname" => "Wert".
In PHP schaut das so aus