Job no issue assignig to multiple users - ajax

Let me describe the problem in detail.
I have a table called export. Which has a field job_no.
When a user comes and fills this query run
select max(job_no) as Last_Job from jobs
The result is A005 which is the last job number in the table.
On the PHP end I display A006 in the entry form which user is going to fill and submit.
The job_no field in the form is read only and user can not change it.
Now here comes the problem if multiple user are filling the form at the same time A006 is being displayed to each and when they submit the form A006 is submitted with their record.
Which is duplicate and is not required.
Now what should be the solution to prevent this situation.
I have three solutions but i want to know if there is some better solution.
Solution 1
I insert the job number to user_entry form with user id and display it to user.
Then when user submits the form i update it.
Draback seems that if user cancels the form submission the job_no is useless then.
Solution 2
I display the job number to each user and when submitting i check the job number , increment it and tell the user that the job number has already been assigned so he is going to be assigned the next one.
if i don't display the prompt message to user he will be under the impression that his job number is A006 where in the database it will be A007.
Also if i run ajax request with setInterval it will be a load on server and there is still chance of duplicate.
This is necessary to display the job number to the user. So what is the better approach in this situation. Or is there any alternative to this problem?

Why do you display A006 to the user before they create the form? I fail to see how that can be a "requirement" if you can use solution two which says you can change it anyway.
Why dont you just get them to fill in the form, and when they submit say "thanks - job A006 has been created". Simple and easy

Related

Oracle Forms UNIQUE ID generation

I am creating an Oracle Form. This form has a field by the name FILE_NUM. There is one more field by the name CLIENT_ID in the form. I have to generate unique FILE_NUM. The process is:
If the CLIENT_ID already exists in the table, get the FILE_NUM and assign it to the new record
ELSE, take the maximum of FILE_NUM, add 1 and assign it to the new record.
This should be taken care when multiple users are working on the form. Hence I did the following:
In Key-Commit trigger, I check if there is a lock on the table.
If the table is locked, I make form wait for 3 second and check again.
If the table is not locked, I am locking the table and inserting the records with the above check.
My query is: is this the right way to do? Is there any other way to generate the FILE_NUM (maybe via trigger?). The problem with key-commit trigger is that if the form closes forcefully, the lock is not removed. This will cause more issues, hence I want to remove the lock feature.
Please advice.
This is the correct way, but indeed the lock can stay in some cases.
If the number doesn't have to follow each other you can use a sequence instead.
This will give you a number when needed and it will be unique.

Editable form in APEX for different roles

I am trying to implement the following process in APEX.
The following is the case:
A student creates a form, here the responsible first and second supervisor for the thesis can be selected.
When the form is submitted, the responsible first and second supervisors only see the final papers which are assigned to them .
They can click on a final paper to edit it.
When they click edit, they see the student's created form, but can only edit the fields that are tied to their roles.
I created an interactive report page for the primary supervisor. Here he can see all final papers assigned to him which are listed in an interactive report.
I then linked the thesis ID to the student's created thesis form.
I created some fields and used an authorization scheme so that only the first supervisor can see and edit these fields.
I am not sure if this is the common procedure in apex or if there is not a better way to implement it.
The general idea is that different users can gradually edit and add things to the form.
There is no "correct" answer to this question.
It sounds like you have multiple users with different roles in your application and they're allowed to do different things. It sounds like you have a Student role and a Supervisor role already. (Don't forget to consider that a user may have both roles, depending on their situation. I may be a Student for my thesis, but a Supervisor for someone else's.)
You want an input form for the Student and a review form for the Supervisor and the fields will largely overlap. You could use one Apex page for each, or a single page that changes depending on the mode it's used in. You also need a way to tell the page that it's being operated in one mode vs the other. Personally, I go for the second approach when it's feasible.
This means you will use the Read Only attribute for the different page items depending on whether the user is a Student or Supervisor. You may also want to use the Server Side Condition attribute to remove some page items or regions entirely.
For example, the Student may enter a Title attribute so that needs to be read-write, but the Supervisor only needs to see it, so that will be read only. The supervisor will need Approve and Reject options, but the Student should not see those at all.

Change data in the database after indicated time

In a certain amount of time after the user clicks a button, I need to have some data in the database changed.
For example, there is a sessions table with the is_active(default value 0) field and two buttons. After the first button clicked the field has to be equal 1 for 5 minutes; after clicking the second button field has to be equal 0 immediately.
In the first place, I thought Queues or Task Scheduling might be the solution, but I don't see how make it works
Is that even possible to do by Laravel?
Yes, you can with some help of the database. You can define a schedule that runs once in a moment, and you can push a record to the database when an user clicks a button. Then on the scheduled task, check if there are any tasks need to be run in that moment, or past moments etc. Then delete the task when it's done from the database. Be aware that on the next query, if there are jobs still running, add an extra flag to the table saying that the job has started, and don't run that again.

SSRS Action - Go To Report/Cascading Parameter

I have a question to determine if something is possible.
I have a report where the user enters in a client number into the parameter. This parameter is not loaded with available values because the number of unique client numbers is too large. After they enter a client number, they receive a list of that client's matters. Some clients have hundreds of matters.
What I want is for the user to be able to click on a matter and have it take them to a second report, the go to feature, that shows them additional details about that one matter they clicked on. Is that something that's possible? I don't want the user to have to input a matter from a list of values on that second go-to report, so maybe it's possible to have a cascading parameter in the second one that's hidden from the user but auto-populates based on what they clicked?
I'm still trying to get cascading parameters to even work for me, but I'm not even sure where to begin researching what I want to do here. Any guidance on what to look for would he super helpful, or let me know if it's not possible.
Thanks!
Rough guidelines:
create a report that accepts the matter number as a parameter
on the textbox/cell in the original report that the users will be clicking, right click on it and select properties, set action to go to report, and then select the new report and pass the value of matter id to the new report parameter

Display work items which are waiting until backend service finishes

In my workflow I have iterative loop which check the table value until it matches a workflow value using DB Execute.
This stage arise after completing initial and step After values matches it will proceed to next step.this has created by adding delay function.
However my client required to show the list work items which are pending withing content navigator. Is there a way to achieve this.
Try to add users (who want to track status) in F_Trackers system Workflow Group.

Resources