python-fmrest
python-fmrest copied to clipboard
edit_record() returning Filemaker Error 101, though the record is accessible by using find()
I am having trouble updating a records.
For almost all record numbers this code cooperates but occasionally it yields a "Filemaker Error Code 101 - Record Is Missing":
server = fmrest.Server(url=self.url,
user=user_name,
password=some_password,
database='UCPPC',
layout='rfilog_raw_table',
api_version='v1')
server.login()
server.edit_record(record_id=20818, field_data={'Answer': 'blah blah blah', 'Answer Date': '11/07/2021'})
...despite the fact that doing this gets the records object as expected:
server = fmrest.Server(url=self.url,
user=user_name,
password=some_password,
database='UCPPC',
layout='rfilog_raw_table',
api_version='v1')
server.login()
rec = server.get(20818)
...but then I am unaware of how one might update the record object for fields/attributes that cannot be attributes (eg 'Answer Date' field.)
This is for Filemaker Server 19. The python code is Python 3.9.11 on Windows 10. python-fmrest Ver 1.6.0
Any thoughts on resolving this would be appreciated.
Some discussion about this issue here: https://www.briandunning.com/errors/96
I should clarify that the script uses edit_record dozens of times sucessfully before getting hung up on this one record.
This is the values used when making the call:
- url --> https://pp-dev-fm.ad.ucsc.edu//fmi/data/v1/databases/UCPPC/layouts/rfilog_raw_table/records/20818
- request_data --> {"fieldData": {"Answer": "MKA Response by AWW 7/15/21: A23 clips shall only be used at the clerestory window assembly. Contractor to provide\nangles as shown in 5/A-619. \n\nSGA Response:\nSee response provided by MKA.\nDS SGA 2021 07 15", "Architect Sent": "07/15/2021"}}
- method --> PATCH
- self.proxies --> None
- self.verify_ssl --> False
- self._headers --> {'Content-Type': 'application/json', 'Authorization': 'Bearer 938e97e1f9ccd3e6b59a771b7fe5e876dbde41623b16de589a3'}
- params --> None
- kwargs --> {}
Call results: response.json() --> {'messages': [{'code': '101', 'message': 'Record is missing'}], 'response': {}}