How can i compile the table through coding in navision 2013 r2
Can you execute the command directly in windows command prompt (CMD), and observe if some error is displayed?
In Command prompt How ??
Please, remove the first double quote, the one previous finsql.exe, and run command again.
No Error is showing.
Maybe you should lean a little basic command prompt syntax before starting this! That you strings and "" are important and used wrongly.
ok. Thank You
If no error is showing, then seems that table has been compiled... can you check if table has been compiled? I have to say that if the table has never been compiled, I don't know why, but the table not compile that way.
FinSQLPath := '"C:\Program Files (x86)\Microsoft Dynamics NAV\71\RoleTailored Client\finsql.exe"';ServerName := '"newserver.newdomain.com:5097/test_live_150218"';DatabaseName := 'TEST_LIVE_150218';Filter := '"Type=Table;ID=5406"';
Command := FinSQLPath + ' command=compileobjects,servername=' + ServerName + ',database=' + DatabaseName + ',filter=' + Filter;
ExecuteBat := ExecuteBat.ProcessStartInfo('cmd', '/c "' + Command + '"'); //Provide Details of the Process that need to be Executed.ExecuteBat.RedirectStandardError := TRUE; // In Case of Error the Error Should be Redirected.ExecuteBat.RedirectStandardOutput := TRUE; // In Case of Sucess the Error Should be Redirected.ExecuteBat.UseShellExecute := FALSE;ExecuteBat.CreateNoWindow := TRUE; // In case we want to see the window set it to False.Process := Process.Process; // ConstructorProcess.StartInfo(ExecuteBat);Process.Start;ErrorMsg := Process.StandardError.ReadToEnd(); // Check Error Exist or NotIF ErrorMsg <> '' THEN ERROR('%1',ErrorMsg)ELSE BEGIN Result := Process.StandardOutput.ReadToEnd();// Display the Query in the Batch File. MESSAGE('%1',Result);END;
Look if have written something wrong.