const jsforce = require('jsforce'); async function findProperties() { try { console.log('šŸ” Finding the 23 Properties from Interface...'); const conn = new jsforce.Connection({ loginUrl: 'https://test.salesforce.com' }); await conn.login('contact+tso3@propertycrm.ae.r1', 'Demo@123'); console.log('āœ… Login successful!'); // From the screenshot, I can see the URL shows: pcrm__Property__c // This suggests the object has a namespace: pcrm__ console.log('\nšŸ” Checking for Namespaced Property Object...'); // Try different possible object names const possibleNames = [ 'Property__c', 'pcrm__Property__c', 'Property', 'pcrm__Property' ]; for (const objectName of possibleNames) { console.log(`\nšŸ“Š Trying object: ${objectName}`); try { // Try to describe the object const describeResult = await conn.sobject(objectName).describe(); console.log(`āœ… ${objectName} describe successful`); console.log('Total fields:', describeResult.fields.length); console.log('Fields:', describeResult.fields.map(f => f.name).join(', ')); // Try to query records const query = `SELECT Id, Name FROM ${objectName} LIMIT 5`; console.log('Query:', query); const result = await conn.query(query); console.log(`Properties found in ${objectName}:`, result.totalSize); if (result.totalSize > 0) { console.log('\nšŸ“‹ Property Data:'); result.records.forEach((prop, i) => { console.log(`${i+1}. ${prop.Name} (ID: ${prop.Id})`); }); // If we found properties, let's get more details if (result.totalSize >= 5) { console.log('\nšŸ“Š Fetching More Properties...'); const moreProps = await conn.query(`SELECT Id, Name FROM ${objectName} LIMIT 23`); console.log('Total properties found:', moreProps.totalSize); if (moreProps.totalSize > 0) { console.log('\nšŸ“‹ All Properties:'); moreProps.records.forEach((prop, i) => { console.log(`${i+1}. ${prop.Name} (ID: ${prop.Id})`); }); } } console.log(`\nšŸŽ‰ SUCCESS! Found properties in ${objectName}`); break; } else { console.log(`No properties found in ${objectName}`); } } catch (error) { console.log(`āŒ ${objectName} failed:`, error.message); } } // Also check if there are any custom objects with "Property" in the name console.log('\nšŸ” Checking for Custom Objects with "Property" in name...'); try { const customObjects = await conn.query('SELECT Id, Name, DeveloperName, NamespacePrefix FROM CustomObject WHERE DeveloperName LIKE \'%Property%\''); console.log('Custom objects with "Property" found:', customObjects.totalSize); if (customObjects.totalSize > 0) { customObjects.records.forEach(obj => { console.log(`- ${obj.Name} (${obj.DeveloperName}) - Namespace: ${obj.NamespacePrefix || 'None'}`); }); } } catch (customObjError) { console.log('āŒ Custom objects query failed:', customObjError.message); } // Check if there are any objects with "Property" in the label console.log('\nšŸ” Checking for Objects with "Property" in label...'); try { const allObjects = await conn.query('SELECT Id, Name, DeveloperName, NamespacePrefix FROM CustomObject'); console.log('Total custom objects:', allObjects.totalSize); const propertyObjects = allObjects.records.filter(obj => obj.Name.toLowerCase().includes('property') || obj.DeveloperName.toLowerCase().includes('property') ); if (propertyObjects.length > 0) { console.log('Objects with "Property" in name/label:'); propertyObjects.forEach(obj => { console.log(`- ${obj.Name} (${obj.DeveloperName}) - Namespace: ${obj.NamespacePrefix || 'None'}`); }); } } catch (allObjError) { console.log('āŒ All objects query failed:', allObjError.message); } console.log('\nšŸ” ANALYSIS:'); console.log('From the screenshot, we can see 23 Property records in the interface.'); console.log('We need to find the correct object name to access them via SOQL.'); console.log('The URL suggests it might be: pcrm__Property__c'); } catch (error) { console.error('āŒ Error:', error.message); } } findProperties();