Wednesday, March 30, 2022

Create site, warehouse, location using x++

 Create site and warehouse using x++.


    InventSite      inventSite;
    ReqSitePolicy   reqSitePolicy;
    InventLocation  inventLocation;

    //site creation
    inventSite.clear();
    inventSite.initValue();
    inventSite.SiteId   = 'Site 1';
    inventSite.Name     = 'Test Site 1';
    inventSite.insert();


    // In site form <ReqSitePolicy> datasource link type is inner join.
    // So creating the record in <ReqSitePolicy> table.

    reqSitePolicy.clear();
    reqSitePolicy.InventSiteId = inventSite.SiteId;
    reqSitePolicy.insert();

    // warehouse creation
    inventLocation.clear();
    inventLocation.initValue();
    inventLocation.InventLocationId = 'WHS 1';
    inventLocation.InventSiteId     = inventSite.SiteId;
    inventLocation.Name             = 'Test WHS 1';
    //inventLocation.WHSEnabled     = true;
    inventLocation.insert();

    // Location
    WMSLocation             wmsLocation;

    wmsLocation.clear();
    wmsLocation.initValue();
    wmsLocation.inventLocationId    = inventLocation.InventLocationId;
    wmsLocation.wMSLocationId       = 'Location 1';
    wmsLocation.LocProfileId        = 'LocProfileId';
    wmsLocation.insert();

Keep Daxing!!

No comments:

Post a Comment