cancel
Showing results for 
Search instead for 
Did you mean: 

Field Data Validation - Dependable or Cascading Fields

Former Member
0 Kudos

Hi,

Can you please help us on the below request?

Weu2019ve some hard time in triggering a script at the following scripting context.

Field Data Edit:

A script in which both the old and new values of a field are known. This script executes during tab changes, auto-refreshing fields, and when the document is fully validated, as with a field context.*

The script is not fired at this (Field Data Edit) scripting context. We couldnu2019t debug this and also we created a OSS message too.

Basically we want to create the dependency fields. For e.g. Field B (Value List) should be populated based on the selection of Field A (Value List)

Ps: There is a little descriptive doc provided to us by SAP but there is no detailed document with the working examples.

Thx

Sudhahar

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks Vikram!

Very usful & did teh workaround as you suggested.

Former Member
0 Kudos

Thanks Much Vikram for looking into this. Yes, that's a extension field (custom field.)

I tried the same for out of the box field also. It's working for the tab changes (e.g. From Header to Schedule) but our requirment is to create cascading / dependable field lists. For e.g. Field B (Value List) should be populated based on the selection of Field A (Value List). This is NOT working when the cursor/mouse leaves that Field A. That's the challenge.

We tried this and it's working for teh tab change

Document: Project

Field: Status (Out of teh box field)

Q: How to make a field as a auto-refreshing field?

"This will be addressed in 5.1 SP11 and 7.0 SP3. "

== Is this fixed in SP11?

== Can we go ahead & apply the SP11?

Thanks again

Sudhahar

0 Kudos

Hi Sudhahar,

Itu2019s not possible to make a field (standard or custom) auto refresh upon changing the value of the field. It is not supported. As you have seen, the end-user would have to take an action on the UI like switching tabs or clicking on save button.

Regards,

Vikram

Former Member
0 Kudos

Hi Vikram,

- Which business document and field on the UI is the Field Data Edit script tied to?

Project

- Do you have multiple instances of Sourcing in your landscape? If so, is the script not being fired on all instances? This could be a caching issue too.

No, we've only one instance.

- In your Field Data Edit script you could try simple debugging like setting a value on the Description field. Then change tabs and see if the description field is populated. This should tell you at least if the script is being triggered.

Yes, we exactly did the same. It's not triggered during teh tab change.

- The Field Validate script works a little different. It will execute when the document is u201Cvalidatedu201D which normally occurs when the object is saved.

Yes, this is working while saving the Project document.

But we want to implement the Dependable or Cascading Fields. For e.g. Field B (Value List) should be populated based on the selection of Field A (Value List)

Do you need the code snippet? (Same code is working in all other scripting context)

*****************************************************************************************************

import com.frictionless.api.common.log.*;

import com.frictionless.api.doccommon.masterdata.*;

import com.frictionless.api.ibean.*;

import com.frictionless.api.projects.*;

import com.frictionless.api.doc.*;

import com.frictionless.api.common.types.PriceIfc;

import com.frictionless.common.types.Price;

import com.frictionless.common.db.ObjectReference;

import com.frictionless.common.platform.ClassInfo;

import java.util.*;

//////////////////

debug = true; // set to true during dev/test to write to log

//////////////////

log = Logger.createLogMessage(session);

logInfo(message) {

if(debug) {

log.setLogMessage(message);

Logger.info(log);

}

}

logInfo("**** Project Field Tab Change****");

doc.getExtensionField("Deliverables").set("Project Foo");

deliver = doc.getExtensionField("Deliverables").get();

logInfo("**** deliver: " + deliver);

********************************************************************************************************************

Thanks

Sudhahar

0 Kudos

Hi Sudhahar,

I presume the field in question is an extension field.

Iu2019m looked into this and unfortunately this is a bug. Field Data Edit script works fine for out of the box fields but not on extension fields. This will be addressed in 5.1 SP11 and 7.0 SP3.

Regards,

Vikram

0 Kudos

Hi Sudhahar,

Your understanding of Field Data Edit script is correct. Field Data Edit script will be fired only when the request is submitted, meaning, when the user changes tab, auto refresh fields, etc. In your Field Data Edit script you could try simple debugging like setting a value on the Description field. Then change tabs and see if the description field is populated. This should tell you at least if the script is being triggered.

Also, it would be helpful if you could provide the following infou2026

- Which business document and field on the UI is the Field Data Edit script tied to?

- Do you have multiple instances of Sourcing in your landscape? If so, is the script not being fired on all instances? This could be a caching issue too.

The Field Validate script works a little different. It will execute when the document is u201Cvalidatedu201D which normally occurs when the object is saved.

Regarding documentation, I would encourage you to take look at the Scripting and Workflow guide on SMP, if you havenu2019t already.

Regards,

Vikram