How to update a user field (UpdateValueAtribute)?

1

I'm trying to update a user field, created in CabecStk.

The code is more or less this:

public class Class1 : EditorTransferenciasStock

{
    public override void TeclaPressionada(int KeyCode, int Shift, ExtensibilityEventArgs e)
    {
        base.TeclaPressionada(KeyCode, Shift, e);
        if (KeyCode == 72)
        {
            BSO.Inventario.Transferencias.ActualizaValorAtributo("TRA", varTransf, "000", varSerie, "CDU_DATA", DateAndTime.Today);
        }
    }
}

When you press a key (H) it should write the date value in the CDU_DATA field (which is created in cabecstk). The error returned is that the field does not exist. I think the error is, and in my greatest difficulty, in knowing where the UpdateValueAtribute is for stocks, for example.

In other words:

Aplicacao.BSO.Comercial.Stocks.ActualizaValorAtributo "TRA", var_transf, "000", varserie, "CDU_DATA", Date

Now it's:

BSO.Inventario.Transferencias.ActualizaValorAtributo("TRA", varTransf, "000", varSerie, "CDU_DATA", DateAndTime.Today);

Or am I in the wrong place, or doing the code wrong?

    
asked by anonymous 30.07.2018 / 22:24

2 answers

2

The CabecSTK table is obsolete, as is LinhasSTK .

If you want to create a CDU for the warehouse transfer header you should create it in the INV_CabecTransferencias table. For the rows it will be in INV_LinhasTransferencias .

Regarding the issue of migrating information from previous versions, the data present in the LinhasSTK table will be transposed to the INV_Origens , INV_Movimentos , and INV_Custeio tables. There is no direct migration of the data, which will have to be pointed to the new tables according to the scenario in question.

The ArtigoArmazem table has been replaced by a view V_INV_ArtigoArmazem that can be used to override the previous structure.

The StockActual and PCMedio fields of the Artigo table will have to be replaced by the view INV_ResumoArtigo that will summarize these values previously present in these fields, of the stocks, will only return the existing stock in states that contain stocks.

The ArtigosNumerosSerie table was replaced by the INV_NumerosSerie table, where in the previous structure only the existing serial numbers were present and in the new all are. To achieve the same representation, these records should be filtered by the Stock = 1 clause.

The CabecSTK table has been replaced, the case of incoming and outgoing documents by the internal document header table, CabecInternos .
In the case of stock transfers, its structure was separated into two tables: INV_CabecTransferencias and INV_LinhasTransferencias .

Compositions and decompositions have also been restructured, and their data structure now consists of the tables: INV_CabecComposicoes and INV_LinhasComposicoes . The line type that defines whether it is the compound or component is treated by the TipoComposto field, which will have the following values:

  

Compound = 1   
Component = 0

    
31.07.2018 / 10:36
0

For more information about the Inventory module , you can check out some articles on the PRIMAVERA Developers Network portal, as well as code examples available no GitHub .

Articles:

Code samples:

02.10.2018 / 00:56