Auto generate case number from section field and date
I am new to BPM Online(And C#). I just registered a 14 day free account to try it out.
I want to use the sub process to create a case number when a new record is created on a section. Please see the image below:
When the new record is saved the process starts and reads the zone filed from the request record as depicted below:
Upon reading the zone field I then assign the zone filed to the zone process variable using the formular task as depicted below:
I then use the zone process variable to formulate the case number in the code script as depicted below:
string unique_numer = DateTime.Now.ToString("yyMMddhhmmss"); string zone_val = Get<Guid>("zone").ToString(); string case_number=(zone_val+"-"+unique_numer) Set("case_number",case_number); return true;
The challenge I am facing is to get the value of the selected lookup zone field to store the value into zone_val string filed.
How to get the selected value from the zone lookup filed using C# code. The value that I get is a Guid data type and cannot get the value of the lookup.
I need to store the generated CaseNumber to the case_number field in the database as depicted below:
You help will be highly appreciated as I am currently stuck.