ChooseFormList and EditText

Hi,
I want to populate 2 edittext whith the "ItemCode" and "ItemName".
On the first edittext ("edt1"), i put an ChooseFormList (CFL) and near it a linkedbutton CFL ("btnCfl") and finally then second edittext for the ItemName ("edt2")
On the event et_CHOOSE_FROM_LIST and not BeforeAction :
Dim objCFLEvent As SAPbouiCOM.IChooseFromListEvent
Dim strUID As String
Dim objCFL As SAPbouiCOM.ChooseFromList
Dim objDataTable As SAPbouiCOM.DataTable
Dim strValue As String = ""
objCFLEvent = ItemEvent
strUID = objCFLEvent.ChooseFromListUID
objCFL = objForm.ChooseFromLists.Item(strUID)
'' Get the CFL selection ("ItemCode")
objDataTable = objCFLEvent.SelectedObjects
strValue = objDataTable.GetValue(0, 0)
If (pVal.ItemUID = "edt1") Or (pVal.ItemUID = "btnCfl") Then
   ' Set the UerDataSource on  the first Edit ("edt1")
           objForm.DataSources.UserDataSources.Item("edt1DS").ValueEx = strValue
   ' Get the second colums for the "ItemName" of the CFL
   strValue = objDataTable.GetValue(1, 0)
   ' Set value to the second Edit ("edt2")
   objItem = objForm.Items.Item("edt2")
   objEdit = objItem.Specific
   <u><b>objEdit.Value = strValue</b></u>
End If
For the "ItemCode", no probleme but,
at underlined bold line, if i push [Tab] on the first Edit ("edt1"), the CFL form open, i select an item, and i've got an error : "General Failure - SAPBouiCOM.IEditText.set_Value(String pVal)"
But if i click on the linked button, i'vent any error !!!
Please help me.. it's my first addon !!
PS: I use SAP BO 6.80 (2005A)

