VS Code cant import custom objects from salesforce - salesforce

I'm trying to create a custom form to insert a record for Student but I have a problem, VS or there is maybe something else, cant see my custom object named Student
import STUDENT_OBJECT from '#salesforce/schema/Student';
import FIRST_NAME from '#salesforce/schema/Student.Firstname';
import LAST_NAME_FIELD from '#salesforce/schema/Student.Lastname';
import EMAIL_FIELD from '#salesforce/schema/Student.Email';
import PHONE_FIELD from '#salesforce/schema/Student.Phone';
import ADDRESS_FIELD from '#salesforce/schema/Student.Address';
First line, when I change to Account VS code suggest me a fields, but with Student it seems like VS code doesnt see custom object.
And errors when I try to deploy lwc:
Invalid reference Student.Firstname of type sobjectClass in file createStudent.js
Invalid reference Student of type sobjectClass in file createStudent.js
Invalid reference Student.Address of type sobjectClass in file createStudent.js
Invalid reference Student.Lastname of type sobjectClass in file createStudent.js
Invalid reference Student.Phone of type sobjectClass in file createStudent.js
Invalid reference Student.Email of type sobjectClass in file createStudent.js
Invalid reference Student.Firstname of type sobjectClass in file createStudent.js
Invalid reference Student of type sobjectClass in file createStudent.js
Invalid reference Student.Address of type sobjectClass in file createStudent.js
Invalid reference Student.Lastname of type sobjectClass in file createStudent.js
Invalid reference Student.Phone of type sobjectClass in file createStudent.js
Invalid reference Student.Email of type sobjectClass in file createStudent.js
Invalid reference Student.Firstname of type sobjectClass in file createStudent.js
Invalid reference Student of type sobjectClass in file createStudent.js
Invalid reference Student.Address of type sobjectClass in file createStudent.js
Invalid reference Student.Lastname of type sobjectClass in file createStudent.js
Invalid reference Student.Phone of type sobjectClass in file createStudent.js
Invalid reference Student.Email of type sobjectClass in file createStudent.js
Invalid reference Student.Firstname of type sobjectClass in file createStudent.js
Invalid reference Student of type sobjectClass in file createStudent.js
Invalid reference Student.Address of type sobjectClass in file createStudent.js
Invalid reference Student.Lastname of type sobjectClass in file createStudent.js
Invalid reference Student.Phone of type sobjectClass in file createStudent.js
Invalid reference Student.Email of type sobjectClass in file createStudent.js
Invalid reference Student.Firstname of type sobjectClass in file createStudent.js
Invalid reference Student of type sobjectClass in file createStudent.js
Invalid reference Student.Address of type sobjectClass in file createStudent.js
Invalid reference Student.Lastname of type sobjectClass in file createStudent.js
Invalid reference Student.Phone of type sobjectClass in file createStudent.js
Invalid reference Student.Email of type sobjectClass in file createStudent.js
Invalid reference Student.Firstname of type sobjectClass in file createStudent.js
Invalid reference Student of type sobjectClass in file createStudent.js
Invalid reference Student.Address of type sobjectClass in file createStudent.js
Invalid reference Student.Lastname of type sobjectClass in file createStudent.js
Invalid reference Student.Phone of type sobjectClass in file createStudent.js
Invalid reference Student.Email of type sobjectClass in file createStudent.js
And this is Student object:

Pay attention to object's API name. Your custom object (like custom fields) most likely became Student__c.
As for autocomplete issues - try Ctrl+Shift+P "sfdx: refresh sobject definitions"

You may find it easier to use to use an ODBC connection to Salesforce which handles mapping the fields to a relational model. Then you can do it all with SQL.
Check out https://www.progress.com/odbc/salesforce as one option.

Related

PHP PDO Select Format AS Too few parameters

I have the following code:
$extracting = $dbNew->query("SELECT *, Format(Date_Sheet, 'Short Date') AS modifiedDate FROM AccessDB WHERE modifiedDate LIKE '%2021%'");
Having the following error:
Fatal error: Uncaught PDOException: SQLSTATE[07002]: COUNT field incorrect: -3010 [Microsoft Access Driver] Too few parameters. Expected 1.
The problem is the "modifiedDate" because if I replace it with the "Date_Sheet" access field after the database table, I can run the query without issues.
Thank you in advance!

How to import BIT type to SQL from Powershell?

