How can I retrieve a field whose name is stored in a second field in Salesforce? - salesforce

For instance, I have a Case record whose Subject is "Account.Name"
How can I access via Apex the field Case.Account.Name?
It should work for everything I put on that field. If I set the Case Subject to "Account.Parent.Name" the system must retrieve Case.Account.Parent.Name
Thank you.

Related

How can i match and filter table by user input in data studio

I have a list of objects. In my case, the object is a contract (agreement). The contract has address field as string
I want to make it possible to filter by address. Or rather, the user enters the beginning or part of the address and the table is filtered based on the user input text. The problem is that the user can enter with a capital or small letter or something else, and thus strict equality does not work. I need a matching address with user input.
Data structure:
Input box controller:
This input box controller works only then user put exactly the same address as in data structure, for example Juhkentali tn 32, Tallinn. But my idea is, that user can enter only juhkentali and will see all contract with matched address
Please help me, how I could solve this problem.
I was facing the same issue. So I converted it to lower case using the lower function as commonly all searches are in lower case.
For example -
My data had a patient name column with the following values
Wagner,
ROBBINS,
doe,
junioR
So I converted the patient name column to lower case and used it in the input box. And, my visualizations used the original patient name column.
The only restriction with this is that the users have to search only in lower case.
Please let me know if this helps or if you got a better solution.

Drupal, in a content type display some text depending on the value of a date field

I have a problem that puzzled me for quite a long time with the display of certain text depending on the value of a pair of date fields.
I have created a content type that includes two fields, a start date and an end date. I have also a third field titled "status" and I would like to make it display the values "in preparation", "in progress", "completed" depending on the value of the start/end dates.
Could you please guide me on how to do that?
I am using Drupal 7.
You can use template_preprocess_field and alter your field based on $vars['element']['#field_name'].
Also there is an $vars['element']['#object'] object that holds the original entity.

Printing records with condition Crystal reports

I am using stored procedure in mssql as backend, vb.net as frontend (just info).
There are a lot of records in the database and I am printing in crystal reports.
Now I want to filter the records from crystal report and not by adding a new parameter to procedure or changing database structure or else.
For now,Say there are columns : Name , Amount.
I want to put filter in amount like only display records whose amount above 100 or something. So other records with less than 100 should not be displayed.
This filter will be passed by the user so it'll be random.
I can't find a proper answer on internet. Might be a duplicate question, if so please post the link of the question if it is duplicated.!
Thanx anyways...!
In general the idea is to:
Create the parameter (user choose what will be the input/value) - link
Set filters, what values should be displayed in regards to parameter - link
On right side there is a DataExplorer window, where You need to add a Parameter (define his name, what question will be shown to user and what type the param will be / what values can be set inside).
Once done, You can jump to Data tab of a report, click Interactive Filter and specify which column must fit what condition with what value = Parameter (that one user will enter in Report).
Example: I will create AmountParam, with message "What should be the minimum amount?". Type will be set to Integer. Going to Report->Data->Interactive Filter, choose Amount as a Column, AmountParam as a Parameter and set condition Greater then (>).

MS ACCESS Report - Using CODE to change a value in a field from an OPTION Group to a different value

I have a report in ACCESS that Is based on a query of a table populated by a form with an Option group. ( to try to explain this better - Table is inspector qualifications, the query pulls all of the qualifications for the inspector, the qualifications are selected via option group on a form that populates the fields of the inspector qualification table.) Of course, the choices are stored as numeric values, "1, 2, 3 or 4" in the table, but 4 actually designates a N/A or NONE. Since everything is already built out this way, I am trying to write a code that will run when the report is generated (or opened,) that will take the "4" value entered (if the field equals that) and change it to a Null value /blank in the report - not in the query or table. I still want this report to generate everything else as is - show all records - just change the value if that particular option is the one shown in that field for that particular record.
Anyone know of a good way to do this? Any help would be GREATLY appreciated!!!!
You would just place an 'IIF' in the query that tests for the value you want to change, then either changes it to something else, or retains the original value. The below will test field 'Nbr1' for the presence of a 4, and if found, change it to 'N/A', otherwise it stays the same.
Note! You will need to change the control source in the report to reflect the name you provide (i.e. 'MyChange') because you can't keep the original name.
SELECT Table1.ID, Table1.EMPID, Table1.TestResult,
IIf([Nbr1]=4,"N/A",[Nbr1]) AS MyChange, Table1.Nbr2
FROM Table1;

FileMaker Pro 13: How to get a summary variable to display an accurate total

I am working on a database of records that includes a step that only needs to be performed for some of the records (about a fourth of them). To keep track of which records needs the extra step, I created a boolean field with 0 for "doesn't need the step" and 1 for "needs the extra step" (these are assigned before importing the information into the database). There is also an option for the user to click a button and change the boolean from 0 to 1 (in case the record needs the extra step in the future).
The database also has a report feature that shows the total number of records that needs this extra step. I need this field to display the current total number of these records, so I have tried setting up a summary variable called Total PLQA that is defined to give the "Total of" and then the boolean variable (PLQA Bool). Somehow, I got the total to work once, but it seems that the reporting variable "Total PLQA" does not update when new records are added to the database or when users change the boolean value. Somehow, I need to get the variable to update whenever the report script is run and I can't figure out how to get it to work.
I have tried setting up a summary variable called Total PLQA that is
defined to give the "Total of"
That would be a summary field, not a variable.
it seems that the reporting variable "Total PLQA" does not update when
new records are added to the database or when users change the boolean
value.
A summary field always displays the summary value for the current found set (unless you place it in a sub-summary part, where it will display the sub-summary value for each sorted group).
Make sure your report layout is based on the same table where the summary field is defined, and that the summary field's instance placed on the layout is coming from the same table occurrence.
Note also that:
After import, only the imported/updated records will be found;
If you modify the Boolean field, you must commit the record before you will see the summary field reflect the change.

Resources