cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Asset Manager 2010 - How to get the value of input field

0 Kudos
268

Hello,

I'm trying to add a validation on the "Take Readings" screen for a custom create notification button - when the user hits the create notification button, it should be created only if the input value for Note field (ShortTextNote) is entered for a particular reading or else should display an error message. Can you please let me know how to instantly know if there is a input value entered for the Note field for a particular reading? Attached a screenshot for reference.sam-take-readings.png

Tried the below statements, but I'm always getting empty value even a value is entered by user on Note field.

1. let notes = libCommon.getControlProxy(context.getPageProxy(), 'ShortTextNote');

2. let notes = libCommon.getFieldValue(context, 'ShortTextNote', '', null, true);

3. context.binding.ShortText;

None of the above statements worked. please suggest me the correct statement to use?

Thanks in advance!

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

srgangireddy

Were you able to resolve your issue? If any of the below responses helped you, then please mark the helpful answer by accepting it OR post an answer so others might benefit from your findings and then close this discussion.

Regards,

Jitendra (SAP Community Moderator)

View Entire Topic
Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

You can check the Note field value via

let notes = context.getPageProxy().getControl('FormCellContainer0').getControl('FormCellNote0').getValue();

FormCellContainer0 : Form cell container name

FormCellNote0: FormCell Note control name
Or if you are using FormCell container on a section page,

let notes = context.getPageProxy().getControl('SectionedTable0').getControl('FormCellNote0').getValue();
0 Kudos

Hi Jitendra,

Thanks for the quick response. I've tried using the below statement to get the Note value from MeasuringPointsDataEntry.page but I'm unable to retrieve any data with this.

let notes = context.getPageProxy().getControl('FormCellContainer').getControl('ShortTextNote').getValue();

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

srgangireddy

Can you share metadata for Take Reading page and rule where you have used JS logic?

0 Kudos

I've attached the page and rule here. Please check.