How can I remove a comma from a field in a sharepoint 2013 page? - sharepoint-2013

I'm trying to modify the properties of a page in SP 2013.
In this page I have different fields (like ID, Name, AssetGallery etc...).
When I try to modify the field AssetGallery in which there shouldn't be any image, so it should be empty, I get a comma.
How can I avoid having this comma?
example:
Name: TEST -
ID: 4 -
AssetGallery: ,

Related

How get display value of checkbox in a checkbox group?

I am using APEX 21.1. I have a checkbox group whose list of values is retrieved using a query...
select disease, id from history;
The query returns many checkboxes. I have another textarea item. I need to get the display value for any checkbox whenever it's checked and set item HISTORY to that value. How to do so?
Describing a how-to would be so much easier if you had provided some example page item names and example data. So, lets call your checkbox group P10_CHECKBOX and your textarea P10_TEXT.
Usually, your checkbox group will save the item ids as a colon seperated list, like this: 3:4:5
To display the corresponding display values, make a dynamic action on change on your item P10_CHECKBOX.
Then, use an action of type Execute PL/SQL Code to fetch the display values of your items.
The code could look like this:
select listagg(disease,chr(10)) within group (order by disease) into :P10_TEXT
from history h
join table(apex_string.split_numbers(:P10_CHECKBOX,':')) t on (h.id = t.column_value);
apex_string.split_numbers will convert your colon list into an actual "table" with the column column_value you can use in the join clause. listagg will do the actual concatenation and will work up to a couple thousand characters. chr(10) is an ordinary line break and will have your items be shown line by line, but any other seperator will do.
Last step is to set up P10_CHECKBOX in your Items to submit and P10_TEXT in your Items to return.
Now, whenever you click a checkbox, the textarea will be updated immediately.

MS Word expression

I am try to make page numbers with IF statement like this
{ IF { PAGE } > 1 "{ PAGE }" "" }
And doing all like here: https://support.microsoft.com/en-us/kb/95886
If more than one page than site numbers will show up. But i cant make it working when i press CTRL + F9 and type this command its not working.
Even only { PAGE } not working but when i put this command form menu its working... what i doing wrong?? Why its not working after CTRL + F9. and Typing PAGE.
I know that i can preview it by ALT + F9
Sorry for not English Screenshot
BEFORE ALT + F9:
AFTER ALT + F9:
You need to update the field after inserting it outside the header or footer.
To insert:
Type Alt-F9 to switch on field display
Type Ctrl-F9 to enter field
Type PAGE to enter page field
Type Alt-F9 to shut down field display
Type F9 to update the fields
To manually add DATE:
Type Alt-F9 to switch on field display
Type Ctrl-F9 to enter field
Type DATE to enter date field
Type Space to add extra space, there should be 2 spaces! (enable display formatting if you want to see the spaces)
Type Alt-F9 to shut down field display
Type F9 to update the fields
As you can see, adding the right number of spaces in the formulas is critical. By adding the fields through the Ribbon (Insert, Text group, Fields) you can see how Word is creating the fields itself. If you are familiar with the formatting you can easily type Ctrl-F9 with the formula and update all with F9.

APEX 5.0.1 - interactive report using aliases give blank edit forms

So I've been working on an application in Oracle Application Express 5, in which I have multiple interactive reports with an update form. I have noticed that when I use aliases in the SQL query of the report, the edit on the report stops working. When I want to edit a row, I just get the blank form for adding a new entry, even though I can see in the URL that the primary key has been sent.
Is this a known issue, and is there any way to make this work?
My column names are partly Croatian abbreviations, so leaving the original column names would be too messy.
Here's an example of my code which works:
select "SIFRA_A_P",
"SIFRA_P",
"NAZIV_P",
"CIJENA"
from "#OWNER#"."PJESMA"
Writing it like this
select "SIFRA_A_P" as "ALBUM",
"SIFRA_P" as "ID",
"NAZIV_P" as "TITLE",
"CIJENA" as "PRICE"
from "#OWNER#"."PJESMA"
makes it stop working properly.
Go on your page where you have the problematic report, go at Report Attributes and in the Link Column section now you have something like this
Name Value
Item 1:P3_SIFRA_A_P Value 1: #SIFRA_A_P#
Item 2:P3_SIFRA_P Value 2: #SIFRA_P#
Change the #SIFRA_A_P# to #ALBUM# and #SIFRA_P# to #ID# in the value column.
include rowid in your select statement.
select rowid,"SIFRA_A_P" as "ALBUM", "SIFRA_P" as "ID", "NAZIV_P" as "TITLE", "CIJENA" as "PRICE" from "#OWNER#"."PJESMA"

Capture values of a shuttle list

