How to create a dynamic attribute in lov at runtime?
Suppose I have a employee lov, where only two attributes are currently present like employee id and employee name.
It user want to add a few more column at run time like employee age and employee salary.
Without changing the LOV logic. The user has one master table where IT user can handle how many attribute should be displayed to business user. They can add a new parameter in table which can be displayed.
Can anybody suggest me some approach to handle this type of scenario?
If I got you right, I'd use backingBean with method that returns List, that implemented as ArrayList<SelectItem>. Then populate from any source(like VO, or whatever mixed) label and value according to your current user request.
Related
How can I compare a cds element to a return value of an ABAP function?
As an example:
An employee is assigned to a company and the company has orders from customers. These orders are displayed in a table and employees should only see orders for the company they are working for.
If employee A was working for Company B, the role would be something like this:
grant select on ConsumptionViewName
where company = ‚B‘;
I now want to make this hardcoded 'B' dynamic and there is an ABAP helper function that returns the employer of an employee which should be used. There aren't any authorization objects that have a field for the company, is it possible to do it without one?
There is no way you can supply your dynamic values for the CDS DCL.
If no suitable authority object is found, either you define your own one and let DCL do its job. Alternatively you can filter the result at Gateway layer (methods in ...DPC_EXT class) by filtering the result with the ABAP helper function.
I have a problem creating sql dynamic action in oracle apex v4.2. I have two fields, Department number and department name. Department number is a text field with autocomplete. The department name is a display field. On changing the department number, the department name should be displayed by an sql query.
I created a set value dynamic action on department number, giving the correct values in page item to submit and the correct sql query referencing P3_DEPARTMENT_NO.
When i run the page, after select a department number, the department name is not coming up automatically.
Could you please suggest on what i might be missing.
Thanks in advance.
You can try use this way:
First step: In the Shared Components -> Application Processes: create a process myProcess an put your sql dynamic in.
Second step: Create a javascript function myFunction to call the process myProcess.
Third step: Use onChange event to call your javascript function myFunction.
Also you can find a lot of exemples on Denes Kubicek app: https://apex.oracle.com/pls/otn/f?p=31517:101:116042570427567.
Best regards,
iulian
The exact behaviour of autocomplete lists is probably browser dependent, but generally speaking, don't rely on the "Change" event, as it won't necessarily fire when you select from the list.
You'll need to experiment to get the behaviour you want in your particular situation, but as a starting point you might want to try replacing the "Change" event type on your dynamic action with "Lose focus". That way the dynamic action should always be triggered when you tab or click away from P3_DEPARTMENT_NO.
In similar situations in the past, I've used "Key release" instead of "Lose focus", and I've created a second dynamic action which does the same thing, but triggered by "Get focus". That combination ensures that the display field stays synchronised with the user's selection, whether a value is keyed in or selected from the autocomplete list. Whether or not you go this route depends on how happy you are about the database being hit with your department name query every time a user interacts with P3_DEPARTMENT_NO in any way.
I have field that I want to automatize, I have department field is managed metadata, with different department, I want when I fill the editform, automatically , if department is IT then my field is NumIT0001 , the same for other department, have you any idea.
Thanks,
Use a workflow. On item submitted the workflow would start, check the value of IT department and then use an if condition to set the required field.
I'm using Visual Studio 2013 LightSwitch to attempt to build an HTML application. After trying for several hours to get a "computed" column/field to show up in the HTML client, I realized it's not possible. I thought about building a trigger to fire on the table, but that won't get pushed when I publish the application. So, without using a RIA client, what's the best way to calculate using two or more datasource fields and store in another? It can be triggered when the user clicks the save button or even when the fields contain data that can be computed.
For example, Table Users (before):
First_Name (string) Last_Name (string) Stored_Full_Name (string)
John User NULL
Jane Doe NULL
When the user clicks save, or when first_name and last_name are not null, "Last_Name, First_Name" is stored as a single column in the Stored_Full_Name column in the same table.
For example, Table Users (after):
First_Name (string) Last_Name (string) Stored_Full_Name (string)
John User User, John
Jane Doe Doe, Jane
I'm assuming the same technique could be used to calculate costs or other items?
Any example code would be greatly appreciated.
For simple computed properties, you can always create functions on the Users prototype.
It's explained in this blog post: http://lobfactory.wordpress.com/2013/05/03/computed-fields-in-the-html5-client/
This is pretty easy. Create a string-typed screen variable called "FullName" with display text of "Full Name". Edit the Screen's "create" method and assign the value you want to the variable in JavaScript. - in the example above you'd want something like the following:
screen.FullName = screen.Last_Name.value + ", " + screen.First_name.value;
Then drag the variable from the data tab on the left onto your screen into your Users table.
You might need to update the computed value as part of your Save pipeline, but the create() method should fire any time the screen is redrawn. If you want to save this into a nullable column within your Users table you can do so by simply assigning the field value to the new value, but I'm not sure why you'd bother as this breaks your table's normalization. In the function where you pre-process saved changes on the client-side, add the following code to make this so anyway:
screen.FullNameTableField = screen.FullName.value;
I use a very similar technique for creating in-row "Edit" and "Delete" record-level table entries.
HTH
I am using a Multiple Items Form to list CASES (records) where there is no TECHNICIAN assigned (Maybe I should use a Datasheet to list the records?).
I would like the user to select a TECHNICIAN from a dropdown field that gets its values from an Employee Table (I can do this). Then I would like the user to select multiple CASES (records) in order to assign that one TECHNICIAN to the Technician field in all of the selected CASES.
Basically, I'm trying to keep the user from having to assign a technician from within each and every incoming case request. I want them to "batch" assign a tech to multiple cases.
Can someone point me in the right direction?
Ok so I did some more research. This may not be the best answer but it works for now.
I created a Multiple Item Form.
I added an unbound dropbox that lists Employees from the table
I added a button on the detail section (for each record) with the follow line of code:
Me.Technician = Me.Choose_Technician
Now the user can pick a technician from the dropdown and then click the button to assign that technician to the record/casefile.
This is a simple solution if you only have a couple of records/casefiles to assign. If the amount of incoming casefiles increases there will have to be a way to select multiple records using the shift key. I'll keep researching this.