Saving Part of Message Into a Variable
Posted: Fri Sep 06, 2013 4:37 pm
So here's what happens in the application. When case information is entered completely and is saved, the following confirmation message should appear:
When the case is saved, the case number is auto-generated a random number/combination and assigned to that case. So in that confirmation message I need to just extract the "F2-13-000153" portion of the message and save it into a variable that I can use later to enter this case number into a case number field when I later perform a case search.
Ideally, if I could also use this variable with the case number saved, in continuation to another recording (i.e. creating a case and then searching for a case) that would be great.
So far this is what I have to get the text value:
As of now I'm thinking of first assigning that accessible value to a string, and then splitting the string and storing just the CaseNumber into a separate Variable. However when I tried to use this "FullCaseSuccessMessage" variable that I set again, it appears to come out as null.
If someone could help me with writing the code for this, that would be awesome.
Thanks.
When the case is saved, the case number is auto-generated a random number/combination and assigned to that case. So in that confirmation message I need to just extract the "F2-13-000153" portion of the message and save it into a variable that I can use later to enter this case number into a case number field when I later perform a case search.
Ideally, if I could also use this variable with the case number saved, in continuation to another recording (i.e. creating a case and then searching for a case) that would be great.
So far this is what I have to get the text value:
Code: Select all
Accessible accElement = new Accessible(repo.MessageBoxDialog.CaseSuccessfullyCreatedWithCaseNumb);
string FullCaseSuccessMessage = accElement.Value;
If someone could help me with writing the code for this, that would be awesome.
Thanks.