Return a value based on a function in placeholder in oracle Apex - email

Sorry if this is a "stupid" question, but I am new to Apex.
I made 2 processes on the create button: one is to insert into the department table and the other one to send an email with some info, among them the department too.
I made an email template and I want to display the department name, not the id which is inserted into the table. So I thought, that maybe I can do that with a function, like in the picture attached(get_department_by_id - returns the name of a department).
[example][1]
[1]: https://i.stack.imgur.com/bjBag.png

The help function in the builder usually gives enough info. Here is the help for "Placeholder values"
So only Application, Page Items and System Variables are allowed.
Note: There are multiple places in APEX where you can pass a number of arguments (links, branches, etc) but nowhere the use of functions is allowed.

This is how it worked for me.
I created a computation, with the computation of type "Expression" with source get_department_by_id(:P7_ID_DEPARTMENT) and Condition Type "Request = Expresion 1" with source the name of the button(ex.create).
Thank you Koen Lostrie for the guidance!

Related

adding up specific mergefield values in word

I have a table in a word document that has three colums and all fields are mailmerge fields from an external IT system.
There are three columns displaying the fields:
Charge Description
Charge Value (£)
Eiligible? (yes/no)
I am trying to create a field that adds up all eligibale charges so that only charge values that show a "yes" in the eligigble field are included. Does anyone know if this is possible? I have tried creating a formula but can't get it to work. Also, I would assume at some point an if statment is required so that it only includes the eligible charge.
Has anyone done anything similar before and if so, would they mind sharing how it was achieved?
Many thanks
You can do some things with expression fields (created in Word with CTRL-F9). This will look like {} and you can insert the expression. eg {{MERGFIELD charge} + {MERGEFIELD charge2}}. Since however you want to check multiple values and then create an expression, its probably easier to use a macro. The macro would contain your logic, then set the fields in the document accordingly.
Here are two external links since I can't reproduce a useful amount the content here because it's a verbose answer to a potentially deep question:
Expression Fields
Merge fields
I hope that helps.

MS Access Combobox "#Name?" error

I have a problem with a combobox in a form, which displays a "#Name?" error whenever I enter it to select a value.
I am creating a form in MS Access (specifically in Microsoft Office Professional Plus 2010) that is a general user interface, meaning that the form itself is not linked to a RecordSet of any kind.
In that form, I create a Combobox, which I link to a "TblSubsystem" table. The table is very simple and designed like that:
ID (primary key, autonumber)
SysShortName, text
SysFullName, text
When I try to select a value in the dropdown list, the testbox of the combobox just displays "#Name?" (actually as soon as I select the combobox, even before I select any value)
The relevant (I think) parameters of the combobox are:
Control Source= "=[TblSubsytem]![ID]"
Row Source= TblSubsystem
Row Source Type= Table/Query
Bound Column= 2
Column Count= 2
Column Width= 0cm;1cm
(I am trying to select and show the short code, but to get the ID as a value for the combobox)
I have another form in the same project, in which a identical setup (also on TblSubsystem) works just fine, with the same values for these parameters, but that Form is linked to a RecordSet (another table). As far as I can tell it is the only difference, so I guess I must be missing something around that, which will seem obvious once I see it...
I have looked for variation of "Ms Access combobox #Name? Error", on stackoverflow and more broadly on the net, but in two days, I haven't seen any post answering my questions. Some are close, but refer to a much more complicated setup, while I think mine should have been pretty straight forward. Trying to adapt the solution to my case (includind recreating the combobox or decompiling the database) didn't help.
Here it was, long question, sorry about that, but hopefully precise enough for some of you guys to help on that. I thank you in advance for any help I can get on that.
#Name is a binding issue. Try setting your bound column to one, that way it only records your primary key and see if that works.
Edit: You've got the combobox referencing your table's primary key as your control source. Keep in mind the control source is the value that is being altered by the application user. Here are some key things to think about when working with comboboxes:
The control source should (typically) reference the foreign key of your table
The row source should reference the text that you want displayed in the box
Bound column should be set to 1, unless your application design requires you to update two fields simultaneously, which is an uncommon practice.
Set your column width to 0;1. This will hide the first field in your row source, which should be your foreign key
An example would look like this:
Control Source: EmployeeID --123456
Row Source: EmployeeID, EmployeeName --123456 | John Doe
A bound column set to 1 would record the value 1234556. A bound column set to 2 would record 123456, John Doe

Insert URL into BIRT Report that contains dynamic parameters

I am fairly new to BIRT and I am working on adding some new functionality to one of our existing reports.
We have an application that makes a call to BIRT to generate the report in question. When this report is generated I would like to include a URL at the bottom of the report.
The only issue is that the URL would contain two parameters that are different for each report that gets generated. I created a data source and a data set that I can pull the parameters from, but I am not sure how to create a URL with the parameters that relate to the particular report that is being generated.
I have read that you can create a label and insert a hyperlink, but this doesn't seem to be of much help in my situation.
The URL that gets inserted into the report would need to look as follows:
localhost:8080/Application?key=firstParameter&securityString=secondParameter
Please let me know if I did not explain my situation thoroughly or if you need more clarification.
Best Regards,
-Dave
There are multiple ways to do this.
For example insert a new "Data" element to the report, set the datatype to "String" and enter as expression the text you want to display, i.e. "My URL" (with quotes because it is an expression).
Then click on "Binding" tab of this data element and select your dataset. Answer no to the question "Do you want to clear existing binding". In the popup, select all columns required to build the URL.
Finally use hyperlink property of the data element. May be you missed it can be an expression:
This pops up an expression builder, in your case this would result in something like:
"localhost:8080/Application?key="+row["firstParameter"]+"&securityString="+row["secondParameter"]