Here are som sample code:
Create CFL
ChooseFromListCreationParams cflCreator = (ChooseFromListCreationParams).sboApplication.CreateObject(BoCreatableObjectType.cot_ChooseFromListCreationParams);
cflCreator.UniqueID=”BOY_CFL1”; //UID for the CFL
cflCreator.MultiSelection = false;
cflCreator.ObjectType = ”4”; //See Bolinked object
SAPbouiCOM.ChooseFromList cfl = Form.ChooseFromLists.Add(cflCreator);
EditText et = (EditText)Form.Items.Item(”BOY_1”).Specific; //Must have alphaNumeric datasource
et.ChooseFromListUID = "BOY_CFL1";
et.ChooseFromListAlias = "ItemCode";
Catch CFL
if(pVal.ItemUID=="BOY_1" && pVal.EventType == BoEventTypes.et_CHOOSE_FROM_LIST) {
  ChooseFromListEvent cflEvent = (ChooseFromListEvent)pVal;
  string cflUID = cflEvent.ChooseFromListUID;
  if(!pVal.BeforeAction) {
    DataTable dt = cflEvent.SelectedObjects;
    if(dt!=null) {
      string værdi = dt.GetValue("ItemCode",0).ToString();
      eventForm.DataSources.UserDataSources.Item("BOY_UDS1").ValueEx = værdi;

Similar Messages

  • How to unload the info of a matrix and a EditText to the tables

    Hi, I'm new in SDK SBO and i don't know how to unload the matrix info and EditText Value. I'm using Data Tables... if you can help me...
    Thanks!

    systems tables! .... and other question... i have the info in one table and i have to do a insert in a new table... how do i do it??? example:
    this are my dataSources 
    objForm.DataSources.DataTables.Add("OITT");
    objForm.DataSources.DataTables.Add("OITM");
    objForm.DataSources.DataTables.Add("ITT1");
    this is my matrix and my EditTexts
    matriz.Columns.Item("c_cod_art").DataBind.Bind("ITT1", "Code");
                        matriz.Columns.Item("c_cant").DataBind.Bind("ITT1", "Quantity");
                        matriz.Columns.Item("c_almacen").DataBind.Bind("ITT1", "Warehouse");
                        matriz.Columns.Item("c_descrip").DataBind.Bind("ITT1", "Description");
                        txtCodPro.DataBind.Bind("OITT", "Code");
                        txtDescri.DataBind.Bind("OITM", "ItemName");
                        txtCant.DataBind.Bind("OITT", "Qauntity");
                        cmbAlmacen.DataBind.Bind("OITT", "ToWH");
    i'm a need to unload the info in others tables!... i know that i can not do insert.. how can i do that

  • Dialog Resource Editing and Control Definitions

    Anyone know where I can get some (possibly ancient) documentation on the standardized controls that are recognized in the Dialog Resource File (that can be used in the DITL section).  Obviously by looking at the samples, I can see that StaticText, UserItem, Control and EditText exist.  It would be nice if I could find some documentation of the CNTL parameters as well.  (Working in OSX using the CS4, CS5 SDKs).
    Apologies if this has been answered elsewhere, I did multiple searches and didn't key off anything that came up.
    Thanks for any leads in advance!

    I believe there's a table in adm-guide.pdf in the CS3 SDK. It doesn't seem to be in the later ones that I can see. I'd post it but I dont' think I can attach a file here. Just go to the website and get the CS3 SDK and you'll find it in the docs folder off the root.
    And just so you're not surprised by this later -- note that the ADM is deprecated and will not be available in the next version of Illustrator after CS5.5 (or 5.1 as its listed in AI's help menu).

  • Document Numbering Issue in user defined form

    Dear All,
    There is UDO with manageseries = true. Series and DocNum fileds are binded to database (Combobox And Edittext). I can easly get next number and assign to Docnum field while selecting series from Combobox. The problem is when i choose series diferent than default and add document i get warning message "The actual posted document number is :XXXXXXX". No matter which series i choose system always takes default one. I found other threads accourding to this issue but no solution found.
    Regards,
    Guru

    Hello,
    How guru. Is your problem solved? As i'm have a similar peroblem -
    I have created a user form using screen painter and want to save data to my user defined table -
    Document - U_OPCD
    Document Rows - U_OPCD1
    First i was using the SAPbobsCOM.UserTable object to save data to my usertable. But after registering it as a UDO (as i wanted document numbering series for it) i'm unable to save data using this SAPbobsCOM.UserTable object. As i'm uable to access the default fields (DocNum, DocDate, Series....)  added to the table by SAP.
    Can u help please?

  • Is it possible to populate listbox/dropdownlist items using loadXML method?

    Is it possible to populate listbox/dropdownlist items using loadXML method? (If I have xml data in some string variable)
    Any sample?
    Thanks

    Hi Steven,
    Yes, Its possible which behaves as system CFL.
    Design the form like cfl having grid, choose button, cancel button and edittext of find. When you tab on edittext on form open the CFL form and after load form fill the grid by Datatable using sql query. Write code for select grid line on click of grid. Write the code on choose button which retrive value from grid.
    Thanks,
    Mahesh

  • AddChooseFromList in Matrix

    With this code, I create a textbox with search option. But how to do this for all the lines of a column of the Matrix? I want to be able to do this research study in each row of the matrix, Naque column.
            SAPbouiCOM.EditText oEdit = null;
            SAPbouiCOM.FormCreationParams oCP = null;
            oCP = ((SAPbouiCOM.FormCreationParams)   
           (SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_FormCreationParams)));
            oCP.UniqueID = "CFL1";
            oCP.FormType = "CFL1";
            oCP.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Sizable;
            oForm.DataSources.UserDataSources.Add("EditDS", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 254);
            AddChooseFromList();
            //  Adding a text box
            oItem = oForm.Items.Add("EditTxt", SAPbouiCOM.BoFormItemTypes.it_EDIT);
            oItem.Left = 147;
            oItem.Top = 170;
            oItem.LinkTo = "StaticTxt";
            oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
            oEdit.DataBind.SetBound(true, "", "EditDS");
            oEdit.ChooseFromListUID = "CFL1";
            oEdit.ChooseFromListAlias = "ItemName";

    Hy Harley,
    I try to explain better.
    Excuse me for my English.
    Correct me if I made a mistake.
    You want add a ChooseFromList to a Matrix Column. Right?
    You also know how create a ChooseFromList. Right? There are another thread owened by you where you learn it. See in the code inside your AddChooseFromList() method.
    So the steps are the following:
    1) In the form you need to add a Matrix, not an EditText like the first snippet you post.
    1.a) with the reference to the form oForm, access to the ItemsCollection oForm.Items and use the method .Add() in order to add the Matrix. This is shown on the first part of my snippet.
    oItem = (SAPbouiCOM.Item)(oForm.Items.Add("MTX01", SAPbouiCOM.BoFormItemTypes.it_MATRIX));
    oMatrix = (SAPbouiCOM.Matrix)(oItem.Specific);
    2) You need to add some columns to the matrix. For example you should add the CardCode, the CardName and other information
    oColumn = oMatrix.Columns.Add("CCODE", SAPbouiCOM.BoFormItemTypes.it_EDIT);
    oColumn = oMatrix.Columns.Add("CNAME", SAPbouiCOM.BoFormItemTypes.it_EDIT);
    2.a) So you have said: "Add two columns of Edit elements and call this columns respectively CCODE and CNAME"
    3) Now you need to attach the ChooseFromList you made,  to your column (In SAP B1 you can't attach a ChooseFromList to a single cell so we can dispel you initial doubt).
    3.a) Suppose you made two ChooseFromList named CFL01 and CFL02 for the Business Partner. (I suppose they were made in your AddChooseFromList() method), so we need to add just two rows of code for each matrix column.
    // THE CODE WE SEEN BEFORE
    oColumn = oMatrix.Columns.Add("CCODE", SAPbouiCOM.BoFormItemTypes.it_EDIT);
    // THE CODE TO ATTACH THE CHOOSEFROMLIST
    oColumn.ChooseFromListUID = "CFL01"; // The unique identifier of the ChooseFromList you want attach to the column
    oColumn.ChooseFromListAlias = "CardCode";
    // THE CODE WE SEEN BEFORE
    oColumn = oMatrix.Columns.Add("CNAME", SAPbouiCOM.BoFormItemTypes.it_EDIT);
    // THE CODE TO ATTACH THE CHOOSEFROMLIST
    oColumn.ChooseFromListUID = "CFL02";
    oColumn.ChooseFromListAlias = "CardName";
    There are no difference between creation of ChooseFromList for and EditText and a ChooseFromList for a Column in a Matrix.
    In your first snippet the Matrix doesn't appear, the columns didn't appears.
    Then in your Item Event Handler, you need only to refers to the cell instead of the EditText.
    I think to have give you the necessary code to understand the process and I hope to have well explained it to you. There are also an example on the .chm help files. Please search for the Column object and observe it's Methods and Properties.
    In the case my explaination is not clear please excuse me but probably I have not well understand your real difficult.
    Hope this helps.
    Regards
    Carmine
    Edited by: Carmine Cairo on Aug 11, 2011 7:34 PM

  • Is it possible to populate recipient email as a drop down so that the results go directly to them upon submission of the form?

    I know that the 'email' feature can be added but it requires you to input the recipients name manually.  Instead, I'd like to add the email recipients in order to choose from a drop down.  Is there a way to do this?

    Hi Steven,
    Yes, Its possible which behaves as system CFL.
    Design the form like cfl having grid, choose button, cancel button and edittext of find. When you tab on edittext on form open the CFL form and after load form fill the grid by Datatable using sql query. Write code for select grid line on click of grid. Write the code on choose button which retrive value from grid.
    Thanks,
    Mahesh

  • Is it possible to populate a Choose From List manually?

    Hi
    I've got a requirement in a SDK screen that needs to be written to have a Choose From List contained on a Matrix column that should allow the selection of Item Masters as well as the selection of specific data contained within a User Defined Table. Whenever using ChooseFromLists I've always only ever used them to link to a object such as Items, Sales Order etc. and not a combination, or even to a User Defined Table. Is this even possible.
    If not I guess the only way around it would be to create a form mimicking the ChooseFromList which I could populate with what ever I like?
    Thanks
    Steve

    Hi Steven,
    Yes, Its possible which behaves as system CFL.
    Design the form like cfl having grid, choose button, cancel button and edittext of find. When you tab on edittext on form open the CFL form and after load form fill the grid by Datatable using sql query. Write code for select grid line on click of grid. Write the code on choose button which retrive value from grid.
    Thanks,
    Mahesh

  • Limit Data Entry to 2 Digits after the Comma

    Hi
    I've an Form with Matrix and EditText Columns.
    The columns are bound to Userdatasources.
    When changing the type of the userdatasources i'm able to limit the displayed digits to 2 places after the comma. But it's only  a visual representation as it seems because i'm still able to enter more than 2 digits after the comma.
    Any suggestions?
    Thanks

    It's getting even worse. When entering more than 4 digits after the comma Business One crashes hardly (UI Server - Message)
    I'm using an Userform as described before with 2004 PL34
    Will try to reproduce it with an minimalistic sample but maybe somebody has an idea.
    No one?

  • How to open and edit "*.txt" file with "Notepad"

    Hello guys!
    I'm facing problem with SharePoint 2010 Enterprise and got no clue how to solve it.
    What I want to do is to open "*.txt" (which is placed to "Documents Library") in "Notepad", so I could edit it and save (publish) directly to SharePoint from "Notepad".
    If I upload any Microsoft office File, such as "*.docx", "*.xls", etc - it works as it should - document opens in appropriate application and everybody is happy.
    But, when I create documents library, put some "*.txt" file there and click on it - it opens in new browser's tab as text, so I cannot edit the file.
    What I tried to do is to activate feature "Open Documents in Client Applications by Default" - not happy.
    Edit "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML\DOCICON.XML" - I've modified "txt" entry as follows:
    <?xml version="1.0" encoding="utf-8"?>
    <DocIcons>
        <ByProgID>
        </ByProgID>
        <ByExtension>
    <Mapping Key="txt" Value="ictxt.gif" EditText="Notepad" OpenControl="SharePoint.OpenDocuments"/>
        </ByExtension>
        <Default>
            <Mapping Value="icgen.gif"/>
        </Default>
    </DocIcons>
    Still not happy.
    So, how do I make this stuff work?

    Found this link which has more information on this scenario:
    http://sharepoint.stackexchange.com/questions/1427/open-txt-file-in-notepad-from-sharepoint
    A programmatic workaround:
    http://weblogs.asp.net/bsimser/archive/2005/01/24/359911.aspx
    Andrew Milsark, MCITP,MCTS
    Fpweb.net - The SharePoint Hosting Pioneer
    Blog : http://blog.fpweb.net
    Twitter : http://www.twitter.com/amilsark

  • Problem with checkbox value and app.settings.getSetting()

    Hello everyone.
    I`ve got a problem with getting saved settings for checkbox.
    Saved settings doesn`t apply on checkbox value.
    It`s strange, but it always "true".
    So here piece of code:
    checkMe = 11;    //any value for the first time running
    if (app.settings.haveSetting("savea", "chck")) {                           
                          checkMe = app.settings.getSetting("savea", "chck");  // get saved value, else 11
                          alert("checkMe = "+checkMe)
                        if(checkMe == 11){
                            checkMe= false;   //if there is no saved settings, checkbox value will be false/ unchecked
                            alert("You run this script first time, so manual value will be 'false'")
                            }else{
                                checkMe = app.settings.getSetting("savea", "chck");     // if saved settings exist, get true or false
         alert("Yes, checkMe will = "+checkMe)       
    win.checkPanel.chkOne.value = checkMe;  /// checkbox value will equal saved checkMe
    var fff = win.checkPanel.chkOne.value;  // string for alert
    alert("aha! but checkbox value is  = " +fff+ "\n Why so?")     // here we`ve got always "true"
    win.checkPanel.chkOne.onClick  = function () {
        var path11 = win.checkPanel.chkOne.value;  //  checkbox value to variable
        app.settings.saveSetting("savea", "chck", path11);  //saving checkbox value
        alert("Saved this value - " + app.settings.getSetting("savea", "chck"))
    win.checkPanel.chkOne.value is always true.
    Can someone exmplain why and how to get rid of this static value?
    P.S. just in case, here is full code:
    function mainFun()
        this.windowRef = null;
    mainFun.prototype.run = function()
        /*----- UI -----*/
              var retval = true;
              var win = new Window("palette", "Check option", [150, 150, 460, 455]);
              this.windowRef = win;
              win.checkPanel = win.add("panel", [25, 150, 285, 265], "Checkbox");
              win.checkPanel.chkOne = win.checkPanel.add("checkbox", [10, 15, 125, 35], "Checkbox One");
              //win.checkPanel.chkTxtOne = win.checkPanel.add('edittext', [140, 15, 230, 35], '');
         win.quitBtn = win.add("button", [110,275,200,295], "Close");
    checkMe = 11;    //any value for the first time running
    if (app.settings.haveSetting("savea", "chck")) {                           
                          checkMe = app.settings.getSetting("savea", "chck");  // get saved value, else 11
                          alert("checkMe = "+checkMe)
                        if(checkMe == 11){
                            checkMe= false;   //if there is no saved settings, checkbox value will be false/ unchecked
                            alert("You run this script first time, so manual value will be 'false'")
                            }else{
                                checkMe = app.settings.getSetting("savea", "chck");     // if saved settings exist, get true or false
         alert("Yes, checkMe will = "+checkMe)       
    win.checkPanel.chkOne.value = checkMe;  /// checkbox value will equal saved checkMe
    var fff = win.checkPanel.chkOne.value;  // string for alert
    alert("aha! but checkbox value is  = " +fff+ "\n Why so?")     // here we`ve got always "true"
    win.checkPanel.chkOne.onClick  = function () {
        var path11 = win.checkPanel.chkOne.value;  //  checkbox value to variable
        app.settings.saveSetting("savea", "chck", path11);  //saving checkbox value
        alert("Saved this value - " + app.settings.getSetting("savea", "chck"))
              win.quitBtn.onClick = function() {
                  win.close();
        win.center();
              win.show();
              return retval;
    if(typeof(mainFun_unitTest) == "undefined") {
        new mainFun().run();

    Played around with different values, combinations...
    Doesn`t work too:
    checkMe = 111;    //any value for the first time running
    if (app.settings.haveSetting("333", "check")) {                           
                          checkMe = app.settings.getSetting("333", "check");
    alert(checkMe);
                    if(checkMe == 111){
                             win.checkPanel.chkOne.value= false;
                            }else{
                                if (checkMe != false){
                                win.checkPanel.chkOne.value= true;
                                }else{
                                win.checkPanel.chkOne.value= false;
    win.checkPanel.chkOne.onClick  = function () {
        var path11 = win.checkPanel.chkOne.value;
        var path12 = path11.toString();
        app.settings.saveSetting("333", "check", path12);
        alert("Saved value - " + app.settings.getSetting("333", "check"))

  • Add linked button to a editText field

    Hello everybody,
    i'm trying to add a linked button to a text field in the header of a JournalEntry. So far i've been able to add it on one of the columns of a document matrix.
    Can anybody help me, please?
    Ciao
    Marco

    You need to create a new link button object, set the "linkto" property to point to the UID of the edittext containing the data, and set linkedobject to point to the target object (eg. business partners, items ...)
    Set sboItem = sboItems.Add("LINK", it_LINKED_BUTTON)
    sboItem.LinkTo = "10"  'UID of separate edittext containing the data.
    Set sboLink = sboItem.Specific
    sboLink.LinkedObject = lf_BusinessPartner
    John.

  • How do you get IDcs5 to open and display properly??

    Purchased InDesign CS5 and it worked well for the first few months then it decided not to open up properly onscreen? Now when opening all I ever get is a tiny portion of the tool bar appearing in the upper left corner of the screen. If I use the 'expand' button it only fills the screen with a completely blank page which is of no use. So I'm left to resort to manually clicking and dragging the toolbar to open the workspace to fill the screen......even then, it tends to 'snap back' to the tiny toolbar in the upper left corner? This is very annoying and frustrating to say the least! I'm working in a windows environment running Windows 7 if that makes any difference. I've searched but there appears to be no fix for this? Why does it not just open up on screen properly like every other program??? Why can't the folks at ADOBE fix this? The only reason I'm using this program is because one of our biggest clients insists on using InDesign, otherwise I'd dump it! Does anyone know the cause or fix for this? Sure would appreciate it! Thanks!

    @Peter – I cannot tell what's going on here, because I'm working on a Mac OSX 10.6.8.
    I've seen such a thing in InDesign CS4, but not in InDesign CS5.5 anymore.
    However, maybe it is possible to resize the main window by scripting its bounds.
    For that, one file must be opened and its window must be resized with JavaScript. At least on a Mac. Could be different on Windows, because some UI elements behave different from OS to OS.
    To get the right values for the bounds you could do the following:
    Start InDesign, maximize it manually, open a new document. You need not to save it.
    Then start the following line of code, that will read out the bounds of the window and present them as text in a "palette" type of window:
    #targetengine "session";
    //Get the bounds and convert them to a String object:
    var myMessageString = String(app.documents[0].windows[0].bounds);
    var w=new Window("palette","ReadOutBoundsOfWindow:");
    var e=w.add("edittext",[0,0,200,50],myMessageString,{multiline: true,scrolling:true});
    e.active = true;
    w.show();
    As a result you'll get a string of 4 numbers in a "palette" highlighted.
    Copy/paste the values together with separating commas to your text editor or the ESTK.
    Currently I'm on a MacBook Pro and the numbers I will get with that method are: 22,0,999,1680.
    The numbers will be different, depending on your screen size and resolution. They are values for pixels in the form: [top, left, bottom, right].
    Now you can close the palette.
    That was just the preparation for the following lines of code, that will set the bounds.
    Every time after you restarted InDesign, you could execute the following script (you can assign a keyboard shortcut to it):
    app.documents.add();
    //Exchange the values in the brackets with YOUR values you obtained with the other script.
    //Thiese values set the working window to a specific size [top, left, bottom, right]:
    app.documents[0].windows[0].bounds = [22,0,999,1680]; //Thiese are the values of my specific MacBook Pro.
    //Now we don't need the dummie document anymore. Close it:
    app.documents[0].close(SaveOptions.NO);
    Like I said, it's working on a Mac.
    Don't know if it will on MS Windows.
    Uwe

  • How can i add a new row in System Matrix passing itemcode and quantaty

    Hi All,
    I have to add new lines in the matrix system only through the itemcode and item quantity. I tried several ways without success. Maybe the following code help to explain what I'm trying to do.
    Someone already inserted rows in the matrix system? Can someone show me how I can do. This example is in C# but if someone has in VB I will apreciate.
    FormUID = SBO_Application.Forms.ActiveForm.UniqueID;
                f = SBO_Application.Forms.Item(FormUID);
                try
                    SAPbobsCOM.Recordset oRS;
                    oRS = ((SAPbobsCOM.Recordset)oCompany.GetBusinessObje
    SAPbobsCOM.BoObjectTypes.BoRecordset));
                    oItem = f.Items.Item("38");
                    oMatrix = ((SAPbouiCOM.Matrix)(oItem.Specific));
                    oEditText = ((SAPbouiCOM.EditText)oMatrix.Columns.Item(3).Cells.Item(oMatrix.RowCount - 1).Specific);
                    string Codigo = oEditText.Value; //Select the item number to use in strQuery
                    strQuery = "SELECT U_ART_COM FROM [@SB1EVOL_COMPOSTOS] where
    U_ART_PRI='" + Codigo.ToString();
                     oRS.DoQuery(strQuery);
                    if (oRS.RecordCount > 0)
                        oRS.MoveFirst();
                        numart = oRS.RecordCount;
                        f.Freeze(true);
                        for (j = 1; j <= numart; j++)
                            try
                                ItemCodeTXT = oRS.Fields.Item(0).Value.ToString();
                                oEditText = ((SAPbouiCOM.EditText)(oMatrix.Columns.Item(3).Cells.Item(oMatrix.RowCount).Specific));
                                oEditText.Value = ItemCodeTXT.ToString();
                                f.Update();
                                oRS.MoveNext();
                            catch (Exception oEx)
                                f.Freeze(false);
                                f.Update();
                                MessageBox.Show(oEx.Message + " j = " + System.Convert.ToString(j));
                        j = 0;
                        f.Freeze(false);
                        f.Update();
    In this example i try to add rows in Invoice matrix.
    Thanks in advance.
    Edited by: Luís Filipe Duarte on Jun 26, 2009 4:14 PM
    Edited by: Luís Filipe Duarte on Jun 26, 2009 4:17 PM

    Viva Vitor,
    Antes de mais obrigado pela resposta.
    È esse mesmo o meu objectivo. Passo a explicar qual é o objectivo deste desenvolvimento. O que se pretende é que quando um utilizador escreva o código de um artigo numa linha da matrix de um documento de venda o add-on vai ler esse artigo e de seguida consultar uma tabela de utilizador que ja esta criada para validar se esse artigo tem outros artigos associados, e se tiver, entao o addon tem que os escrever nas linhas imediatamente a seguir. Eu queria mesmo, era escrever qual era o artigo e qual a respectiva quantidade. Eu consigo encontrar qual o artigo que o utlizador escreve e qual os artigos associados. O meu problema acontece quando tendo adicionar as novas linhas.
    Com o codigo que se segue podes ver que estou a atribuir a uma EditText o codigo do artigo a escrever. O problema é se correr em modo debug consigo ver que a aplicação chega a essa linha 
    oEditText.Value = ItemCodeTXT.ToString();
    e volta para trás, ou seja entra num loop e nao sai daqui.
    if (oRS.RecordCount > 0)
                        oRS.MoveFirst();
                        numart = oRS.RecordCount;
                        f.Freeze(true);
                        for (j = 1; j <= numart; j++)
                            try
                                ItemCodeTXT = oRS.Fields.Item(0).Value.ToString();
                                oEditText = ((SAPbouiCOM.EditText)(oMatrix.Columns.Item(3).Cells.Item(oMatrix.RowCount).Specific));
                                oEditText.Value = ItemCodeTXT.ToString();
                                f.Update();
                                oRS.MoveNext();
                            catch (Exception oEx)
                                f.Freeze(false);
                                f.Update();
                                MessageBox.Show(oEx.Message + " j = " + System.Convert.ToString(j));
    Eu para adicionar uma nova linha o que tenho de fazer? não vasta passar a informação do item code?
    Este desenvolvimento é para implementar ecoreee no sap. Nao sei já tiveste alguma coisa dessas entre mãos.
    Obrigado mais uma vez pela atenção. Espero também um dia poder ajudar.
    Com os melhores cumprimentos.
    Luis duarte

  • Distribute eps objects with file list and quantity

    Hello everyone,
    Here's a script i wrote so I share it for the contribution.
    Here's my purpose. Every year, for a customer of our company, we have to print several description plates for their products. They give us about 30 or more texts, traduced in about 7 languages, and an excel file with quantities that each retail seller of each country do want to receive.
    We print these aluminium plates on a uv cured ink printing machine which have a table dimension of about 60x40cm. Preparing manually every files of 60x42cm to print was way too much time devouring, so i wrote that script.
    Before running this script you have to create a folder with your text files in eps, and create a new document with the dimension you want.
    Don't hesitate if you want more precisions with the process.
    #target illustrator
    #targetengine session
    This script allows you to import EPS files as linked files. It distributes them and centers the all according to the dimension of the artboard of your document, then it saves the file.
    You can define everything in the start list : target folder, basename of the destination files, how much objects per sheet you want, the roation if necessary, spacing between each objects, number of culumn for the distribution.
    If you want to distribute a number of objects that is bigger thant the limit of objects per sheet, the script reports the remaining in a new sheet after saving the previous one.
    The first 2 arrays contains the filenames to use in the source folder and their respective quantity.
    var doc = app.activeDocument;
    doc.rulerOrigin = [0,0];
    var xtimes = 0;
    var countName;
    var folder;
    var folder2;
    //var folder = 'C:\\Documents and Settings\\Administrateur\\Bureau\\BBB\\';
    // array for filenames
    var listEx=new Array (
    "File1.eps",
    "File2.eps",
    "File3.eps",
    // array for quantity for each filenames
    var listqte=new Array (
    15,
    8,
    19,
    //-------------UI CODE------------
    var win = new Window ("dialog");
    win.alignChildren = "left";
    // ------Folders selection panel
    var foldPanel = win.add("panel");
    foldPanel.alignChildren = "right";
    // source folder for files
    var panelGrp1 = foldPanel.add("group");
    var btnSource = panelGrp1.add("button",undefined,"Source Folder :");
    var txtSource = panelGrp1.add("edittext",undefined);
    txtSource.characters = 40;
    btnSource.onClick = function()
        folder2 = Folder.selectDialog ("Select Source folder..."); // get the source folder
        txtSource.text = folder2.fsName; // show the file Path here
    // destination folder
    var panelGrp2 = foldPanel.add("group");
    var btnSave = panelGrp2.add("button",undefined,"Save Folder :");
    var txtSave = panelGrp2.add("edittext",undefined);
    txtSave.characters = 40;
    btnSave.onClick = function()
        folder = Folder.selectDialog ("Select Destination folder..."); // get the source folder
        txtSave.text = folder.fsName; // show the file Path here
    // Base name for destination files
    var panelGrp3 = foldPanel.add("group");
    panelGrp3.alignment = "left";
    var bfn = panelGrp3.add("statictext",undefined,"Basename of target file :");
    var txtbfn = panelGrp3.add("edittext",undefined,"Description plates - UK");
    txtbfn.characters = 20;
            // other parameters
            var grp = win.add("group");
            grp.alignChildren = "left";
            grp.orientation = "column";
            // counter
            var wincount = grp.add("group");
            var textcount = wincount.add("edittext",undefined,0);
            textcount.characters=2;
            wincount.add("statictext",undefined,"Start count");
            //Limit number of placeditems to distribute in one file
            var winlimit = grp.add("group");
            var textlimit = winlimit.add("edittext",undefined,0);
            textlimit.characters=2;
            winlimit.add("statictext",undefined,"Limit");
            //number of Columns for the distribution
            var wincolon = grp.add("group");
            var textcolon = wincolon.add("edittext",undefined,0);
            textcolon.characters=2;
            wincolon.add("statictext",undefined,"Nb of columns");
            // Spacing values between each objects in mm
            var winspace = grp.add("panel",undefined,"Spacing in mm");
            winspace.orientation = "row";
            winspace.add("statictext",undefined,"X");
            var Xspace=winspace.add("edittext",undefined,0);
            Xspace.characters=7;
            winspace.add("statictext",undefined,"Y",undefined,0);
            var Yspace=winspace.add("edittext");
            Yspace.characters=7;
            // rotation angle
            var winrotate = grp.add("group");
            var textangle = winrotate.add("edittext",undefined,0);
            textangle.characters=3;
            winrotate.add("statictext",undefined,"Rotation in °");
    // Dropdownlist of presets   
    var winPreset =grp.add ("dropdownlist", undefined, [ "Description plates","Trapezes plates","-","Perso"]);
    winPreset.onChange = function ()
        switch (winPreset.selection.text)
                    case "Description plates":
                            textlimit.text=8;
                            textcolon.text=4;
                            Xspace.text=6.4;
                            Yspace.text=27;
                            textangle.text=0;
                            break;
                    case "Trapezes plates":
                            textlimit.text=18;
                            textcolon.text=6;
                            Xspace.text=9;
                            Yspace.text=9;
                            textangle.text=0;
                            break;
                    case "Perso":
                            textlimit.text=0;
                            textcolon.text=0;
                            Xspace.text=0;
                            Yspace.text=0;
                            textangle.text=0;
                            break;
    //winPreset.selection=1;
    var runBT=grp.add("button",undefined,"Run !");
    runBT.onClick = function()
        win.close();
        moteur();
    win.show();
    //--------------------End of UI CODE----------------
    //---------------------------------fonction  Placement of objects
    function place()
        var paddingx = parseFloat(Xspace.text)*2.834;        //spacing in mm between each column (for a value in points just suppress the *2.834)
        var paddingy = parseFloat(Yspace.text)*2.834;        //spacing in mm between each line
        var gridCols = textcolon.text;                            // number of columns
        var newGroup = doc.groupItems.add();
        var sel = doc.placedItems;
        // set the position of the first element, assuming that the group of all elements are centered  in X and Y  in the artboard
        var originX = (doc.width - ((doc.width - ((sel[0].width * gridCols) + (paddingx) * (gridCols-1)))/2))-sel[0].width
        var originY =((doc.height - (( sel[0].height * (textlimit.text/gridCols) ) +  (  paddingy*( (textlimit.text/gridCols)-1 )  )))/2)+sel[0].height
        var currentX= originX
        var currentY = originY
        for(var e=0, slen=sel.length;e<slen;e++)       
                //   :::SET POSITIONS:::
                sel[e].top = currentY;
                sel[e].left = currentX;
                //  :::DEFINE X POSITION:::
                currentX += -(sel[e].width + paddingx);
                if((e % gridCols) == (gridCols - 1))
                        currentX =  originX
                        //  :::DEFINE Y POSITION:::
                        currentY  += sel[e].height+paddingy;
                // ::Add to group
                sel[e].moveToBeginning (newGroup );
                redraw()
    //----------------------function Save
    function sauve()
        var fich =  txtbfn.text;    //Basename of the destination file
        // embed elements (for my case these are eps placeditem files)   
        for (var i = doc.placedItems.length-1; i >= 0; i-- )
                app.activeDocument.placedItems[i].embed();
        // draw a rectangle with the dimensions of the artboard and centered to it, with no fill color neither stroke color
        doc.rulerOrigin = [0,0];  // rulers to the origin
        var artboardRef = doc.artboards[0];
        // read dimensions oh the artboard to position therectangle
        var top=artboardRef.artboardRect[1] ;
        var left=artboardRef.artboardRect[0];
        var width=artboardRef.artboardRect[2]-artboardRef.artboardRect[0];
        var height=artboardRef.artboardRect[1]-artboardRef.artboardRect[3];
        var rect = doc.pathItems.rectangle (top, left, width, height);   
        rect.stroked = false;
        rect.filled = false;
        countName ++;
        // when several files are saved, the ten first files are numbered like this : 01, 02, 03... instead of 1,2,3
        var countName2 = countName;
        if (countName<=9) { countName2 = ("0" + countName)};
        if (xtimes != 0) // saves in eps, basename of file + number of times to repeat if necessary (it's to avoid to save several but identical files. For ex. if i have an object to print 100 times and i place 50 objects per file, the mention "2 times" will be mentionned in the name of the destination file )
                var dest= new File(folder + '/' + fich + ' ' + countName2 + ' - ' + xtimes + ' times' + '.eps');
        else
                var dest= new File(folder+ '/' + fich + ' ' + countName2 + '.eps') ;
        var options = new EPSSaveOptions();
        options.preview  = EPSPreview.None;
        //options.compatibility = Compatibility.ILLUSTRATOR14;
        //options.overprint = PDFOverprint.DISCARDPDFOVERPRINT
        //options.embedAllFonts = false;
        //options.includeDocumentThumbnails = false
        doc.saveAs(dest, options);
    //-------------------- function moteur
    function moteur()
        var limite = textlimit.text;            // max number of objects to distribute in one sheet
        var couchangl = textangle.text;    // rotation angle of the element
        //--------------Searches and signals if there is missing files in the source folder. If so, the script stops and displays which files are missing
        var miss=new Array();
        for (var i=0,len1=listEx.length;i<len1;i++)
            var myfile = new File(folder2+'/'+listEx[i]);
            if (myfile.exists==false)
                    miss.push(listEx[i]);
        if (miss.length != 0)
                alert (miss.length+" missing files : "+"\r"+miss.join(", "+"\r")+"\r"+"\r"+" Please correct and try again");
                return;
        //--------------end of  verification
    var start = new Date();        // starts chrono
    countName = textcount.text;    // start of the counter to number the name of the file to save
        //-------------disctribution of the object on the sheet
        for (var i=0,howmuch = 0,len1=listEx.length;i<len1;i++)
            for (var j =0; j<listqte[i];j++)
                    if (howmuch==0)
                            if ((listqte[i]-j)/limite>=2) //activate "xtimes" if quantity is twice or more bigger than "limit"
                                    xtimes = parseInt ((listqte[i]-j)/limite);
                                    j += limite*(xtimes-1);
                    myfile = new File(folder2+'/'+listEx[i]);
                    var  thisPlacedItem = doc.placedItems.add();
                    thisPlacedItem.file = myfile;
                    // rotate if necessary
                    if (couchangl !=0) thisPlacedItem.rotate(couchangl);
                    howmuch ++;
                    if (howmuch == limite)
                            place();
                            sauve();
                            doc.pageItems.removeAll();
                            howmuch = 0;
                            xtimes = 0;
    place();
    sauve();
    redraw();
    alert("time spent : "+((new Date() - start)/1000)+" secondes");

    Hello,
    The Windows Desktop Perfmon and Diagnostic tools forum is to discuss performance monitor (perfmon), resource monitor (resmon), and task manager, focusing on HOW-TO, Errors/Problems, and usage scenarios.
    As the question is off topic here, I am moving it to the
    Where is the Forum... forum.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

Maybe you are looking for

  • Adobe Bridge CC will not launch OS 10.9.5

    I've recently installed Adobe Creative Cloud onto a brand new Mac Pro.  All the Adobe apps launch with no issue except for Bridge, which does not launch at all.  The app icon bounces in the dock for a second, then disappears.  I've tried uninstalling

  • Slider with more than one thumb

    Hi, does anybody know a slider with more than one thumb? The JSlider-class only provides one thumb, but I need more thumbs to displace. That why I posted the last question: I found one in the web but when I call the constructor, I get that error. Tha

  • Recover Database in RMAN vs SQL*PLUS

    Hello, Oracle 11.2.0.1, Oracle Linux 5.5 UEK. I recently did a "recover database" in sql*plus, but an attempt to open the database gave ORA-01113, complaining the system tablespace requried more recovery. Then I used RMAN (nocatalog) and after the sa

  • Run-time error '1004' Application-Defined or object-defined error

    Hello friends, My requirement is to make the cells under Columns Actual, forecast and target (Dimesnion Category) Locked. I've used various methods like GetOnlyRange but it didnt work. Now, i've selected all the cells of the sheet, where user can inp

  • Solution Manager Monitoring

    Hi Everyone, Please can anyone provide me some suggestions for how is solution manager being used to monitor the system? Like what all we can use early watch reports etc. Thanks in advance. Regards, Avneesh