Using Sitecore Source value to populate droplink field - sitecore

using Sitecore I have created a data template
Person Gender
Text : Single Line Text
Key : Number
Then I created 2 new instances of this template in Global content tree:
Global/Gender
Text = Male
Key =0
Text = Female
Key=1
After all I've created a new Data Template, called: Person
Person
Name : Single Line
Gender: DropLink (Source: /sitecore/content/home/global/gender/*)
But in instances of Person, DropLink field dosen't show me Female and Male items to select.

Set Source of the Gender field to the parent path:
/sitecore/content/home/global/gender
Skip the /* at the end of it.

Related

Oracle Apex Autocomplete Item to return ID value, not the lookup value

I have the table "SYMPTOMS" with two fields:
"ID" number and "SYMPTOM" varchar2(1000).
I want on my page the item "P2117_SYMPTOM_ID" to be autocomplete and search from the second field ("SYMPTOM") but to return the ID value of this record.
Check the docs. The page item type "Text field with autocomplete" only takes a single column as source (a return value), not 2 columns like a list of values. Reason is that this is an enhanced text field: you can freely enter data but it will suggest you possibilities from a list. A text field only has its actual value as return type too. You could have return ids from a table but then how would you handle values entered by the user that are not in the list ? If you want to map the data the user enters to an id then you can write your own function to do that. Ideally that function would:
Return the id of the value if it exists
Create a new value and return that newly created id if it doesn't exist.

Dynamically insert data into an APEX page item when a page item is entered a value

I have a form in APEX that is used to add data into a table. Most of the items in the form are free form texts but there few items that are needed to auto filled when you enter a value in on of the page item.
For example.
There is form with Page Items. ID, Name, TitleLevel, Title_prefix, Salalry,
There is a table XYZ with Title_prefix and salary info which
ID Title_prefix Salaray
1 Junior 80000
2 Mid-Level 95000
3 Senior 115000
So you enter ID= 1, Name = ABCD, Titlelevel = 6 is entered and Title_prefix and salary should be populated based on the value that is entered in titlelevel. In this case it will be
Title_Prefix = (SELECT Title_Prefix FROM XYZ WHERE ID = (Case WHEN :P1_TitleLevel > 5 THEN 3 CASE WHEN :P1_TitleLevel = 5 THEN 2 ELSE 1 END))
Same thing for Salary as well.
Immediately after entering Titlelevel page item to 6 the Title_prefix and Salary should get refreshed and populate this items. Then the user will submit the form so that the information can be entered into the table.
Add a Dynamic Action on titlelevel (Key Release if Text Field, onChange if dropdown etc.)
Add a PL/SQL Action to the dynamic_action, using Items to Submit to pass fields in and Items to Return for the fields you modify.
Dynamic Action:
OR
Action:

DAX - How to lookup and return a value from another table based on 2 possible lookups

I have 2 tables, one has a ton of fields so I didn't copy it all but the 2 fields in the big table that I'm working with are "Item Number" and "Item Description". The smaller table is pictured below.
ItemData table
ItemNumber
ItemDescription
Entities
ProductLines
The two tables are not related; I need to have a column in the big table named "Entity" where I lookup the item number or the item description (if the item number is missing) and return what Entity is associated. If both fields are empty then return "NONE".
My current code is below and it works sometimes which doesn't make sense because the code isn't correct, I know. I also can't get it to look at one field if the other is blank which is why that part of the code has been deleted.
Entity = LOOKUPVALUE(ItemData[Entities],ItemData[Item Number],Page1_1[Item Number],"None")
Here is what I want it to say in DAX - Entity = if itemNumber is not null then use item number to retrieve the entity name, otherwise use the itemdescription to find the entity.
Here is what I would like to see:
Item number = "123"
Item Description = "Sunshine"
Entity = "Florida"
I can pull item number and description from the big table. I just need to match those with the small table to get the entity.
You can create an if statement:
Entity = IF(ISEMPTY(ItemData[Item Number]) then
LOOKUPVALUE(ItemData[Entities],ItemData[Item Description],Page1_1[Item Description]) else
LOOKUPVALUE(ItemData[Entities],ItemData[Item Number],Page1_1[Item Number]))

Apex5.0 choose layout and add date validation

I am building a student module application in Oracle Apex 5.0 and wanted to know how to display the details in oracle apex.
Something like this with two tabs on the 1 page:
on first tab, When input StudentID,
the first section will contain system_date and tutor name that has login
second section should contain student name and course desc & course year
third section is to display current semester module, if payment done or not (Y /N), markings %, date of payment.
2nd tab of the page to include all courses done for that student.
Which layout to choose (interactive grid/report) or any other.
How to add validation of date picker for the payment date so that upon input it insert directly in table in DD-MON-YY format and also that it takes system_date??
Note table:
student_details: the student name, address and personal details
course_detail table contains the courses for the semester
payment_detail table for the payment details
The sort of things you're going to want to look for are:
Region Display selector, for multiple tabs
Any type of report region to display data, and you can have multiple, and nest them as sub-regions.
You can define page items that are displayed as date pickers, and use default values to source today's date using the keyword SYSDATE.
You're going to need to understand SQL.

how to send data as hidden to QComboBOX in pyqt

I need to send name and id to QComboBox, But i want to show name and because id is id in dB table, i want to keep as hidden id, but i don’t know how to keep as hidden id.
I can name such as:
self.comboBox_2.addItems(list1)
Bu i don't have any idea on hidden data.
My question is , how send data as hidden to QComboBox?
If you have a data model based on QAbstractItemModel which has to columns 'id' and 'name', you can do this:
enum Columns
{
COL_ID,
COL_NAME
}
QComboBox *combo = new QComboBox;
combo->setModel(model);
combo->setModelColumn(COL_NAME)
If you want to add items to a combobox one by one, you do this:
QComboBox *combo = new QComboBox;
combo->addItem(name, id);
Then you can retrieve id value from combobox item using:
QString id = combo->itemData(index, Qt::UserRole).toString();