Access Form - Syntax error (missing operator) in query expression

I am receiving a syntax error in a form that I have created over a query. I created the form to restrict access to changing records. While trying to set filters on the form, I receive syntax errors for all attributes I try to filter on. I believe this has something to do with the lack of () around the inner join within the query code, but what is odd to me is that I can filter the query with no problem. Below is the query code:
SELECT CUSTOMER.[Product Number], SALESPERSON.[Salesperson Number],
SALESPERSON.[Salesperson Name], SALESPERSON.[Email Address]
FROM SALESPERSON INNER JOIN CUSTOMER ON
SALESPERSON.[Salesperson Number] = CUSTOMER.[Salesperson Number];
Any ideas why only the form would generate the syntax error, or how to fix this?
I was able to quickly fix it by going into Design View of the Form and putting [] around any field names that had spaces. I am now able to use the built in filters without the annoying popup about syntax problems.
I had this same problem.
As Dedren says, the problem is not the query, but the form object's control source. Put [] around each objects Control Source. eg: Contol Source: [Product number], Control Source: Salesperson.[Salesperson number], etc.
Makita recomends going to the original table that you are referencing in your query and rename the field so that there are no spaces eg: SalesPersonNumber, ProductNumber, etc. This will solve many future problems as well. Best of Luck!
Try making the field names legal by removing spaces. It's a long shot but it has actually helped me before.
No, no, no.
These answers are all wrong. There is a fundamental absence of knowledge in your brain that I'm going to remedy right now.
Your major issue here is your naming scheme. It's verbose, contains undesirable characters, and is horribly inconsistent.
First: A table that is called Salesperson does not need to have each field in the table called Salesperson.Salesperson number, Salesperson.Salesperson email. You're already in the table Salesperson. Everything in this table relates to Salesperson. You don't have to keep saying it.
Instead use ID, Email. Don't use Number because that's probably a reserved word. Do you really endeavour to type [] around every field name for the lifespan of your database?
Primary keys on a table called Student can either be ID or StudentID but be consistent. Foreign keys should only be named by the table it points to followed by ID. For example: Student.ID and Appointment.StudentID. ID is always capitalized. I don't care if your IDE tells you not to because everywhere but your IDE will be ID. Even Access likes ID.
Second: Name all your fields without spaces or special characters and keep them as short as possible and if they conflict with a reserved word, find another word.
Instead of: phone number use PhoneNumber or even better, simply, Phone. If you choose what time user made the withdrawal, you're going to have to type that in every single time.
Third: And this one is the most important one: Always be consistent in whatever naming scheme you choose. You should be able to say, "I need the postal code from that table; its name is going to be PostalCode." You should know that without even having to look it up because you were consistent in your naming convention.
Recap: Terse, not verbose. Keep names short with no spaces, don't repeat the table name, don't use reserved words, and capitalize each word. Above all, be consistent.
I hope you take my advice. This is the right way to do it. My answer is the right one. You should be extremely pedantic with your naming scheme to the point of absolute obsession for the rest of your lives on this planet.
NOTE:You actually have to change the field name in the design view of the table and in the query.
Put [] around any field names that had spaces (as Dreden says) and save your query, close it and reopen it.
Using Access 2016, I still had the error message on new queries after I added [] around any field names... until the Query was saved.
Once the Query is saved (and visible in the Objects' List), closed and reopened, the error message disappears. This seems to be a bug from Access.
I did quickly fix it by going into "Design View" of the main Table of same Form and putting underline (_) between any field names that had spaces. I am now able to use the built in filters without the annoying popup about syntax problems.
Extra ( ) brackets may create problems in else if flow. This also creates Syntax error (missing operator) in query expression.
I had this on a form where the Recordsource is dynamic.
The Sql was fine, answer is to trap the error!
Private Sub Form_Error(DataErr As Integer, Response As Integer)
' Debug.Print DataErr
If DataErr = 3075 Then
Response = acDataErrContinue
End If
End Sub

Filemaker Value List Troubles - Missing Items

I am relatively new to Filemaker programming, but I have come across what I thought was a bug, which I have been tearing my hair out trying to squash, only to find it is more a "feature" than a bug. I have a field set as the key for lookups in a ms sql database which I have created a relationship with. I have it set as a drop down, and it is showing 2 fields (last name and first name). Unfortunately, it only shows 1 person per last name in the sorted list (example, there are 5 people with the last name "Bennett" but only 1 shows). After driving myself nuts trying to find the error, I found the following in the filemaker troubleshooting section:
"
If the value list is defined to display information from two fields, items will not be duplicated for the field on which the value list is sorted. For example, if the value list displays information from the Company field and the Name field, and if the values are sorted by the Company field, only one person from each company will appear in the value list."
As I read it, I can't do what I need to do with a value list (display EVERY last name from the sql file) so what other options do I have? I have experimented with creating a portal which DOES show a list of ALL the last names and first names, but I don't know/understand enough to know what logic/functionality I need so if I click one of the people in the portal list it will do the same thing as if I clicked it in a dropdown value list, which is to then do the lookups and populate the rest of the fields in this database from the information in the record in the sql database. Any and all help would be greatly appreciated, and I appreciate any help any of you can offer. Thank you!
There might be some things that cause this;
You cannot create a link based on a calculation that needs to be calculated each time (Filemaker does not know what to do with this, logical in a way)
Based on what you do I would personally link the two tables based on an lets say company ID instead of a name, as a one to many join. This will definitely eliminate the 'feature' filemaker has of showing unique names only in the joined table. On database level I would join on ID, on Value list I would select the ID as first field and the (calculated) name as second field, than showing only the second field (option in the value list definition popup) for your selection list.
Hope this helps.