I am using APex 4.2
I have a page (page 31) with a shuttle list. The list contains several job categories (a, e, x, c, etc). I have a button on that page that generates a report based on the selected job category. I click my button, a query runs, and it takes me to a report page (page 27). The query is along these lines
select * from 'table'
where (instr(':'||:P31_JOB_CATEGORY||':',':'||JOB_CATEGORY||':') > 0)
where P31_JOB_CATEGORY is represented by a shuttle list. This gives me the desired results on page 27, however, is there a way to capture each selected job category that was selected in the shuttle list on page 31 and pass it to page 27 to be displayed? It would be nice to have it stored in a concatenated string of some sort for easy handling, i.e. A, E, C, X.
Any help would be greatly appreciated. Thanks in advance.
The reason is in how shuttle values are saved to session state and how the apex URL is constructed.
Shuttle values are constructed, as you have seen, by concatenating the selected values with a colon. So for example, I have a shuttle on ENAME from EMP, select 3 values and submit the page. Session state for the shuttle is: URUGUAY:HOWARD:M BENZ.
Now say that you redirect to another page, setting an item with the value of this shuttle item. The URL will look like this: f?p=54687:6:100741653098795::NO::P6_TEXT:URUGUAY:HOWARD:M BENZ
The apex URL is constructed by using colons. You putting values in there which has colons simply doesn't work for apex.
Solution? You could submit the page and use a computation to replace the colons, and then branch away to the destination page.
For example, with my enames I'm replacing the colon with a ~: URUGUAY~HOWARD~M BENZ. On your destination page you can then use this value and adapt your sql or use a computation in before/after header to replace the seperator again.

Trigger a process (SQL update) when leaving an APEX page

This is a very odd question but i wondered whether it was possible to trigger a process that runs an SQL UPDATE when the user leaves this specific page, either by clicking on the breadcrumb, tabs or back button?
I did setup the process to run on the 'Back' button; however i ran into the problem of: What if s/he clicks on the breadcrumb or a tab instead.
I have searched the net and posting this question was a last resort. I wondered if anyone can point me in the correct direction?
UPDATED POST
Page 1:
Includes a text field and a button. The user enters the category into the text field and clicks on the button to proceed to the next page. The button passes the value in the text field to a text field on Page 2.
Page 2:
Two regions on the page. One region holds information about the category - Category name from the previous page, category description, and the category revision number (which is what i'm trying to get working). The second region is a report that pulls the item name and number that are listed under the category in the category text field. A 'View' link is used on the report to load the edit page for the specific item selected. The 'View' link passes the 'category name' (from the category text field) and the 'item number' from the report to page 3.
Page 3
Two regions are used, first region: Lists the Item number which came from page 2 and name of the item (which i use a simple query to retrieve). In the second region: A report is used with two columns: a list of item properties in column 1, and a text field next to each item property in column 2 to hold the value that can be updated. The 'Apply Changes' button has some PlSql behind which looks for changes and updates where required. It updates the relevant fields that have changed, and it then takes the user back to Page 2 (Page showing user the items listed for the category intitally entered).
I cant increase the category revision on the 'apply changes' button on page 3 because the user may complete edits for items under the same category. So i dont know where i can increase the category revision by 1 per vist to a category. P.s I already increment the revision number for each item by 1 if the info has been changed using the 'apply changes' button on page 3.
One way of doing this is by updating the session state of the page items (without submitting the page as normal) via ajax and by calling an Application Process which updates the table, when called by a javascript onbeforeunload.
Create an Application Process to fire On Demand, named UpdatePageXOnExit or something. In the PL/SQL block of that Application Process, use SQL update commands with the item state of each item on the page that you wish to update; something like the following:
BEGIN
UPDATE table_name SET col1 = :PX_ITEM_1, col2 = :PX_ITEM_2, col3 = :PX_ITEM3, col4 = :PX_ITEM_4, col5 = PX_ITEM_5
WHERE (condition... I would suggest ROWIDs to simplify changes to the
fields of the PK; otherwise you will have to create additional
page items for each field of the PK, then set those items to
the values of the PK when the page loads using a before
header page process, and then use those values in this where
clause like this: where col1 = :PX_ORIGINAL_PK_FIELD_1 AND col2 =
:PX_ORIGINAL_PK_FIELD_2 );
END ;
Go to the page settings for that particular page, and in the JavaScript: Execute On Page Load section, write something like the following:
window.onbeforeunload = updateOnExit;
And in the JavaScript Function and Global Variables Declaration, write something like the following:
function updateOnExit() {
var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=UpdatePageXOnExit',&APP_PAGE_ID.);
get.add('PX_ITEM_1',$x('PX_ITEM_1').value)
get.add('PX_ITEM_2',$x('PX_ITEM_2').value)
get.add('PX_ITEM_3',$x('PX_ITEM_3').value)
get.add('PX_ITEM_4',$x('PX_ITEM_4').value)
get.add('PX_ITEM_5',$x('PX_ITEM_5').value)
gReturn = get.get();
get = null;
// Comment out the following line or not, as per the note in the following paragraph
return 'Are you sure you would like to leave the page?';
}
This last piece is the AJAX that updates the session states of the page items on the page that have been changed on the user's end but that haven't been uploaded to the servers end which normally occurs during page submission. Note: If you comment out the return statement, than there will be no warning box that will allow the user to stay on the page. If that is what you prefer, go for it. If you chose to use the warning box, the ajax will execute the page process even if the user chooses to stay on the page.