How do we set a default Request Page value for a Dynamics NAV report - microsoft-dynamics

We have a Dynamics NAV (2013R2 if it matters) report for which we need to set some default values on the Request Page. We have set the ReqFilterFields property on the first level DataItem and the correct fields are being displayed in the Request Page. We need to set default values for a couple of the ReqFilterFields. Where do we assign the default values?

We eventually found it. When the Report is in Design Mode,
Click View, Request Page
Click View, C/AL Code
Put code in OnOpenPage event
// For option fields.
DataItemName.SETRANGE(FieldName,DataItemName.FieldName::OptionValue);
// For standard fields.
DataItemName.SETRANGE(FieldName,DefaultFieldValue);
NOTE: If you are assigning a default value to a non Option field, you may need to remove the field name from the ReqFilterFields list to prevent it from displaying twice in the Request Page. Dynamics NAV 2013R2 seems to handle Option fields properly when the Option field is in the ReqFilterFields list and is also assigned a default value in the OnOpenPage event.

Related

Pass values between pages Oracle APEX

There is a problem transferring values between pages in the application. I have 2 pages on the first page there is a variable P9_ITEMID (when you run page 9, in this variable SQL Statement query writes the data). There is a second page 181. I want to move data from variable P9_ITEMID to variable P181_ITEM. To do this, I use the 'redirect to page in this application' option. But it doesn't work. Although I see in the variable P9_ITEMID there is data. But when you go to page 181 but P181_ITEM is empty. I would be grateful for help))
P9_ITEMID is a virtual variable that is not assigned to any column in the table. This mmin simply displays data. When I start the page, I see the data that was written to it due to the dynamic action
also i tried to write the value in P9 ITEMID this way
My code:
declare
v_empname items.id%type;
begin
select id into v_empname
from items where id = :P9_ITEMID;
apex_util.set_session_state('P9_ITEM_ID', v_empname);
exception
when others then
apex_util.set_session_state('P9_ITEM_ID', null);
end;
I'm assuming that you have created a button with action: 'redirect to page in this application' and you want the session value of a page item to be passed to the target page.
When an url is constructed using link builder, the link is built at page rendering time. It does not pick up any changes in session. Even when you set the session state in a dynamic action, it will not pick it up because the url is already rendered.
To pick up any changes on that page, it is necessary that the page item value is set in session state and this is done by the "page processing".So if you use "Submit Page" on the button and create a branch to redirect to the page it will behave the way you want.

How to pass data values between pages

I'm getting and showing data from database. I was created button which one redirects to another page and fill form data. Button redirects to another this application page and sets items (names, values). If I set static value - it's works. But how I can pass data from columns (MAX_PHOTOS, MAX_PHOTO_SIZE) using Page Designer?
When creating a link, you have options.
http://prntscr.com/t70l76
You type in the Page number, and then below that you set items. You can just click the buttons next to the lines and it shows you the items on the target page and the items on the source page, you select those and thats that.
If you are writting them in yourself, then you can do &P1_ITEM. Dont forget the . at the end. This also works for other uses where you need to reference page items. But know that those values must be submitted in order for them to be used.

"general" variable in oracle apex

