Repeating Rows in custom list - sharepoint-2013

I'm trying to create a mileage reimbursement log in sharepoint13 but can't use infopath because I was told by my super that it would require licenses for all users. So the form I wanted to create is formatted something like this:
Emp Name_______________
Date____________________
Ceneter Num_____________
======================================================================================
From Dest______________ To Dest____________________ Mile___________________________
click to add row
Total miles_______________________
======================================================================================
trip purpose___________________________________________________________________________
comments________________________________________________________________________________
SUBMIT
I'm having a problem with the center section, id like the from dest, to dest, mile to repeat by clicking the add row link but I can't find much info out there to do this other than using using info path. After I create this I need to set up a workflow to email the director for approval and then once approved send email to finance dept to process form

Related

How to Create A Dax for RLS?

I have a column named company ID that contains various comapnies with differnet employes in them, I need a DAX Query which will give data A/Q to the Company id, suppose if there are 3 employes inside a company and each of them have a companyid 1 then I they should able to see the reports of each other but they cannot be able to see the reports of comanyid 2 and 3, how this can be achived?
I know I can do this by creating different Roles for each companyid, but how can this be achived if I want this to be built in one particular role???
What you are asking is to implement Dynamic Row Level Security.
Model:
User Table: Table that contains user detail along with the field on which we will apply security(here email field).
Company Table: Table containing company data .
User Company Bridge: Bridge table that contains permission details, for example user x is member of company y and z.
Company Data Table: Measures or transaction information of company that is to be filtered.
Defining RLS(Row Level Security):
In Modelling -> Manage Roles, create a new role on Email of User Table by this DAX query which returns the email id of logged in user.
[Email] = userprincipalname()
Finalizing:
Go to PowerBI Service -> Dataset -> Security and add users to the roles created.
To test the implementation:
Go to Modelling tab of pbix file.
Click on View As Roles.
Check other User checkbox and put an email ID and also check Profile
checkbox.
Now you can see data filtered.
In this manner it becomes easy to maintain roles and security by just modifying the bridge table that stores all permission details.

add custom product statuses in opencart admin

By default in opencart we have 2 product statuses (which we can use also in admin to filter products) - enabled and disabled.
I need to add a few more custom statuses, which will be just for my team which is working over the products (for example i want to add need description status, products with the custom statuses will not show in the front end (like disabled) so if the product is market with it, the team who is working on product descriptions will easy filter only the products that need descriptions).
I hope i explained clearly as well...Thank you...
If you look into the language file of product admin/language/language_name/catalog/product.php, there is $_['text_enabled'] and $_['text_disabled'], you can add $_['text_need_description'].
In category.php and product.php controllers you will find
$data['text_enabled'] = $this->language->get('text_enabled');
$data['text_disabled'] = $this->language->get('text_disabled');
Next to them, you can add
$data['text_need_description'] = $this->language->get('text_need_description');
You can check occurrences of 'enabled' and change accordingly. You also need to change the relevant templates and models.
In database, status is saved as 1 for enabled and 0 for disabled, you can save the value 2 for 'need description'.
When the products are fetched to be displayed to the customer on front-end, only the products with status 1 are fetched so you won't have to change that part.

How can I select records n-at-a-time for multiple users to edit?

I am using a Django backend with postgresql.
Let's say I have a database with a table called Employees with about 20,000 records.
I need to allow multiple users to edit and verify the Area Code field for every record in Employees.
I'd prefer to allow a user to view the records, say, 30 at a time (to reduce burnout).
How can I select 30 records at a time from Employees to send to the front end UI for editing, without letting multiple users edit the same records, or re-selecting a record that has already been verified?
I don't need comments on the content of the database (these are example table and field names).
One way to do this would be to add 2 more fields to your table, say for example assigned_to and verified. You can update assigned_to, which can be a foreign key to the verifying user, when you allow the user to view that Employee. This will create a record preventing the Employee from being chosen twice. assigned_to can also double as a record of who verified this Employee for future reference.
verified could be simply a Boolean field which keeps track if the Employee has already been verified and can be updated when the user confirms the verification
The actual selects can be done like this:
employees = Employee.objects.filter(assigned_to=None, verified=False)[:30]
Then
for emp in employees:
emp.assigned_to = user
emp.save()
Note: This can still potentially cause a race condition if 2 users make this request at exactly the same time. To avoid this, another possibility could be to partition the employee tables into groups for each user with no overlap. This would ensure that no 2 users would ever have the same employees

How to interact with Existing database with Model through template function in Django

I have an existing table called empname in my postgres database
(Projectid,empid,name,Location) as
(1,101,Raj,India),
(2,201,David,USA)
So in the app console it will have like the following
1)Projectid=Textbox
2)Ops =(view,insert,Edit)-Dropdown
Case1:
So if i write project id as 1 and select View Result:It will display all the records for Projectid =1(Here 1 record)
Case2:
If i write projectid as 3 and select insert it will ask for all the inputs like empid,name,address and based on that it will update the table .
Case3:
If i write projectid as 2 and select edit.Then it will show all the field for that id and user can edit any column and can save which will update the records in backend for the existing table
If there is not data found for the respective project id then it will display no records found
Please help me on this as I am stuck up with models
Once you have your models created, the next task should be the form models. I can identify atleast 3 form classes that you will need to create. One to display the information(case 1), another to collect information(case 2) and the last class to edit the information. Wire up the form to the views and add the urls.
A good reference could be a django a user registration form since it will have all the three cases taken care of.http://www.tangowithdjango.com/book17/chapters/login.html

How to remove the meta data field from multi id queries

I am using the open_graph Explorer tool to test this out and I need to be able to get the first_name, last_name and installed from 1000 users. At the moment I group up the users in grouped of 50 for a single query and batch them into up to 20 queries in a batch request.
A single query looks as follows
?ids=100003825998801,100003825998802,547884299,100003825998803,100003825998804,100003825998805,100003825998806&fields=first_name,last_name,installed
Now, the question is, when you use multiple ids in a single query like I did, facebook seems to "force" certain fields on you, large fields, such as "metadata" and "fields". Is it possible to remove these fields from the result set of the query?
Also, any advice on how to make this more efficient would also be great.
Thank.
Have you considered using FQL instead …?
SELECT first_name, last_name, is_app_user FROM user
WHERE uid IN (100003825998801,100003825998802,547884299,100003825998803,
100003825998804,100003825998805,100003825998806)
– that gives you just the info you want, you only have to watch out for the fact that the installed field is named is_app_user in FQL.