cancel
Showing results for 
Search instead for 
Did you mean: 

Update Batch Details

Former Member

Hello,

I've been reading in the forum, that it's not possible to update Batch Details because there's no DI object to do that.

Someone has suggested that we can do that using UI, simulating clicks and key entries!

We could do that if in the Batch Details form the Warehouse field was available, but it is not!

So, if we don´t have the chance to update Batch Details via DI object or UI "clicks and key entries", is it admissible that we can use Update Recordset?

Regards

Júlio Pinho

View Entire Topic
tkunisada
Explorer

I know this is an old post but I faced the same issue. 

You can update Batch Details Screen from DI-API using the "CompanyService" object.  Below is a sample C# code to update expatriation date.


public void UpdateExpDate(int absEntry, DateTime newExpDate)

{

    // Initiate Company Obj

    Company comp = new Company();

    comp.Server = this.server;

    comp.DbServerType = BoDataServerTypes.dst_MSSQL2008;

    comp.UseTrusted = true;

    comp.CompanyDB = this.companyDb;

    comp.LicenseServer = this.licenseServer;

    comp.UserName = this.sboUser;

    comp.Password = this.sboPwd;

    if (comp.Connect() != 0) { throw new SystemException(comp.GetLastErrorDescription()); }

    // Initiate objects

    CompanyService compService = comp.GetCompanyService();

    BatchNumberDetailsService bNumService

        = compService.GetBusinessService(ServiceTypes.BatchNumberDetailsService);

    BatchNumberDetailParams bNumDetailParams

        = bNumService.GetDataInterface(BatchNumberDetailsServiceDataInterfaces.bndsBatchNumberDetailParams);

    // Set value from OBTN.AbsEntry field

    bNumDetailParams.DocEntry = absEntry;

    // Initialte BatchNumberDetail obj

    BatchNumberDetail bNumDetail = bNumService.Get(bNumDetailParams);

    // Set Expiration Date

    bNumDetail.ExpirationDate = newExpDate;

    // Update

    bNumService.Update(bNumDetail);

}

rajesh_khater
Active Participant
0 Kudos

Hi Toshi,

Your post is very helpful. Thanks.

Is there a way to select a specific batch for updation other than by specifying its Abs Entry from the OBTN table? I mean is there no interface to select a batch by specifying the item code and the batch number?

Thanks.