Solved

Exception in Validation type workflow

  • 15 November 2023
  • 8 replies
  • 254 views

Badge +3

​Hi,

I'm trying to implement a workflow in which I will be giving an error msg if a custom field doesn’t contain a value when a condition met(Customer used conditional fields in APP9 to set mandatory the field as below and trying to achieve same using workflows in cloud since conditional fields are not available in cloud).

To achieve this, I have created a validation type workflow as below and when I try to create a document revision using the New document revision assistant I’m getting an error as below(When I try to create a Document Revision using the Document Revision window it’s working as expected).

 

Many thanks for your inputs on this issue.

Best regards,

Uvini

icon

Best answer by JoDe 24 November 2023, 17:53

View original

8 replies

Badge +3

When I try to create a Document Revision using the Document Revision window it’s working as expected.

 

Userlevel 3
Badge +5

Hi, 

In the exception it says the “DocNo” value is not coming in as an input to workflow. you may need to enable that attribute on the event to make it available to workflow. 

 

You can also check which attributes gets passed into a workflow by using “Start Watch” option on the workflow when executing and checking the observations. 

Badge +3

 

@kamnlk Include in Sale Force Report is a custom field and I’ve created the event for the DOC_ISSUE_CFT as below and since I don’t have that attributes in my list I tried to use ROWKEY and  get the details as below. Now  I’m not getting the expected results(error msg when the value is null in the custom field and doc class like CONTENT%)   . any inputs on this ?

Userlevel 3
Badge +5

I don't think row key is supported from the DocumentRevisionHandling API. that could be the case

would it be possible to enable doc_no in the event attributes?  from the screenshots it seems only rowkey and CF$_SP_INCL_IN_SFORCE_RPT is enabled as attributes. 

Badge +3

@kamnlk Thank you for the quick response .Since I’m using DOC_ISSUE_CFT(not Tab) I’m not able to enable doc_no from the event .Also  I’m not able to add it as a custom attribute since there is not standard method to fetch doc no using the rowkey.I’ve attached the workflow ,field and the event herewith. (As the workflow is currently broken, we are implementing this requirement with a plsql type event for the time being.)

Userlevel 2
Badge +9

Hi @EntUviniG

We I've had a similar problem in the past. In this case, make sure that you pass the NEW:ROWKEY value.

Also add a custom field on the entity DocIssue Read only → Expression v.objkey

After publishing this you can do a read on the document issue set using the filter cf$_objkey = ‘${ROWKEY}’

 

This should retrieve the specific record you're looking for.

 

Userlevel 2
Badge +9

Hi 

I'll add the necessary fields in the attachment but for the example please follow this step plan.

  1. Step 1 upload and deploy the bpmn workflow file.
  2. Import the custom fields through “import configuration file(s)” Publish these custom attributes on entity configuration (Entity DocIssue).
  3. Under the Entity configuration on the DocIssue entity, select additional views at the top and enable the DOC_ISSUE_REFERENCE.
  4. Synchronize the configuration at the top of the screen
  5. Import the custom event through import configuration file.

Now for the explanation. The custom attributes are linked to the core table through the Objkey view column. 

IFS filters out the objkey's for the end users because these are DataBase GUID's and end users have no use for them.

 

After setting this up you can create a custom event and action on the CFT (CustomFieldTable) where you will pass the NEW:ROWKEY value. 

Now for the workflow part, I've made a simple example. The first step is a projection action where we will filter on the newly created custom attribute showing the objkey:

This will bring back a JSON array with 1 record (being both _TAB & _CFT). In the next step we will retrieve the variable and check if it is null.

In my example the result will never be null because the Cf_Sp_incl_In_Sforce_Rpt will always contain the ‘example’ value. But I hope you get the idea

Badge +3

@JoDe Thank you so much for the detailed explanation and it’s working as expected now.

Reply