cancel
Showing results for 
Search instead for 
Did you mean: 

UDO - UDF getting Items does not work

marour
Participant
0 Kudos

After hours and hours i give up and hope to find the solution with you guys.

I created an UDT -> defined some UDF in this table and then registered the whole thing as a master data to an UDO.

now i am trying to make some rules on this Object using Coresuite Optimizer which uses almost same syntax like SDK!

By trying to get specific Fields from this Object using this code for example

TextEdit.GetFromUID(pVal.Form, "22_U_Cb").Visible = false; 

where my Item ID is 22_U_Cb as i can see the system gives me an error Message because the Item cant be found.

is there any specific way to get my Items in case of UD Objects and fields?

when i use the same code to any System Object everything works fine.

Any suggestions or experiences about that?

Accepted Solutions (0)

Answers (4)

Answers (4)

marour
Participant
0 Kudos

Okay! i just tried everything again and it works with the FormActivate or even a Click but never work with FormLoad or Formdataload .. so when i open the Form everything is enabled and when i do something like a click the event works.

Not exactly what it has to be but its enough for now.

Thanks you guys

marour
Participant
0 Kudos

I tried the same Code for an Edittext Field and still the same Problem.

I habe the feeling that the Items become thier ID after the form load and the event or the rule goes on before SAP sets the IDs for the Items that is why they are not to find.

with the FormActivate i got some result but not when i open the Form! first when i click on another form and then back to my UDO then it works but i need it when someone opens the Form directly!

kai_f
Participant
0 Kudos

I think it depends on which "Event Type" you use.

Try it with "FormActivate"/"RightClick" and it should work.

I'm not sure which EventTypes also work but "FormActivate" works with .Visible.

TextEdit.GetFromUID(pVal.Form, "22_U_E").Value should work with all EventTypes.

Regards

Kai

kai_f
Participant
0 Kudos

Or maybe it is because you try to get a ComboBox as a TextEdit.

Try: ComboBox.GetFromUID(pVal.Form, "22_U_Cb").Visible = false;

rasmuswulff_jensen
Active Contributor
0 Kudos

Add-On B1 Usability Package from Boyum can do it easily with a simple Right-Click > Hide This Item so it is at least doable... Best guess is that CoreSuite can't react to the special Form Load event that happens on UDO (slightly different than normal screens), but not a Coresuite expert...