Bitrix24 Community

Support » Forum » Bitrix24 general questions » Help needed in Custom fields In cloud version
Pages: 1
RSS
Help needed in Custom fields In cloud version, Any option in bitrix that can make custom fields related to user profile
Hello,

    I have encountered a problem regarding business process in Bitrix. I
have made a leave management business process in which it takes approval
from the user's supervisor and then hr and if his request is accepted it is
added in the absence chart with its leave type..
                 My problem is that i want to add conditions in the
business process(e.g:user can only apply for 5 sick leave.if more than 5
then reject). My question is how can i make variables and associate it with
the user who runs the process so that his leave type information can be
stored and it could be use later to compare with. Hope you can help me out.

thank you.
Workflows run on a single element of an "info-block". If you're using the cloud, this is not a term that you would see much, but in the on premise version, it is common.  An info-block can be thought of as a List.

It is not possible to obtain data fr om an external object (such as a user profile) fr om a workflow (unless you use the php coding block that is avalable only in the on premise version).

However, you could use a state-driven workflow to accomplish this effect, even in the cloud.  I would suggest states like this:    "No request" and  "Request approval" and "Request fulfillment" -- wh ere the workflow is in the 1st state until the user performs the action of sending a request, then it is submitted for approval. When approved, the "request fulfillment" stage creates the absence chart entry and adds 1 to the "Sick leaves taken" variable. This way, that variable is always available to the workflow.  Access permission (for the requestor) would need to be carefully permitted and denied in the various stages).

The "problem" would be that each employee would have 1 workflow "assigned" to him and that workflow would basically never stop running. The workflow thus created would show a list to the HR and/or other managers wh ere each employee has a single element in the list.

This perhaps could be accomplished with sequential workflows, but I think that access issues would arise (the user might be able to edit the number of Sick leaves himself).  
The thing is that i want to make this sick leave allowed variable for every user and give him 10 sick leaves annually....if the user then request sick leave the business process condition would check that variable if his sick leave is not zero he is granted sick leave and the sick leave variable will minus the number from the sick leave from it.  
Not a problem. The initial value would be 10 and the Fulfillment stage would just subtract. Checking the value of that variable is a simple condition fork.  
So if i make this variable in the Business process and assign the number 10 to it...when ever the business process is run the variable will always be 10 and subtracting it wont be of any difference because it will always be initialize to 10 whenever the bp is run for the user..so how can a make this variable ONE time and assign it the all the user in my system so for each user this variable is different and then we can keep a record of their sick leave left number
No so. As I mentioned, these are state-driven processes and each user will really only have 1 that never really ends.  It will move from state to state as requests are made, so the variable will not reset since the process starts only once.  That was what my note about "the only 'problem'" was in my original post.  
Pages: 1
2,000,000+
organizations
are already using Bitrix24