Skip to Content
author's profile photo Former Member
Former Member

add records to OCST

Good evening

I have to update the elements of the table OCST with a code written in C sharp

what kind of object I can use?

thanks

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 01, 2011 at 09:26 AM

    Hi,

    Try This......

    
    // Get states service 
    CompanyService oCompanyService = oCompany.GetCompanyService(); 
    StatesService oStatesService = (StatesService)oCompanyService.GetBusinessService(ServiceTypes.StatesService); 
     
    // Add a State 
    SAPbobsCOM.State oState = (SAPbobsCOM.State)oStatesService.GetDataInterface 
        (StatesServiceDataInterfaces.ssState); 
     
    oState.Code = "Z1"; 
    oState.Country = "US";  
    oState.Name = "ZZ4"; 
                     
    oStatesService.AddState(oState);
    
    

    Thanks

    Shafi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2011 at 06:13 PM

    Hi,

    This table is so simple that only define the state/province. How many new provinces do you need to add?

    I don't think it is assigned an object code.

    Thanks,

    Gordon

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      I've founded this code

      SAPbobsCOM.CountriesService oStates;

      oStates = oCompany.GetCompanyService().GetBusinessService(SAPbobsCOM.ServiceTypes.StatesService);

      SAPbobsCOM.IStatesParams oStatesParams = oStates.GetStateList();

      SAPbobsCOM.StateParams oStateParams;

      for (incr = 0; incr < oStatesParams.Count -1; incr++)

      {

      oStateParams = oStatesParams.Item(incr);

      sVal = oStateParams.Code;

      sVal = oStateParams.Country;

      sVal = oStateParams.Name;

      sVal = oStateParams.Name;

      }

      the problem is that the row

      SAPbobsCOM.IStatesParams oStatesParams = oStates.GetStateList();

      gives me the follow error:

      Errore 4 'SAPbobsCOM.CountriesService' non contiene una definizione di 'GetStateList' e non è stato trovato alcun metodo di estensione 'GetStateList' che accetta un primo argomento di tipo 'SAPbobsCOM.CountriesService'. Probabilmente manca una direttiva using o un riferimento a un assembly.

      how I can solve it?

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.