Where is the Approval State?

catarinapereira
Tera Contributor

I created a new table named Order without a "State" field. I've set up a workflow, and created a "My Approvals" module. I now need to access the state of the approval in order to send an email if the state changes to "Approved".

I created a business rule for the table Order that runs a script if the condition "current.state.changesTo('approved')" is met. It's not working and I believe it's related to the fact that there is no State field in the Order table. I have no idea where the State that appears in My Approvals section is, or to what table it belongs.

Can anyone explain this to me?

Have a lovely day and thank you very much in advance.

5 REPLIES 5

Chuck Tomasi
Tera Patron

Hi Catarina,



I'm not sure I understand your entire table/field structure enough to answer this completely. I'm going to assume you created your extended table from the Task table and that state is inherited. If that's the case, then you also inherited the choices and other fields like approval.



It sounds like you need to modify the choices in those choice fields to meet your requirement needs.


Customizing Choice Lists - ServiceNow Wiki


Hey Chuck,



I managed to solve the issue by myself. When I created the Order table I didn't extend any table, so there wasn't any State field. However, the information I was looking for was on the default table "sysapproval_approver", I just wasn't looking in the right place. Thank you anyway for your attention, have a lovely week!


I'm glad you got your question answered.


Please mark the appropriate response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.



If you are viewing this from the community inbox you will not see the correct answer button.   If so, please review How to Mark Answers Correct From Inbox View.



Thank you for participating in the community.


kms
Kilo Expert

Hi Catarina,



Does Order table that you created extends any other table which have a field named 'State' ?



Please check that. This can be a reason





Thanks,


Shyama KM