I am trying to import a CSV to SQL Server with PoSh. The file has some columns that I am ignoring so I am using Select-Object to just get the columns needed. This works fine until the SQL table has a Bit type. I get this error:
The given value of type String from the data source cannot be converted to type bit of the specified target column.
When I try to cast the column I get this error:
Unable to cast object of type 'System.Management.Automation.PSObject' to type 'System.IConvertible'.Couldn't store <True> in Refrig Column. Expected type is Boolean.
I have tried [Int32] as well, with similar results.
Code that generates the second error:
(Import-Csv -path "c:\pathtoSCV\file.csv" -Header 'col1', 'col2', 'col3', 'colBIT' | select-object 'col1', 'col3', #{name='colBIT';expression={[bool]$_.colBIT}}) | Write-SqlTableData -ServerInstance "serverName" -Database "" -TableName "tableN"
CSV example:
"C917","","Bob D Hardy","0"
"C43817","","Helen Boch","1"
"C8482f7","","John Smith","1"
I am new to PowerShell so any tips are appreciated.
Update
Tried
Expression={[System.Data.SqlTypes.SqlBoolean]$_.Refrig}
and got:
'dataType' argument cannot be null

Incompatibility due to GUID

i have flatfile which has a field accountid(ex:123123123) .
I need to import my accountid which is in flatfile to database in which it is also named accountid(uniqueidentifier,null)(it's a GUID unique identifier)
Tried changing the metadata of flat to unique identifier but am getting error.
[Flat File Source [2]] Error: Data conversion failed. The data
conversion for column "Account Id" returned status value 2 and status
text "The value could not be converted because of a potential loss of
data.". [Flat File Source [2]] Error: SSIS Error Code
DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "Flat File
Source.Outputs[Flat File Source Output].Columns[Account Id]" failed
because error code 0xC0209084 occurred, and the error row disposition
on "Flat File Source.Outputs[Flat File Source Output].Columns[Account
Id]" specifies failure on error. An error occurred on the specified
object of the specified component. There may be error messages posted
before this with more information about the failure.
Create field for storing source accountid as integer. Add derived column with generated GUID id's (howto Create a GUID column in SSIS) to your source data and use it as primary key in target.
If you trying import GUID values with the same error message:
[Flat File Source [2]] Error: Data conversion failed. The data conversion for column "AccountId" returned status value 2 and status text "The value could not be converted because of a potential loss of data."...
or (the same in Russian):
[Flat File Source [177]] Error: Ошибка преобразования данных. При преобразовании данных для столбца "accountid" возращено значение состояния 2 и текст состояния "Невозможно преобразовать значение из-за возможной потери данных.".
[Flat File Source [177]] Error: Код ошибки служб SSIS: DTS_E_INDUCEDTRANSFORMFAILUREONERROR. Сбой Flat File Source.Выводы[Выход источника "Неструктурированный файл"].Столбцы[accountid] из-за возникновения ошибки с кодом 0xC0209084, и стратегия обработки ошибок строк в "Flat File Source.Выводы[Выход источника "Неструктурированный файл"].Столбцы[accountid]" определяет сбой по ошибке. Ошибка возникла в указанном объекте указанного компонента. Возможно, до этого были опубликованы сообщения об ошибках, в которых содержатся более подробные сведения о причине сбоя.
Dublecheck that GUID values have curly braces. This CSV throws errors:
ReqType;accountid;contactid;
0;6E0DAA5D-CB68-4348-A7B2-AD2367190F83;FFA9D382-D534-4731-82A0-D9F36D8221B0;
This will be processed:
ReqType;accountid;contactid;
0;{6E0DAA5D-CB68-4348-A7B2-AD2367190F83};{FFA9D382-D534-4731-82A0-D9F36D8221B0};
I would solve this by importing your flat file to a Staging table that has a varchar datatype for AccountId.
Then call a stored procedure that copies the data from the staging table to your final destination and uses TRYPARSE() to convert the AccountId column to a GUID. Then you will be able to handle the rows that don't have a valid GUID in the AccountId column without losing the rows that do.

Not able to compile apache2.4.17 with mod_fastcgi

I am trying to compile apache 2.4.17 with FastCGI , i googled various tutorials and most of tutorials contained an command to include and patch from the following link https://github.com/ByteInternet/libapache-mod-fastcgi .
So instead of including their patch i downloaded their fork of FASTCGI and tried to compile against it and i am getting the following error
mod_fastcgi.c:2848: warning: passing argument 5 of 'ap_log_rerror_' makes integer from pointer without a
mod_fastcgi.c:2848: warning: passing argument 6 of 'ap_log_rerror_' from incompatible pointer type
mod_fastcgi.c:2863: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2863: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2863: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2863: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2863: error: request for member 'server' in something not a structure or union
mod_fastcgi.c:2863: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2863: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2863: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2863: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2863: error: request for member 'server' in something not a structure or union
mod_fastcgi.c:2863: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2863: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2863: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2863: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2863: error: request for member 'server' in something not a structure or union
mod_fastcgi.c:2863: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2863: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2863: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2863: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2863: error: request for member 'server' in something not a structure or union
mod_fastcgi.c:2863: warning: passing argument 5 of 'ap_log_rerror_' makes integer from pointer without a
mod_fastcgi.c:2863: warning: passing argument 6 of 'ap_log_rerror_' from incompatible pointer type
mod_fastcgi.c: In function 'check_access':
mod_fastcgi.c:2909: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2909: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2909: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2909: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2909: error: request for member 'server' in something not a structure or union
mod_fastcgi.c:2909: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2909: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2909: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2909: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2909: error: request for member 'server' in something not a structure or union
mod_fastcgi.c:2909: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2909: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2909: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2909: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2909: error: request for member 'server' in something not a structure or union
mod_fastcgi.c:2909: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2909: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2909: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2909: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2909: error: request for member 'server' in something not a structure or union
mod_fastcgi.c:2909: warning: passing argument 5 of 'ap_log_rerror_' makes integer from pointer without a
mod_fastcgi.c:2909: warning: passing argument 6 of 'ap_log_rerror_' from incompatible pointer type
mod_fastcgi.c:2923: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2923: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2923: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2923: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2923: error: request for member 'server' in something not a structure or union
mod_fastcgi.c:2923: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2923: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2923: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2923: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2923: error: request for member 'server' in something not a structure or union
mod_fastcgi.c:2923: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2923: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2923: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2923: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2923: error: request for member 'server' in something not a structure or union
mod_fastcgi.c:2923: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2923: error: request for member 'log' in something not a structure or union
mod_fastcgi.c:2923: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2923: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2923: error: request for member 'server' in something not a structure or union
mod_fastcgi.c:2923: warning: passing argument 5 of 'ap_log_rerror_' makes integer from pointer without a
mod_fastcgi.c:2923: warning: passing argument 6 of 'ap_log_rerror_' from incompatible pointer type
I have googled this error and its an conversion error of pointer to struct
but i am not able to figure out what to change in the mod_fastcgi.c file
I am running Centos 5.8
This is the batch script code i am using to compile
tar -zxf mod_fastcgi.tar.gz
cd mod_fastcgi
cp Makefile.AP2 Makefile
echo $MAIN_SRC/$APACHE2
make top_dir=$MAIN_SRC/$APACHE2
make install top_dir=$MAIN_SRC/$APACHE2
can any one help me debug this as i am trying from many hours still with no success . I also tried to compile with the default tar from fastcgi.com still got the same errors
Instead of using the mod_fastcgi which is available from http://fastcgi.com , i compiled using the mod_fcgid which is available from apache .
Here is the link https://httpd.apache.org/download.cgi .
Here is the commands i used :
tar -zxf mod_fcgid.tar.gz
cd mod_fcgid
APXS = path/to/apxs ./configure.apxs

How to compile cli-clock on cygwin using Makefile?

I wrote ggc clock.c -o clock assuming that it would compile to the file "clock" but apparently not. I do see it comes with a Makefile except I'm not quite sure on how you use that.
Here's the link to what i'm using.
https://github.com/Unixhub/cli-clock
clock.c:6:21: ncurses.h: No such file or directory
clock.c:54: error: parse error before "WINDOW"
clock.c:54: warning: no semicolon at end of struct or union
clock.c:56: warning: data definition has no type or storage class
clock.c:68: error: parse error before '*' token
clock.c:68: warning: data definition has no type or storage class
clock.c: In function `init':
clock.c:89: error: request for member `bg' in something not a structure or union
clock.c:95: error: `stdscr' undeclared (first use in this function)
clock.c:95: error: (Each undeclared identifier is reported only once
clock.c:95: error: for each function it appears in.)
clock.c:99: error: `OK' undeclared (first use in this function)
clock.c:100: error: request for member `bg' in something not a structure or union
clock.c:102: error: request for member `bg' in something not a structure or union
clock.c:102: error: request for member `bg' in something not a structure or union
clock.c:103: error: request for member `bg' in something not a structure or union
clock.c:103: error: request for member `option' in something not a structure or union
clock.c:104: error: request for member `option' in something not a structure or union
clock.c:104: error: request for member `bg' in something not a structure or union
clock.c:115: error: request for member `running' in something not a structure or union
clock.c:116: error: request for member `geo' in something not a structure or union
clock.c:117: error: request for member `geo' in something not a structure or union
clock.c:118: error: request for member `geo' in something not a structure or union
clock.c:119: error: request for member `geo' in something not a structure or union
clock.c:120: error: request for member `geo' in something not a structure or union
clock.c:121: error: request for member `geo' in something not a structure or union
clock.c:122: error: request for member `tm' in something not a structure or union
clock.c:122: error: request for member `lt' in something not a structure or union
clock.c:123: error: request for member `lt' in something not a structure or union
clock.c:127: error: request for member `framewin' in something not a structure or union
clock.c:127: error: request for member `geo' in something not a structure or union
clock.c:128: error: request for member `geo' in something not a structure or union
clock.c:129: error: request for member `geo' in something not a structure or union
clock.c:130: error: request for member `geo' in something not a structure or union
clock.c:131: error: `LINES' undeclared (first use in this function)
clock.c:131: error: request for member `geo' in something not a structure or union
clock.c:132: error: `COLS' undeclared (first use in this function)
clock.c:132: error: request for member `geo' in something not a structure or union
clock.c:133: error: request for member `framewin' in something not a structure or union
clock.c:135: error: request for member `framewin' in something not a structure or union
clock.c: In function `signal_handler':
clock.c:149: error: request for member `running' in something not a structure or union
clock.c: In function `update_hour':
clock.c:158: error: request for member `tm' in something not a structure or union
clock.c:158: error: request for member `lt' in something not a structure or union
clock.c:159: error: request for member `lt' in something not a structure or union
clock.c:161: error: request for member `tm' in something not a structure or union
clock.c:164: error: request for member `date' in something not a structure or union
clock.c:165: error: request for member `date' in something not a structure or union
clock.c:168: error: request for member `date' in something not a structure or union
clock.c:168: error: request for member `tm' in something not a structure or union
clock.c:169: error: request for member `date' in something not a structure or union
clock.c:169: error: request for member `tm' in something not a structure or union
clock.c:172: error: request for member `date' in something not a structure or union
clock.c:172: error: request for member `tm' in something not a structure or union
clock.c:173: error: request for member `date' in something not a structure or union
clock.c:173: error: request for member `tm' in something not a structure or union
clock.c: In function `draw_number':
clock.c:189: error: request for member `framewin' in something not a structure or union
clock.c:190: error: request for member `framewin' in something not a structure or union
clock.c:192: error: request for member `framewin' in something not a structure or union
clock.c: In function `draw_clock':
clock.c:200: error: request for member `date' in something not a structure or union
clock.c:201: error: request for member `date' in something not a structure or union
clock.c:204: error: request for member `framewin' in something not a structure or union
clock.c:205: error: request for member `framewin' in something not a structure or union
clock.c:206: error: request for member `framewin' in something not a structure or union
clock.c:209: error: request for member `date' in something not a structure or union
clock.c:210: error: request for member `date' in something not a structure or union
clock.c:213: error: request for member `framewin' in something not a structure or union
clock.c:214: error: request for member `framewin' in something not a structure or union
clock.c:215: error: request for member `framewin' in something not a structure or union
clock.c:218: error: request for member `date' in something not a structure or union
clock.c:219: error: request for member `date' in something not a structure or union
clock.c: In function `clock_move':
clock.c:224: error: request for member `framewin' in something not a structure or union
clock.c:224: error: request for member `geo' in something not a structure or union
clock.c:224: error: request for member `geo' in something not a structure or union
clock.c: In function `key_event':
clock.c:231: error: request for member `option' in something not a structure or union
clock.c:232: error: `stdscr' undeclared (first use in this function)
clock.c:235: error: request for member `running' in something not a structure or union
clock.c: In function `main':
clock.c:247: error: request for member `option' in something not a structure or union
clock.c:247: error: `COLOR_BLUE' undeclared (first use in this function)
clock.c:248: error: request for member `option' in something not a structure or union
clock.c:250: error: request for member `running' in something not a structure or union
clock.c:259:2: warning: no newline at end of file
Cygwin is large and only a small part of it is usually installed by default. The rest is divided into separately installed packages.
You need to add at least the libncurses-devel package, and possibly others. Run setup.exe, answer the usual questions, type ncurses in the search line, select the last version of libncurses-devel, continue with the installation.
If there's a Makefile, type make in the directory where it resides. This will run the build process.
Note that nothing whatsoever is guaranteed unless the program was tested in Cygwin.

Resources