cancel
Showing results for 
Search instead for 
Did you mean: 

Create LinkedButton in form suppliers invoice

gpam
Explorer
0 Kudos

Good morning dear, my code is the following:

if (pVal.EventType == BoEventTypes.et_FORM_LOAD && pVal.BeforeAction ==false)
{

Form oForm = Application.SBO_Application.Forms.GetForm("141", 0);

Item i = oForm.Items.Add("btnlink" + valor.ToString(), BoFormItemTypes.it_LINKED_BUTTON);
i.LinkTo ="U_FIELD"; 
i.Height = 9; // To fit a linkbutton it should be 9 pixel high

i.Left = oItemName2.Left - 19;
i.Top = oItemName2.Top + 4;

// i.Top = oItemName2.Top - 1;//oForm.Height - (oItemName2.Height + 48);
// i.Left = oItemName2.Left + oItemName2.Width + 1; //+ 5
// i.Width = oItemName2.Width - 80;
// i.Height = oItemName2.Height + 1;
LinkedButton lb = (LinkedButton)i.Specific;
lb.LinkedObjectType = "30";
lb.LinkedObject = BoLinkedObject.lf_JournalPosting;

}

When I open more than 1 supplier invoice forms at the same time, the button only works on the first open form and the error Item Already exists appears on the others, please support.

Kind regards.

Accepted Solutions (0)

Answers (0)