I'm creating an app that manages inventory. The number of parts used in the "A" app, Is it possible to add it to the table of the "B" app? When 10 parts are used in "A" A table is added to "B", and the number of receipts and shipments is reflected as "-10".
Hi TS44
Welcome to the forum - we’ll do our best to help out.
Could you be more specific on which App is managing what data? (or which App is being used for what scenario). I’m guessing that App B is managing the total inventory, and App “A” is managing deals? (deals that would affect inventory counts).
Thanks for the screenshots.
Have you tried out anything so far, or are you lost on where to start off?
As a beginner, I can create a single app, but I don't know how to associate apps with each other. ① How to associate the parts selected in A App with B App ② If ① is completed, how to reflect the value
Hello everyone. My problem is same as TS44. Please help.
As a picture. I want to do like this…
When Save button in “Requisition Form” was click
Read table data to be an Array.
Make a Loop
Insert RequisitionQty into “Inventory” where Item name is same or Record No is same
Until end of Array
(function() {
‘use strict’;
var events = [‘app.record.create.submit’, ‘app.record.edit.submit’];
kintone.events.on(events, function(event) {
var record = event.record;
var table = record[TABLE].value;
for (var i in table) {
var row = table[i].value;
//
//How to do something like this?
//insert row[RequisitionQty].value to “Inventory” where Item name is same or Record No is same
//
}
}
return event;
});
}());
Thank you
Hello TS44,
① How to associate the parts selected in A App with B App
You will need to run a query to filter which record you need to update upon obtaining records data in App B.
To retrieve details of multiple records from an App, you can use the Get Records API.
Get Records
https://developer.kintone.io/hc/en-us/articles/360019245194-Get-Records
② If ① is completed, how to reflect the value
Since you are updating a particular record, you will need to use the Update Record API to update details of 1 record in an App.
Update Record
https://developer.kintone.io/hc/en-us/articles/213149027
FYI, as with getting any other record data, table data can be retrieved by specifying the table’s field code in the event object.
I hope this gives you a general idea of the flow.