Skip to Content
0

enControlName

Nov 19, 2017 at 09:51 PM

40

avatar image
Former Member

Hi,

i'm new to this SAP B1 SDK.....

was doing a sample project... and had to write the below code.

SAPbouiCOM.EditText oEditCustomerCode = (SAPbouiCOM.EditText).Items.Item(enControlName.CustomerCode).Specific;

But i cant get enControlName. Is that because i forgot to add any specific lbrary function or something. Pls help me with it.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
ANKIT CHAUHAN
Nov 22, 2017 at 01:45 PM
0

Hi Royin Rufeesh,

"enControlName" is nothing just a value type or you can say an struct. Here is how you can define it:

private struct enControlName
{
    public const string Code = "3";
    public const string Name = "5";
    public const string ProjectCode = "7";
}

Basically, the idea to use it is that you can have the unique ids of the items on the form in a struct and later you can reference it anywhere instead of repeating unique id everywhere.

So now, you can use either one of the way:

1. SAPbouiCOM.EditText oEditCode = (SAPbouiCOM.EditText).Items.Item(enControlName.Code).Specific;

2. SAPbouiCOM.EditText oEditCode = (SAPbouiCOM.EditText).Items.Item("3").Specific;

Hope it helps!

Kind regards,

ANKIT CHAUHAN

SAP SME Support

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Thank you Mr.Ankit

Can you please explain what is this 3. is it the UID of EditText ?

0

Hi Royin,

Yes, you got it right.

Kind regards,

ANKIT CHAUHAN

SAP SME Support

0