I'm developing an application in Oracle Application Express (APEX).
First page contains list of projects as a tabular report.
Clicking any of the rows forwards to the next page, where records can be edited. I've implemented it with following settings:
Link column: link to custom target
Target: Page in this application
Until this is fine.
My problem is how to pass actual report to the next page?
My table, which is the basis of the report has primary key (ID), and also owner & title combination is unique. Currently ID column is not included in the report.
Also the second page doesn't currently contain field showing ID, as this information isn't important to the users.
I know I could set ID column in report, and create a read only (even hidden) text box in the next page, however I'm looking for a more elegant solution. What is the standard way to solve this?
I wonder if you are asking: "How do I pass a value from page 1 to page 2 so page 2 can use the value to do a query and present the results. If so, here is how it's done.
On page P1, the report, for example, select the attributes for the report region under the region in the Rendering pane on the left of the page designed.
Under Attribute Properties on the right side, look for Link Column and set it to "Link to custom target". Then click Target.
Select the page and then in the Set Items section, on the left, under name, select the PK ID field to receive the passed value ex: P2_ID. On the right under Value select the field to pass the value, ex: #P1_ID# and click ok.
Now, when the link on page 1 report is clicked, the P1_ID is saved into Session state by Apex and passed to P2 which then performs a FETCH using the passed value.
You can read more about Session State here. Also, be aware there are security settings which affect what params can and can't be passed in the URL.
Clicking "Session" in the developer toolbar will enable you to see the session variables being passed.
If you mean "How do I store values in the app that can be accessed anywhere in the app - like a global variable" Then look at Application Items.
As always, please include version numbers in these posts.
When you create a target page let's say Page 3
And you create some items, let's say P3_ITEM_1,P3_ITEM_2, etc
You can assign values to each of them through the url in the original page
The complete APEX URL Syntax looks like this:
http://apex.oracle.com/pls/apex/f?p=AppId:PageId:Session:Request:Debug:ClearCache:Params:ParamValues:PrinterFriendly
Let’s take a closer look:
http:// – the protocol, can be http or https
apex.oracle.com – your domain/host/server, whatever you want to call it. Can also be localhost.
/pls – indicates that you are using Oracle HTTP Server with mod_plsql. If you are using APEX Listener or Embedded PL/SQL Gateway this part is obsolete/missing.
/apex – the entry from your dads.conf file (this a file on your application-server or EPG where the target database is configured) – in case of EPG its just one entry pointing to localhost, in case of an OAS you can have multiple entries, each pointing to an other database
/f?p= – procedure “f” is called and parameter “p” is set to the complete rest of the string. Remember: APEX uses mod_plsql. “f” is a public procedure, this is the main entrypoint for APEX. Or you could say: “f” is APEX.
AppId – the number or the Alias of the Application
:PageId – the number or the Alias of the Page
:Session – unique Session ID, can be 0 for Public Pages or empty (then APEX creates a new Session)
:Request – a Request Keyword. This is basically free text, just a string you can specify to react in a process or region condition on. e.g. you could pass the keyword “CREATE” and have a condition on the delete button of your page saying “dont’t display this button if request is CREATE”.
In other words: use the REQUEST to control the behaviour of your page.
When pressing a button, the button sets the REQUEST to the button-value (e.g. SAVE), so that you can control the processes in the page processing (Submit) phase.
:Debug – set to YES (uppercase!) switches on the Debug-Mode which renders debug-messages and timestamps in your Browser window. This helps to detect wrong behaviour of your page or performance issues and everything else. Every other value then YES turns the Debug-Mode off
:ClearCache – you can put a page id or a list of page ids here (comma-separated) to clear the cache for these pages (set session state to null, …). But there is more: RP resets the pagination of reports on the page(s), a collection name deletes the collection, APP clears all pages and application-items, SESSION does the same as APP but for all applications the session-id has been used in.
:Parameters – comma seperated list of page-item names. Good practice is to set only those page-items which are on the page you are going to. Accepts page-items as well as application-items.
:ParamValues – comma separated list of values. Each value is assigned to the corresponding Parameter provided in ParamNameList (first value assigned to first parameter, second value assigned to second parameter, and so on…).
The trick here is not having values which contain either a comma “,” or a colon “:”. Both would lead to side-effects and errors, as APEX gets confused when parsing the URL. Using a comma works, if enclosed by slashes: e.g. \123,89.
:PrinterFriendly – set to YES (uppercase!) switches the page into PrinterFriendly-Mode, uses the Printerfriendly template to render the Page. You can also hide regions or other elements in PrinterFriendly-Mode using the PRINTER_FRIENDLY variable in a condition.
In your case you'd use Params:ParamValues like this:
P3_ITEM_1,P3_ITEM_2:someValue_1,someValue_2
Documentation

How to set the default result set of Oracle APEX form to be empty?

When accessing an Oracle APEX form, the form automatically returns a set of results.
Is there a way to make the default/initial result set of a form to be empty?
I want the users to see nothing when they visit the page and I want the users to use the search bar to search for the records.
You probably want the clear cache parameter in the URL to be the page number, clearing out session state for all your page items.
http://docs.oracle.com/database/apex-5.1/HTMDB/understanding-url-syntax.htm#GUID-F249FDCA-972B-4DFB-A51B-DD127AAB9C35
Adjust this in the navigation link to the page.
Alternatively, you can define a calculation, or set the source of the relevant items to always be null.

Sitecore Content Editor - Update to standard values on templates not being reflected in instances

When updating the standard values of a data template and saving the change, the updated value isn't being reflected in the instance(s) of the data template, until the cache is cleared.
This is happening across all data templates, and isn't due to the standard value being overwritten within the instance(s).
For example, in a base page template that is inherited by the content page template, there is a field that contains an email address.
After creating a new content page instance within the content tree, the email field is correctly set to the standard value (and has [standard value] next to the field name label).
After going back to the base page template, updating the email address and saving the item, the value in the content page instance is not updated, however it still has the [standard value] label next to the field.
The value of the field is not updated to reflect the base template until the cache is cleared (currently using the http://localhost/sitecore/admin/cache.aspx) page and using the 'Clear all' button.
Why is the standard value being cached within the content editor, and how can we prevent that from happening?
UPDATE
When attempting to reset the content item's field value to the standard value (using the ribbon command Versions -> Reset), the value of the field in the standard value box is also showing the cached standard value, and not the value that has been updated/saved in the data templates standard values.
In the content editor choose the data item, from the ribbon select the version tab and click the reset button (make sure standard fields are visible).
Select the layouts field and reset it to standard values.
This will show if you have values setup on the standard values correctly.