Is it possible to do an insert, read, update, delete on tblParameter on configuration database

SOLVED

Hi all,

I see there is tblParameter in configuration table, I would like to store my key value such as custom database name, servername, username, and password in tblParameter to be used in my custom form.

In Sage.MMSAdmin.DBSchema.Others, I see there is class and methods related to tblParameter. But I am failing to read the table content using the methods. Is it possible to do basic query on this table?

Thank you.

Parents
  • +1
    verified answer

    Yeah, you can read and update the parameters. Here's an example.

    Sage.MMSAdmin.DBSchema.Others.ParametersList paramsList = null;
                
    //the get method returns false if it was successful. I'm passing 'this'as my first
    //argument because this code is running in a Windows form. 
    //I could pass null if necessary:
    if(Sage.MMSAdmin.Kernel.SrvcAcc.ParametersGetList(this, out paramsList) == false)
    { 
        foreach(Sage.MMSAdmin.DBSchema.Others.ParametersList.tblParametersRow 
                                            paramRow in paramsList.tblParameters)
        {                    
            var paramName = paramRow.ParameterName;
            if(paramName == "EnforceLogin")
            {
                paramRow.ParameterValue = "True";
                break;
            }
            }
    }
    
    //the update also returns false if it's been successful:
    bool ok = !Sage.MMSAdmin.Kernel.SrvcAcc.ParametersUpdate(this, paramsList);

  • 0 in reply to Chris Burke

    Thank you Chris. I would like to add here for future reference: add reference Sage.MMSAdmin.Kernel.dll from Sage 200 installation folder.

Reply Children
No Data