Hi Everyone,
I have created log in page where i put user id and password to log in my application.
on logging in my app, only current logged in user id should view his only records.
On Log in button formula used:
If(!IsBlank(LookUp(Employees,'Personnel number'=TextInput1_1.Text)),Set(varAuthenticator,LookUp(Employees,'Personnel number'=TextInput1_1.Text)));If(TextInput6_1.Text = varAuthenticator.Password && TextInput1_1.Text = varAuthenticator.'Personnel number',Navigate('Repair Order Details screen_2',ScreenTransition.Fade,{'Personnel Number':"Technician"+Set(varsite,LookUp(Employees,'Personnel number'=TextInput1_1.Text))}),
Notify("Invalid username or password",NotificationType.Error));
Reset(TextInput1_1);
Reset(TextInput6_1);
Set(showLabel,true);
What logic should I put on login button that only Employees table where user id of employees should give only current logged records.
Employees used from D365 .
Hi @jasirqadri123 ,
I think you have already all you can do on the Login button by passing a context variable with the personnel ID to the 'Repair Order Details screen_2'. At that screen you'll have to set up some filtering that uses that context variable.
What is the formula please or code to insert on log in and on Repair Order Details screen_2 also
Hi @jasirqadri123 ,
As mentioned I don't think you need to do anything on the LogIn screen. Since I don't have any details on Details screen_2 or your data source I really can't tell anything more detailed, so please share:
What controls are you using on Details screen_2 to display order information?
How are orders linked to employees in your data source?
A screenshot of Repair Orders Details screen_2 will help as well.
Gallery I am using where on items I have put this formula,
SortByColumns(If(sortAll,Filter(RepairOrderTables,WarrantyStatus = Dropdown.Selected.Value && Site = varsite.Site && (If(techAll,Technician = Dropdown1_1.SelectedText.Value,Site = varsite.Site))),Filter(RepairOrderTables,Site = varsite.Site && (If(techAll,Technician = Dropdown1.SelectedText.Value,Site = varsite.Site,If(!IsBlank(DatePickerStart.SelectedDate) && DatePickerStart.SelectedDate <= DatePicker.SelectedDate,RepairOrderDate <= DatePicker.SelectedDate && RepairOrderDate >= DatePickerStart.SelectedDate,RepairOrderDate <= DatePicker.SelectedDate))))),"RepairOrderDate",If(SortDescending1,Ascending,Descending),"RepairOrderId",Descending)
Orders are linked in D365 to Employees through varsite.Site which is already define.
Hi @jasirqadri123 ,
Looking at the code you have to define varSite.Site, it does indeed not contain site information, but employee information:
Set(
varsite,
LookUp(
Employees,
'Personnel number'=TextInput1_1.Text
)
)
When I then look at your filter I see you are already using that:
...Filter(
RepairOrderTables,
WarrantyStatus = Dropdown.Selected.Value &&
Site = varsite.Site &&
(If(....
Apart from it being confusing to use a variable called "Site" to store Employee information, how is this supposed to work?
User | Count |
---|---|
260 | |
127 | |
101 | |
49 | |
47 |