How to hide a field
walid belahmer
Hello,I'm a beginner in Core Suite Customize and I don't know very much the C# code.
Here is my issue :
I created a new tab (Tab_1)in the Business Partner Master Data (using optmization).
I created two fields A and B in the new tab Tab_1.
Those two fields are linked to two UDFs : U_DFA and U_DFB from the Business Partner Master Data (using create new objects).
The goal is to hide the field B if A is empty.
Could you please tell me what's tho code to use to hide a field and where do I have to put the code? (in the Tab_1 code may be?)
I looked at the several samples topics but I didn' find anything helping me to solve my issue.
Thanks a lot for your help.
Kind regards,
Walid.
walid belahmer
Hi again,I will simplify mu request and hope I will have an answer this time.
I created a field using "New Objects" module. I'd like to hide this new field following a condition (using C# or VB code).
if anyone has an interesting example that could help me, please don't hesitate to send it to me.
Kind regards,
Walid.
Manuel Marhold
Hi Walid,.Visible=True/False
or
.SetAutoManagedAttribute()
walid belahmer
Hi Manuel,Thanks for your answer.
I know that the "visible" property is the one which I have to use.
But what I don't understund is how to apply this property to a field which has not been created by the code and doesn't exist in the script.
So the question now is: how to declare a variable in the script which refers to an SBO variable ?
Thanks a lot for your help.
Kind regards,
Walid.
Hafid OUCHEN
Hello,I'm a beginner in Core Suite Designer, could someone explain me in details how to convert amount to words in invoice document, I tried several scripts existing in this forum but it doesn't work :bang:
Thanks a lot for your help.
Ouchen
Manuel Marhold
Hi Walid,the field in the form is no variable..
EditText.GetByFormAndID().Visible=false
or sometihng like that. Place the form and the ID of the item into the funtion an you get the field of the form.
You can get the item id by activating "View"-"Systeminformation" in SBO an place the cursor over the item and take a look in the bottom left corner of SBO.
walid belahmer
Hi Manuel,Thanks for your answer but what you suggested me doesn't work.
I tried with :
TextEdit.GetFromUID(pVal.Form.UDFForm, "U_Test_2").Visible = false;
or
TextEdit.GetFromUID(134, "U_Test_2").Visible = false;
because the form is 134: BP master Data
or
TextEdit.GetFromUID(134, "U_Test_2").Visible = false;
But nothing happened!
Could you please see what could be the issue.
Thanks a lot for your help.
Kind regards,
Walid.
Manuel Marhold
Hi walid,you try to make fields in the UDF-Form invisible?? I think thsi is not possible this way..
you can managed the visibility of the field in the UDF-Form by Extras -> customizings tools..
walid belahmer
Manuel,I think you didn't understand my objective.What I want exactly to do is:
I want to hide a Field created by Customize on the BP Master data Form. This field refers to a UDF in the form. I must hide it using the code because I will use some conditions before hiding it.
i think the GetFromUID will help but may be I don't use it on the right way...
Any idea?
Kind regards,
Walid.
Manuel Marhold
Hi Walid,that is correct.
The GetFromUID requieres the form-object where you want to get the item from.
You want to hide an field on the BPMasterDataForm, which you don't give to the function.
You give the UDF-Form or the FormType (which is depricated, you have to use FormTypeEx, which is a string, not an integer), but in this case, you need to give the BPMasterDataFormObject, which should be pVal.Form.
walid belahmer
Hi Manuel,So what will be the correct syntax if the form is 134 and the field to hide is U_test_2 ?
Thanks for your help.
Kind regards,
Walid.
Manuel Marhold
Hi Walid,i already wrote it in my last answer, not the code, but what you have to change..
I try to help you for selfhelp..
but..
TextEdit.GetFromUID(pVal.Form, "U_Test_2").Visible = false;
schould work
walid belahmer
Hello Manuel,I tried this:
TextEdit.GetFromUID(pVal.Form, "U_Test_2").Visible = false;
pVal.Form.Update();
return false;
I put it in the script of an optimisation on the BP Master Data Form but nothing happens!
Is there something special we must do to let this property work?
thanks for your help.
Regards,
Walid.
Manuel Marhold
Hi Walid,which optimisation?
Is this field on a tab/does if have FromPane and ToPane given?
If so, you have to hide the field if you click on the tab, so you have to catch the ItemPressed event, check if the presseditem is the tab where you field is in and then hide the field..
0
Please sign in to leave a comment.
Comments
0 comments