cancel
Showing results for 
Search instead for 
Did you mean: 

Relationship map for Sales Order and AR invoice

0 Kudos

Hi experts.

I have a 2 scenario, one for create sales order, second for create AR invoice.

When i create AR invoice, i wanna connect relationship map to sales order. How can i do this?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

HuanYang
Employee
Employee
0 Kudos

Hello Amarjargal,

Relation Map is an SAP Business One feature.

You should open the B1 client and then you can use it.

The map displays the documents which built some connections.

When you created the Sales Order and AR Invoice, if you set the connection between them then you can see the expected map in relation map; otherwise, you cannot see it.

Based on my understanding, what you missed are something like "[BaseType]", "[BaseEntry]" and "[BaseLine]" which link the different type documents.

If you are not familiar with these, I would suggest you to refer DI help document.

Thanks & best regards

Huan Yang

0 Kudos

Hello Huan Yang,

According to your consultation, it turned out to combine the documents, but the following problem arose due to hand numbering.

When i create Sales Order, i use <bfa:string name="HandWritten">tYes</bfa:string>, and my orders creating like that salesordermanualnumber.png.

When I send JSON to create AR Invoice with a manual number, there will be no order with that number, because in B1, store the data in this way sqlquery.png.

When hand numbering is used, B1 stores the hand number of the document in the BaseRef field, and in the BaseEntry field, store the auto-numbering. In such cases, how to connect AR invoice to Sales Order?

Thank you.

HuanYang
Employee
Employee

Hello Amarjargal,

DocEntry and LineNum is the link between source and target document.

DocNum is not.

When you try to generate Sales Order or AR Invoice, you don't need to set DocEntry because it will be generated by the system.

You may refer to DI help document for more information.

Thanks & best regards

Huan Yang

0 Kudos

Hello Huan Yang.

At the expense of DocNum, I was wrong. Really takes DocEntry. The fact is that in the system that JSON sends, there is no data about DocEntry, there is its own numbering of documents. When creating an order document in B1 through integration framework, I fill in the NumAtcard field by order number of another program. Now, when creating the ARInvoice document, I want to find the Sales Order DocEntry, where NumAtcard is equal to the order number of another program and the resulting DocEntry value put the BaseEntry.

Now the problem how to do this 🙂

Thank you.

HuanYang
Employee
Employee
0 Kudos

Hello Amarjargal,

When in 1st step creating the Sales Order successfully, you will get the response (DImsg: DocEntry).

Then you may use this DocEntry + json data to create AR invoice as 2nd step.

Thanks & best regards

Huan Yang

Answers (2)

Answers (2)

former_member294403
Participant

Hello jamarmon ,

1. While creating AR Invoice, if you have any sort of reference that is stored in SAP then you can use Call SQL atom to figure out the DocEntry of Sales Order.

2. Then using the Payload of the Call SQL atom, you can post the AR Invoice with BaseEntry, BaseLine, etc 🙂

In case, you don't have the reference while creating AR Invoice, then you should be creating both documents sequentially. If not, I'm afraid that you can't link the both documents. Else, if you are creating sequentially, then at the first scenario step handover the DocEntry to the next step by defining Successor at Outbound.

dinesh-pn
Active Participant
0 Kudos

Dear Amarjargal,

Solution 1: If you base document is Sales order you can use Copy to functionality to create AR Invoice or if you are in AR invoice screen you can use the copy from functionality to fetch the data from base document. This process will automatically give you the Relationship map.

Solution 2: If you Crated two documents separately you can use reference document functionality to link both document together, this you can see in the relationship map by selecting the Referenced Document option. (Refer with the below attachment)

Note : In this case you have to close your sales order manually.

0 Kudos

Hello Dinesh PN,

Thank you for your answer. I know these decisions, I use the integration framework for creating documents, sending JSON from other software. I need a solution programmatically