I'm trying to create functionality mentioned in the title. The idea that I have in mind is that I have a form, where I can select the server/-s (i have achieved that with a simple dialog list). So far I have this in my dialog list:
servers:=#Name([Abbreviate];#DbColumn(""; #If(#Subset(#DbName;1)="";"";#Subset(#DbName;1)) :"names.nsf";"($Servers)";1));
#Unique(#If(#IsError(servers);"";servers))
What I'm having problem is with selecting the databases available in the selected server/-s. Can anyone give me a hint on how to do this? Haven't really tried anything because I couldn't find the information.
Depending on your needs, it does not have to be that complicated: #Prompt has a special mode for picking a database:
result := #Prompt([ChooseDatabase];"";"");
FIELD Server := result[1];
FIELD Filename := result[2];
FIELD Title := result[3]
Related
I have been developing a web application using domino, therein I have dblookup-ing the field from notes client; Now, this is working fine but the format of value is missing while using on web.
For example in lotus notes client the field value format is as above
I am one, I am two, I am one , I am two, labbblallalalalalalalalalalalalalalalalalalaallllal
Labbbaalalalallalalalalalaalallaal
Hello there, labblalalallalalalllaalalalalalalalalalalalalalalalalalalalalalalala
Now when I retrieve the value of the field on web it seems it takes 2 immediate after 1. and so forth, I was expecting line feed here which is not happening.
The field above is multi valued field. Also on web I have used computed text which does db lookup from notes client.
Please help me what else could/alternate solution for this case.
Thanks
HD
Your multi-valued field has display options associated with it and the Notes client honors those. Obviously, your options are set up to display entries separated by newlines.
The computed text that you are using for the web does not have options like that and the field options are irrelevant because you aren't displaying the field. Your code has to insert the #Newlines. That's pretty easy because #DbLookup returns a list, and if you concatenate a list and a scalar, the scalar will be appended to each element of the list. (Look at the third example under "concatenation, pairwise" here to see what I mean.
The way you've worded your question is a little unclear to me, but what you need in your computed text formula is either something like this:
list := #DbLookup(etc,. etc.);
list + #Newline;
Or something like this:
multiValueFieldContainingListWithDbLookupResult + #NewLine;
I used #implode(Dblookupreturnedvalue;"");
thanks All :)
I have only been using PhpStorm a week or so, so far all my SQL queries have been working fine with no errors after setting up the database connection. This current code actually uses a second database (one is for users the other for the specific product) so I added that connection in the database tab too but its still giving me a 'unable to resolve column' warning.
Is there a way to see what database its looking at? Will it work with multiple databases? Or have I done something else wrong?
Error below:
$this->db->setSQL("SELECT T1.*, trunc(sysdate) - trunc(DATE_CHANGED) EXPIRES FROM " . $this->tableName . " T1 WHERE lower(" . $this->primaryKey . ")=lower(:id)")
Also here is what my database settings window looks like as seen some people having problems with parameter patterns causing this error but I'm fairly sure that is not the issue here:
Using PhpStorm 10.0.3
You can set the SQL resolution scope in File -> Settings -> Languages & Frameworks -> SQL Resolution Scopes.
This allows you to provide a default for the entire project and you can optionally define specific mappings to certain paths in the project.
So the short answer is that it cant read the table name as a variable even though its set in a variable above. I thought PhpStorm could work that out. The only way to remove the error would be to either completely turn off SQL inspections (obviously not ideal as I use it throughout my project) or to temporarily disable it for this statement only using the doc comment:
/** #noinspection SqlResolve */
Was hoping to find a more focused comment much like the #var or #method ones to help tell Phpstorm what the table should be so it could still inspect the rest of the statement. Something like:
/** #var $this->tableName TABLE_IM_USING */
Maybe in the future JetBrains will add that or make PhpStorm clever enough to look at the variable 3 lines above.
You can use Nowdoc/Heredoc also instead of using
/** #noinspection SqlResolve */
Here is the example
$name = "your name";
$query = <<<SQL
SELECT * FROM user WHERE name LIKE "%$name%" ORDER BY id
SQL;
Both of the methods will make the warning gone
I'm using decode for my query but when every time I run my query, there's a two dialog box appeared and need to input some number in those dialog box before to see the result. What should I need to remove it?
Please help me.
Thank you.
Here's some of my query..
SELECT (CODE_SALESROOM) POS_ID
,DECODE(CODE_SALESROOM, '60001', 'ABM SYSTEM'
,'50001', 'Acenet Unlimited Business Computer'
,'40002', 'RL My Phone - Robinsons Galleria') AS POS_NAME
FROM OWNER_DWH.DC_SALESROOM
WHERE CODE_SALESROOM NOT IN ('XAP', 'XNA', '10001')
Sounds like you're being prompted for substitution variables, because part of your query has somethling like and col = 'AT&T' - the ampersand is interpreted as a variable by default, and you're prompted for a value for &T (or whataver your actual value is interpreted as).
You can add set define off to your script to stop it looking for, and prompting for, a value when that is not what you want.
(The links are for SQL*Plus documentation, but much of that applies to SQL Developer as well; the documentation for that is a bit sparser),
We data-drive some text in our database, such as names of products, etc. Recently our marketing team asked us to display product names with special characters such as the registered trademark symbol ®, ascii code 174.
My question is, how can we best store this character in our data, so that it displays correctly in both HTML and non-HTML formats? At first, we tried something like this:
update products_table set display_name = 'FooCorp' || chr(174) || ' Awesome Product' where product_id = 1;
When I query that product in TOAD, the registered trademark symbol shows up correctly, but when we try and query and display that text in our webapp, neither Firefox nor IE knows how to display it. Both show the "diamond with a ?" symbol instead.
Next, we did this:
update products_table set display_name = 'FooCorp® Awesome Product' where product_id = 1;
... which makes our webapp happy, but of course anything non-HTML that tries to show a products list (ex: SQL queries that generate reports) now show the HTML character in the name.
Anyone have any ideas on how we can satisfy both the HTML and non-HTML world? Ideally we'd like to avoid having separate columns that duplicate the text, but if that's really the only way, we can go that route.
Well, chr(174) may mean smth in Oracle but when it comes to web browsers they may have diff char. settings etc... I'm not sure but maybe you simply hardcode that character to your query:
SELECT 'FooCorp® Awesome Product' FROM dual;
How can i write a function to update record in Microsoft Dynamic NAV using Role Tailored Client Report ?
Thx in advance,
Makara
You can place code in your report triggers.
Below is a simple example of code that can be put in the OnAfterGetRecord trigger of a Customer data item that refers to the Customer table.
IF Customer.Name[1] = 'A' THEN BEGIN
Customer.Name[1] := 'B';
Customer.MODIFY;
END
The code above changes the first character of the name of any customer included in the report that begins with an upper case 'A' to an upper case 'B'.
A complete report with just this functionality and no printout can be found from pastebin:
Simple Dynamics Nav Report Sample.
You can copy the entire content of the paste into a text file and import it into Nav as text.
Beware, however that doing this will replace any previous report with the id of 50000 with this example without any additional warning or prompt. The report imported as text will need to be saved in compiled form in Nav prior to you being able to run it.
You cannot place C/AL code directly on RTC Reports -- instead you should use the triggers behind DataItems in the 'Classic' client/Development Environment, as this code is common to both Classic and RTC reports, and executed when the report is run in either environment.
To use a similar example;
Vendor - OnAfterGetRecord()
----------------------------
...
IF Vendor."Phone No." = '' THEN BEGIN
Vendor."Phone No." := NewPhoneNo;
Vendor.MODIFY;
END;
...
You may want to set the following properties on the report itself to hide the print dialog, as well as the request form (assuming you don't want filters applied):
UseReqForm := FALSE;
ProcessingOnly := TRUE;
Another important thing to note is that code sitting behind sections is only used for Classic reports and won't be executed if running in the RTC (which may explain unexpected results).