未找到 FileMaker PHP API newEditCommand()..?
FileMaker PHP API newEditCommand() not found..?
这是我正在使用的...
$FindInvoiceRecord = $FMInvoices->newFindCommand('Data Entry (XGA)');
$FindInvoiceRecord->addFindCriterion('InvoiceNumber', $InvoiceNumber);
$FindInvoiceRecord->setScript('wa_CommitRecord');
$FindInvoiceRecordResult = $FindInvoiceRecord->execute();
$FoundRecords = $FindInvoiceRecordResult->getRecords();
$FMInvoiceRecordID = $FoundRecords[0]->getField('zRecordID');
$OriginalInvoiceNotes = $FoundRecords[0]->getField('InternalNotes');
这工作正常并按预期从 FileMaker 记录加载我的数据。然后我正在尝试更新记录...
$InvoiceUpdateData = array('InternalNotes' => $NewInvoiceNotes);
$InvoiceUpdateRecord = $FoundRecords[0]->newEditCommand('Data Entry (XGA)', $FMInvoiceRecordID, $InvoiceUpdateData);
$InvoiceUpdateRecordResult = $InvoiceUpdateRecord->execute();
但这告诉我找不到 newEditCommand() 方法..??任何关于我在这里做错了什么的信息将不胜感激。谢谢!
newEditCommand 是记录对象中的方法,而不是结果对象中的方法。
试试这个:
$InvoiceUpdateRecord = $FMInvoices->newEditCommand('Data Entry (XGA)', $FMInvoiceRecordID, $InvoiceUpdateData);
这是我正在使用的...
$FindInvoiceRecord = $FMInvoices->newFindCommand('Data Entry (XGA)');
$FindInvoiceRecord->addFindCriterion('InvoiceNumber', $InvoiceNumber);
$FindInvoiceRecord->setScript('wa_CommitRecord');
$FindInvoiceRecordResult = $FindInvoiceRecord->execute();
$FoundRecords = $FindInvoiceRecordResult->getRecords();
$FMInvoiceRecordID = $FoundRecords[0]->getField('zRecordID');
$OriginalInvoiceNotes = $FoundRecords[0]->getField('InternalNotes');
这工作正常并按预期从 FileMaker 记录加载我的数据。然后我正在尝试更新记录...
$InvoiceUpdateData = array('InternalNotes' => $NewInvoiceNotes);
$InvoiceUpdateRecord = $FoundRecords[0]->newEditCommand('Data Entry (XGA)', $FMInvoiceRecordID, $InvoiceUpdateData);
$InvoiceUpdateRecordResult = $InvoiceUpdateRecord->execute();
但这告诉我找不到 newEditCommand() 方法..??任何关于我在这里做错了什么的信息将不胜感激。谢谢!
newEditCommand 是记录对象中的方法,而不是结果对象中的方法。 试试这个:
$InvoiceUpdateRecord = $FMInvoices->newEditCommand('Data Entry (XGA)', $FMInvoiceRecordID, $InvoiceUpdateData);