{"record":{"id":"6c3c03799a43a9fb","repo":"twentyhq/twenty","slug":"field-fieldname-not-found-on-object-object","errorCode":null,"errorMessage":"Field \"${fieldName}\" not found on object \"${objectName}\" after ${page} page(s). Last-page fields: ${names}","messagePattern":"Field \"(.+?)\" not found on object \"(.+?)\" after (.+?) page\\(s\\)\\. Last-page fields: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/twenty-apps/internal/twenty-partners/src/scripts/configure-partner-rls.ts","lineNumber":199,"sourceCode":"\n    const match = data.object.fields.edges.find(\n      (e) => e.node.name === fieldName,\n    );\n\n    if (match) {\n      console.log(\n        `  [rls:configure] ${objectName}.${fieldName} found on page ${page} ` +\n          `(type=${match.node.type}, id=${match.node.id})`,\n      );\n      return match.node.id;\n    }\n\n    if (!data.object.fields.pageInfo.hasNextPage) {\n      // Print available fields to help diagnose a schema mismatch.\n      const names = data.object.fields.edges\n        .map((e) => e.node.name)\n        .join(', ');\n      throw new Error(\n        `Field \"${fieldName}\" not found on object \"${objectName}\" after ${page} page(s). ` +\n          `Last-page fields: ${names}`,\n      );\n    }\n\n    after = data.object.fields.pageInfo.endCursor;\n  }\n}\n\n// Collects every field on an object across all cursor pages.\n// Required for Opportunity which can grow; always paginate fully.\nasync function collectAllFields(\n  metadataUrl: string,\n  apiKey: string,\n  objectId: string,\n): Promise<{ id: string; name: string; type: string }[]> {\n  const all: { id: string; name: string; type: string }[] = [];\n  let after: string | null = null;","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/twentyhq/twenty/blob/1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6/packages/twenty-apps/internal/twenty-partners/src/scripts/configure-partner-rls.ts#L181-L217","documentation":"findFieldByName in configure-partner-rls paginates an object's fields via cursor-based pagination and throws if the target field (e.g. partnerUser, isListed) is absent after exhausting all pages. The error lists the last page's field names to help diagnose a schema mismatch. It exists because large objects (company, opportunity) exceed the 200-cap single request, so a naive single fetch would miss fields.","triggerScenarios":"After walking every page of object.fields for the given objectName, no edge has node.name === fieldName. Causes: the app field (e.g. partnerUser on Person) was never created because the app isn't fully installed/synced; the field was renamed or removed; querying the wrong object; metadata not refreshed after a manifest field change.","commonSituations":"Running rls:configure before the app finished syncing its fields; a manifest change added/renamed a field but metadata wasn't re-synced; pointing at a workspace where a different version of the app is installed.","solutions":["Re-install/re-sync the app so its declared fields (partnerUser, isListed, etc.) land in metadata.","Compare the printed 'Last-page fields' list against the expected field name to catch a rename.","Confirm the objectName is correct and the field belongs to that object in the manifest.","Re-run rls:configure after sync completes (it is idempotent)."],"exampleFix":"// before\nthrow new Error(`Field \"${fieldName}\" not found on object \"${objectName}\" after ${page} page(s). Last-page fields: ${names}`);\n\n// after — also print the total field count and suggest re-sync\nthrow new Error(\n  `Field \"${fieldName}\" not found on object \"${objectName}\" after ${page} page(s). ` +\n  `Last-page fields: ${names}. Re-install/re-sync the app then re-run rls:configure.`,\n);","handlingStrategy":"validation","validationCode":"// Before running rls:configure, confirm the app's declared fields exist.\n// (Equivalently: ensure the app is installed and a metadata sync has completed.)\n// The script itself is the validator; to pre-empt it, run an install/sync first.\nconst installed = await isAppInstalledAndSynced(workspace);\nif (!installed) {\n  throw new Error('Install and sync the partners app before running rls:configure');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install and fully sync the app before running rls:configure so all declared fields exist.","Re-run rls:configure after any manifest field change (idempotent).","When the error fires, compare the printed 'Last-page fields' to the expected field name to catch renames.","Confirm the field belongs to the named object in the manifest."],"tags":["metadata","schema","config","rls","partners"],"backgroundTag":null,"analyzedSha":"1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6","analyzedAt":"2026-08-12T15:37:27.593Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}