My Products
Help
Florian Haase
PARTNER

Handling of notes

by Florian Haase

Hi there,

 

we don't get the notes work. We are testing on orderline notes and the mutation is:

 

mutation {
useCompany(no: XXXXXXXX) {
orderLineNote_create(values: [{
orderNo: 666
orderLineNo: 4
note: "TB-030298-S01-N002\t01.01.0001\t\t1 stk \t2000 kr\r\nTB-030298-S01-N001\t01.01.0001\t\t1 stk \t2000 kr\r\n"
}])
{
affectedRows
items {

orderNo
orderLineNo
note
changedByUser
changedDateTime
}
}
}
}

 

The API answers perfectly:

{"data":{"useCompany":{"orderLineNote_create":{"affectedRows":1,"items":[{"orderNo":666,"orderLineNo":4,"note":"TB-030298-S01-N002\t01.01.0001\t\t1 stk \t2000 kr\r\nTB-030298-S01-N001\t01.01.0001\t\t1 stk \t2000 kr\r\n","changedByUser":"","changedDateTime":"0001-01-01T00:00:00"}]}}},"extensions":{"vbnxt-trace-id":"0000000000000000e1586c71c1d153dd"}}

 

No error so far and all perfect. But the UI does not show that there is a note and we don't know how to get access to this note again:

 

2023-08-08 15_45_54-UtviklingsPC2 - TeamViewer.png

 

4 REPLIES 4
Accepted solution
Øyvind Årseth
VISMA

by Øyvind Årseth

Hi Florian
Memos and notes are two different entities. Memos were previously stored locally as txt-files, which is not viable in a cloud solution. The Memo-table was created to store the memos inside the BNXT (or VB) db, and is linked to all relevant tables with the MemoNo-column. To create a memo on an orderline, you can do something like this: 

mutation Create_memo_on_orderline ($cid: Int!,$memoNo: Int! = 0,$ordNo: Int!, $lineNo: Int!) {
useCompany(no: $cid) {
    memo_create (values: {
        content: "Memo for orderline x on order y"})
    {affectedRows
        items {
            memoNo @export(as: "memoNo")
            }
        }
        orderLine_update(
            filter: {_and: [{orderNo: {_eq: $ordNo}},{lineNo: {_eq: $lineNo}}]},
            value:{  
                memoNo: $memoNo})
                {affectedRows
                    items{
                        orderNo
                        lineNo
                        memoNo
                        }
            }
    }
}

Creating it as a memo instead of a note will automatically solve the visualization in the UI - you'll see the little blue triangle, indicating there is a memo present. 

Florian Haase
PARTNER

Yes, its already implemented and working 😀

But still (maybe a silly question due to bad vb knowledge) - what are these notes for?

They are primarily used with order documents via AutoInvoice as far as I know, without going into details🙂

Florian Haase
PARTNER

by Florian Haase (Updated ‎09-08-2023 09:41 by Florian Haase PARTNER )

I think I figured that out: The notehandling is a bit confusing. There is a table "memo" which just contains the notes without reference. But on the orderline there is at least a graphql-column with the name MemoNo which references to the memo-table. There is no joindown/joinup-link between these tables but that's the table the UI is using. In the UI these table and the field is not visible, therefore I had a bit problems to find it.

In the end this means (not tested yet) that we first have to insert into the note-table, get the running note-number and than update the orderline-table with the MemoNo.

 

I have no idea what this orderline-note table is used for.

 

Florian