cancel
Showing results for 
Search instead for 
Did you mean: 

Load object by a yellow arrow

Former Member
0 Kudos

Hello Forum,

I have extended a Service Contract with a TextEdit. In this Textedit is a newly created attribute shown.

I have added a DataBind to this Textedit:

NewTextEdit.DataBind = DataBind.CreateNew();

NewTextEdit.DataBind.SetBind(true, "U_MyAtt", "OCTR");

Now I create a new Service Contract in B1. I write a number (123) in this field and save the Service Contract. If I look into OCTR table, the new attribute has the value 123 in the correct row. I con go to the next Service Contract and back. The number 123 appears again. But now if I click the yellow arrow in the Service Call form, the Service Contract Form doesnt load with the number 123. Now I can go to the next SC and back, now the number appears again. What is the difference between loading by the arrow and loading "normaly"?

(Other UserDeff attributes for a Combobox Item worked on the same form. No events are running that could delete the content of the TextEdit.)

Thanks

Mark

Edit: After loading the Service Contract by the yellow arrow, the form is in update mode and not as expected in ok mode. If I add a second txt that shows the same DB attribute, both are set to 0.00 instead of showing 123.

Strange: If I save the 0.00 to DB and reload the Service Contract by the yellow arrow, then the forms loads into OK mode. Some function seems to set 0.00 into the TextEdit boxes.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mark,

may be that your new Item added is set to AffectsFormMode = true? Or some other stuff is set to this that set your Form to Update-Mode.

the linked Button need to have a "linkto" and as well(linkedObject) the BoLinkedObject.lf_ServiceContract should be set...

regards

Oliver

Former Member
0 Kudos

But thats correct: If someone changes the content of my textbox, the FormMode should be affected. If I look at the DataSource field, the value is also 0.0, instead of the correct value 123.

The yellow arrow comes from SAP. Its the arrow on the ServiceCall form which opens the contract. If I open the contract in this way, my textbox isnt filled. If I open the same contract with the search mode of the ServiceContract window, my textbox is filled.

Edit: Currently my workaround is to load the content of the textbox manually at startup one time.

Former Member
0 Kudos

Hi Mark,

it is not necessary to load the values manually. but please check your set bound and set it from

NewTextEdit.DataBind = DataBind.CreateNew();

NewTextEdit.DataBind.SetBind(true, "U_MyAtt", "OCTR");

to:

NewTextEdit.DataBind.SetBound(true,"OCTR", "U_MyAtt");

remark the first sentence...  if you add the Item as EditText there is a new instance of this comobejct already there

Change table and Field... and surround this with a tryCatch block... and see if there is an exemption in some case.

How does your LinkedObject looks like?


IItem oIItem = this.FormObject.Items.Item("yourNewTextEditID");

IEditText oIEdit = ((SAPbouiCOM.EditText)(oIItem.Specific));

// Golden Arrow

IItem oIItemNew = this.FormObject.Items.Add("NewLinkedObject", SAPbouiCOM.BoFormItemTypes.it_LINKED_BUTTON);

ILinkedButton oLinkBtn = (SAPbouiCOM.LinkedButton)this.FormObject.Items.Item("NewLinkedObject").Specific;

oLinkBtn.LinkedObject = SAPbouiCOM.BoLinkedObject.lf_ServiceContract;

oIItemNew.LinkTo = "yourNewTextEditID";


this.Formobject is just the capsulated FormObject...  and the position where the Linked button should appear...

I have more than 60 Fields added to OCTR... and everything works as expected...

Regards

Oliver

Former Member
0 Kudos

Hi Mark,

I had a short test in my dev env...

in Form 60126 I add a field U_TContractID

and bound it in the way posted previously

and after typing...

but you won't be able to add a clf to this Field!!! the field loads the value into the form... and the contract appears...

But Linked Button works fine ... and as expected...

Best Regards

Oliver

Former Member
0 Kudos

I'm using the Coresuite abstraction layer. I think there is something broken.

There is the command to bind it:

NewTextEdit.DataBind.SetBind(true, "U_MyAtt", "OCTR");

And st start, the DataBind property is null, so I have to add it.


I dont create the link button. Its the build-in B1-Button on the for ServiceCall before the ContractID textbox. I click it and the contract is loaded... except my newly added textbox on the contract form. The content is still "0.0".

Former Member
0 Kudos

Hi Mark,

ok that means it is not an b1 SDK thing? If you using the Coresuite Framework dll instead of using the B1 SDK...

in this case check the manual function "new Item" from Coresuite.. so you could check if this is a behavior of Coresute... and may be ask your question at Coresuite support webpage again... there you get direct support form core suite people...

The B1 sdk works as expected... or post a bit more code... I test this with the Customizer of Coresuite and this works as well... but I really don't know what Coresuite is doing to match the Code to B1SDK...

In the past I hade some issues with core suite and they give you a feedback very soon...

Regards

Oliver

Answers (0)