I'm trying to add the ability to assign todo tasks to a specifc user when creating workflow. I cant seem to figure out how values are passed to the drop down list. I want to use the existing framework and not do it a roundabout hacked way. Can anyone help with this?
It seems dropdown list values somehow end up in this picklist object, but not sure where they are set.
Could you please provide a more detailed explanation of what you are trying to accomplish? When creating a new workflow and after selecting a module, you can set conditions. To assign it to a specific user, you can choose the condition
Created By : (Users) User Name is xyz
Is this what you are asking? Or are you asking how to create a new task?
1) open "includes/utils/EditViewUtils.php"
2) Search for the block starting with the line below: (in Version 5.4.0 it is line #331):
if($fieldname == 'assigned_user_id' && $is_admin==false && $profileGlobalPermission[2] == 1 && ($defaultOrgSharingPermission[getTabid($module_name)] == 3 or $defaultOrgSharingPermission[getTabid($module_name)] == 0))
the first part of the condition should be:
$users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id,'private'), $assigned_user_id);
3) Change 'private' to 'not private' (or anything else) so that line now shows:
$users_combo = get_select_options_array(get_user_array(FALSE, "Active", $assigned_user_id,'not private'), $assigned_user_id);
Now you can assing ToDo tasks to anyone.
Related
This issue is so weird!
Example structure of entities relating to each other:
Property
-> InstructionToSell (OneToOne)
-> acceptedOffer (OneToOne)
If I do something like:
$property = $repo->findOneBy([‘id’=> 1]);
It works, all the relationships come back ok.
But now if I create a custom method in the property repo to search postcode with a LIKE query the acceptedOffer relationship is null
It’s confusing me as to why this is happening? It’s the same entity, same relationships, I’m just loading it via a like instead of directly by Id.
Even if I use fetchAll it works fine.
I hope I explained this well enough it’s difficult to explain what I’m seeing.
Seems like "lazy loading" is at work here.
Did you explicitely write the join query in your custom one ? (because maybe you should)
It is because you might have created custom query and when you create them you need to define your joins and select them.
For example;
$queryBuilder
->addSelect('p', 'i', 'o')
->join('p.instructionToSell', 'i')
->join('i.acceptedOffer', 'o')
->setParameter('name', $name)
->andWhere(
$queryBuilder->expr()->eq('p.name', ':name')
);
I am trying to save data into my table using an interactive grid with the help of custom plsql. I am running into an "ORA-01403-no data found" error while inserting data and I can't figure out why.
This is my plsql custom process which I run. Appreciate your help.
DECLARE
em_id NUMBER;
BEGIN
CASE :apex$row_status
WHEN 'C'
THEN
SELECT NVL (MAX (emergency_id), 0) + 1
INTO em_id
FROM emp_emergency_contact;
INSERT INTO emp_emergency_contact
(emergency_id, emp_id, emergency_name, emergency_relation
)
VALUES (em_id, :emp_id, :emergency_name, :emergency_relation
);
WHEN 'U'
THEN
UPDATE emp_emergency_contact
SET emergency_name = :emergency_name,
emergency_relation = :emergency_relation
WHERE emergency_id = :emergency_id;
WHEN 'D'
THEN
DELETE emp_emergency_contact
WHERE emergency_id = :emergency_id;
END CASE;
END;
So far I have not come across any documented way on how to use custom PL/SQL logic for processing submitted rows of APEX 5.1 Interactive Grid via AJAX call.
You are getting no data found error because the return is expected to be in certain json format.
The example you have provided is not too complex and can be with done using standard "Interactive Grid - Automatic Row Processing (DML)" process, which is an AJAX approach. If AJAX call is not important then you can create your own PL/SQL process with custom logic. Example of which is demonstrated in "Sample Interactive Grids" package application, check out Advanced > Custom Server Processing page in this application for more information.
I agree with Scott, you should be using a sequence or identity column for ids.
Not entirely sure. A 'select into' can raise a no_data_found exception, but yours shouldn't.
That being said, you shouldn't have max(id)+1 anywhere in your code. This is a bug. Use a sequence or identity column instead.
I have gotten this many times so the first thing I do is go look at any columns in my grid sql that are not part of the "Save", they are from a join for data only.
I just got it again and it was a heading sort column that I had as a column type of "Number". I changed it to display only and the "Save" now works.
Although, I had already set the "Source" of the column to "Query Only" which is also needed.
It is a bummer the Ajax error message doesn't at least give the column name that caused the error.
Hope this helps someone..
BillC
Add a RETURNING INTO clause after the insert. IG expects a primary key to be returned to query the inserted row.
Been using Faker in combination with sqLite in-memory database for testing in Laravel lately and I have this strange issue where my model has a factory and everything except the first variable (which happens to also be the primary key of the table) gets set correctly.
Let's explain further, the variable I'm pointing at uses the following rule in the factory:
'kvk' => strval($faker->randomNumber(9)),
So it should become a string containing a 9 digit number. Now the next step is calling the factory from my controller test and I also have another User model which uses this 'kvk' variable from my company as a foreign key reference:
$this->_company = factory(Company::class)->create([ 'address_id' => $this->_address->id ]);
$this->_user = factory(User::class)->create([ 'kvk' => $this->_company->kvk ]);
But when I put an echo $this->_company->kvk; in between, it shows me that 'kvk is set to 1, which should not be possible because of the rule I put in my factory.
Finally the user is used to mock the session in the test and is also used to check wether I should have the rights to edit an address using the following check:
$user = Auth::user();
$company = Company::where('kvk', $user->kvk)->first();
$address = Address::whereId($id)->first();
if($company->address_id != $address->id)
{
return abort(403);
}
So first I get the current logged in user (which is mocked to the created user above, and this works perfectly. Next I get the company associated with this user (which should be the one created above, since I used the company->kvk as a foreign key reference), however when I output the saved Company to my log I see that the kvk is set to a 9 digit string like it's supposed to.
I really can't put my finger on why at first the kvk is set to 1 and afterwards in my test it seems perfectly fine the way it should be, but my test fails because the wrong reference is set in my User so it can't find the right Company. Do you have any idea what could be the reason for this? I've also tried setting the 'kvk' explicitly while creating with the factory, but this also does not work and will stil output 1.
After diving into the source of Laravel, I found out it had to with my models. While I did set the primary key attribute in my models, I forgot to set the auto increment boolean to false. This caused my models to cast the primary key to an auto increment integer every time it was saved to the database. This solved the issue.
I am trying to figure out how to pull a set of data and then manipulate it afterwards, instead of querying the database as and when I require data. I am building a dashboard and this is required for performance reasons.
To dumb down the example as much as possible, lets say you want to pull all users
users = User.all
Then you want to filter that data, but you want to do it after all the data has been pulled
my_users = users.where(is_admin: true)
I know the previous line isn't the correct syntax for what I am looking for, but I want something to that affect that will query the preloaded data stored in the users variable.
Do I convert the active relation to an array and cycle through the array looking at each item? For example should I do this
users.to_ary.reject{|u| u[:is_admin] == true }
or something to that affect?
Is there an easier way to do this?
my_user = User.all.to_array.keep_if{|u| u.is_admin == true}
I think is the best way of doing it.
I am working on register local search terms in Sitecore DMS. I took help from the following blog. First of all I registered a Search page Event with named "Search".
protected void RegisterSearchPageEvent(string searchQuery)
{
if (!Tracker.IsActive || Tracker.Visitor == null || Tracker.Visitor.CurrentVisit == null)
return;
var page = Tracker.Visitor.CurrentVisit.CurrentPage;
if (Tracker.Visitor.CurrentVisit.PreviousPage != null)
page = Tracker.Visitor.CurrentVisit.PreviousPage;
page.Register(new PageEventData("Search")
{
Data = searchQuery,
DataKey = searchQuery.ToLowerInvariant(),
Text = searchQuery
});
}
I also defined the page event “Search” in Sitecore. Now to display the Report in Executive Dashboard I went under the "Site Search" but it does not display anything.
I configured the .config file located here:
\sitecore\shell\Applications\Reports\Dashboard\Configuration.config
Here there is a setting called “MinimumVisitsFilter“. I set it from 50 to 5 and also entered the search keywords - more than 50 times. The main point is here is that the above code is inserting the keyword into the Analytics database. Is there any SQL Query problem for Executive Dashboard?
Even with the MinimumVisitsFilter set to 5, you still need to generate 5 unique visits to start seeing any data. On your local dev environment you could probably set this one as low as 1 or even 0 - but I would not recommend you did this on the live environment.
Also make sure all the basics are in place; Analytics is active (Sitecore.Analytics.config), the database is set up and so on.
I followed the same post when registering local search, and the procedure Brian describes here does work.
The above problem is due to browser cache. Sitecore DMS Search event stores the single value for one word if we don't close the browser or need to search from the different browser to store the value. If this kind of problem occurs, then search for different keywords by closing the browser and then clearing the cache. This works for me.