I need to hide Balance and Foreign currency balance columns on accounts page (Setup>Accounting>Charts of Accounts) for any other roles in this company besides the administrator.
I tried to create User Event Script for Account record type, I thought it could be used to zero out the balance fields get loaded. But my script wont get loaded until I edit an account. But I need my script to get loaded on Accounts list page. Please help!
The Chart Of Accounts list page is not scriptable with SuiteScript. Your best bet is to create a Saved Search where you filter out the accounts you don't want the other roles to see and grant them access to the Saved Search but not the Chart Of Accounts list.
Related
Has anyone figured out a solution to this? I seem to have gotten to the same conclusion with no solution.
If I were to go the my app's checkout page, the payintent is created in the backend (explained the process below). So no after the payIntent is created, if i open a new tab and go the menu and add a new menu item, firestore will show the new (correct) total, but since the payment intent is created stripe charges the old (wrong) total.
What I am doing is
Every time the page loads, I send a GET request to my backend which verifies the identity of the user (using firestore/firebase).
Checks if there is a payment intent (payement intents are stored in firestore corresponding to the user)
A. if payintent does not exist under user create one
B. if payintent does exist retrieve payintent from stripe and check if it has .status===succeeded. IF it has succeeded create a new one and if it has not succeeded update the old one. The amount for all payIntents is calculated using total in firestore
(and ofc if the users cart is empty a payintent is not created)
Send back to the frontend the payInent.clienSecret and cart items to populate page
From the front end using stripe elements and confirmPayment confirm the payment
(using ngrok the page loads in about 800-1200ms so not too bad i think)
Possible solutions are using webhooks, when payintent is processing check and update the pricing but that seems like duct taped solution (if it were to even work). OR using webhooks when payment has succeeded update the payment, again seems like a duct tape solution (if it were to even work).
EDIT: possible solution 3 cofirmPayment in the backend but according to documentation that takes away 3ds authentication which is the reason I am doing confirmPayment in the front end anyways
SOLUTION: The missing piece is that you need to update the Payment Intent's amount when something is added to their cart. Once you add that I think that will solve your issue.
So a function to create payment intent and update payment intent (when there is already a payment intent created) on add to cart. And then a final update paymentIntent on the checkout page whenever they delete an item or if they edit the item
Thank you Justin Michael
I'm not sure I completely understand your question. If you confirm a Payment Intent client-side using its client secret the Payment Intent will attempt to charge whatever the current amount set on it is. Stripe will never use a previous or "old" amount.
As far as a solution, I recommend you retrieve the Payment Intent client-side using Stripe.js when your customer clicks on your "pay" button and see if the currently-set amount on the Payment Intent matches what you're currently displaying to them. If it doesn't match abort the payment process, update your state client-side based on the latest version of the Payment Intent you just retrieved, prompt the customer to confirm the new amount, and ask them to click on "pay" again.
I have an idea of doing a back office for my website. The problem is that, when I introduce a user who has, for example, two roles, I want the user to choose the role to work with, but I can't figure out how to do that. I've tried so different things such as putting the two roles separate with commas in MySQL and separating them in PHP but it didn't work.
let say you have a user table, and a user can have multiple role.
you can create a master table for role ( let say roles )
you can have a field on user table say user_roles -> it can have values like 1,2,4
note:- there should not be gaps between the numbers / comma
on the front-end you can take a mutiselect / tags UI element to input role for the user.
to fetch the role of a user at server side - you can use explode() + in_array() to check the role if exists
comma separated example
EDIT:-
It requires validation when adding roles ( ie: which user's role is allowed to select when already selected specific types )
For authorization, the user's roles should be added to the session :- this will help when allowing the user to do tasks he is allowed to do.
you can take a third table to maintain user's roles ( as suggested by #ADyson ), this will help if you want to join tables based on user + roles but you will need to join roles table for getting user data when starting session for the user.
2 sides of the same link, left are admin, right is employee
The OrangeHRM framework works with 2 types of accounts, the admin and employee, the owner wants to add some functionality that's originally found only in the admin account to be added into the employee account. As such because many of the employees work in many different places and they need to change where they currently are each time they moved to a new place. And since the admin is not able to actively update those data, the owner would like the employee to change that data by themselves.
I hope its not too late.
You can do it by editing 'ohrm_user_role_data_group' table in the database.
Or Else you can enable other roles like Supervisor, ProjectAdmin, Interviewer, HiringManager, Reviewer in ohrm_user_role according to your need.
Currently doing a chat app where a user could join multiple chat groups, something similar to what Telegram and Facebook Messenger has. Pretty straight forward. We're mainly using Firebase database for storing the chat groups and message details.
Sample DB structure:
To only get the chat groups a user has:
root/
users/
chatGroups/
$uid/
$chatGroupId: true
We then get the details of the chat group from a different node, same with the latest chat message in that group:
root/
chatGroups/
entries/
$groupId/
group details here...
messages/
$groupId/
$messageId/
message details here..
Everything above to get the data for a single group item that looks something like this:
All works fine. We initially get at most 5 chat groups at first, then just sort the list. The problem lies where we have to listen for updates for the chat groups -- group with the most recent chat message would go to top of the list.
The structure we have listens only to the list of groups the specific user has -- we could detect groups joined (onChildAdded) and left (onChildRemoved) by the user, but it doesn't contain the timestamp we need to sort the chat group list by the most recent changes timestamp.
Has anyone tried this similar behavior with Firebase before (we're doing a client for both Android and Web -- Javascript)? Any ideas or suggestions would be appreciated. Let me know if you need some relevant details to make things clearer.
Because there is no auto-created metadata in Firebase about when a child was added, updated or deleted and also because those operations doesn't contain the information you are searching for, you need to create your own mechanism by adding the local timestamp for each operation or by writing a server-side timestamp.
There is another approach in which you can use denormalization. Add those chats to a new created section named uxChats. The chats will need to contain only the text message and the timestamp. If you are using FirebaseUI then you can reverse the order just using this lines of code:
LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity());
layoutManager.setReverseLayout(true);
layoutManager.setStackFromEnd(true);
recyclerView.setLayoutManager(layoutManager)
Latest chat goes on top.
Hope it helps AL.
I'm new on the SharePoint world and right now I'm facing a little adversity.
Right now I do have a list that represents a collection of books. I also created a button with JavaScript that will allow the users to order them for a temporary time.
For this matter when the user clicks on the button, it'll change some column values from that list item, such as: the status, order and return date, some counters... I tested with my account and everything was working fine until I remember that I do have the permissions to edit this list. However if it's a end user, he'll receive (correctly since they haven't permission to edit) the "Request failed. Access denied. You do not have permission to perform this action or access this resource" message and won't be able to order the book.
Well, I could give the permission to this users in order to edit the list, but that way they would be able to delete and edit some columns that they aren't suppose to.
Do anyone have any suggestion/solution?
Thanks in advance!
With this type of scenario, I would suggest using more than one list, so you can manage the books and orders separately. Also, create a workflow in SharePoint Designer that starts when an order is created. This workflow will perform the operations that you are doing in JavaScript.
Here's a basic implementation plan:
Book List - Give users read only permission to this list.
Book Order List - Give users Add permissions to this list. Add a lookup column to the Book List.
Book Order Workflow - Perform the management of the order and inventory statuses here. App Steps can be utilized to run specified actions in the workflow with elevated privileges.