gearbox-solutions / eloquent-filemaker

A Model extension and Eloquent driver for Laravel connecting to FileMaker through the Data API
https://gearboxgo.com
MIT License
55 stars 16 forks source link

How to get RecordID in controller #10

Closed mudassirali007 closed 2 years ago

mudassirali007 commented 2 years ago

I am getting fieldData but not recordID, How to handle that? and How to get portalData? JSON: { "fieldData": { "Availability": "In stock", "UnitsOnHand": 5, "PartNumber": "KBB0001", "Name": "Rapid Pro 4.0 Kookaburra bat", "Image": "https://server/Streaming_SSL/MainDB/24ED3901CB59406D35E32978767B1C0D14C30384B0E92864657B4215383F7829.jpg?RCType=EmbeddedRCFileProcessor", "ProductID": "C8AABED0-0C92-43DD-8DD2-8FD9F31FE8C1" }, "portalData": { "Inventory Transactions": [ { "recordId": "1" }, { "recordId": "2" } ] }, "recordId": "1", "modId": "12" }

image

Smef commented 2 years ago

You can get the internal FileMaker Record ID using the $myModelObject->getRecordId() method. It's not in the lower section you have boxed here because it is not an attribute stored in a field in your FileMaker record.

I think you shouldn't need the internal FileMaker record ID value too often if you're using an eloquent model, so be sure this is the value you're looking for.

The internal FileMaker Record ID is NOT your primary key for your record, and is only used for raw FileMaker Data API requests which require an internal Record ID or the base query methods with the FM facade.

Portal data can be read and edited by following the instructions in the documentation at https://github.com/BlueFeatherGroup/eloquent-filemaker#portal-data

mudassirali007 commented 2 years ago

Thanks