How do I use an IF statement in one application to create a new record in another application

  • 0
  • 1
  • Question
  • Updated 6 years ago
  • Answered
Folks, I need some help here:

I have a list of 17000 different sku's across five manufacturers in one application(master inventory application). What I need to do is be able to go through my entire inventory(i have reports created which are broken up by mfg's so I can pull a certain mfg report and grid edit) and assign certain skus to a resellar. I was thinking of using an IF THEN statement,

IF "ASSIGN SKU TO WHICH RESELLAR"=resellar A(via a dropdown) then create a new record(in the resellar A inventory application with appropriate information), else do nothing

Where does this IF statement live? I was thinking in the master inventory application, perhaps the resellar drop down in the master inventory application

Once a new record is created in the resellar application I want that sku to be unavailable in the master list, so as not to allow the sku to be issued to two different resellers simultaneously. This could be as easy as creating a report only showing unassigned sku's and setting the appropriate access controls to make any changes to this field.
Photo of Eric

Eric

  • 0 Points

Posted 6 years ago

  • 0
  • 1
Photo of AndreaLBest

AndreaLBest

  • 0 Points
There are a number of examples of using JQUERY to make API calls, including adding and updating records. You can add a formula URL button to your Master inventory table, and a "reseller record is added" flag. Then after you update the reseller on the inventory record,click the url button to "confirm" the reseller. The button can then
1. Read the Master inventory record,
2. Verify the "reseller record is added" field is still false,
3. Get the reseller you just assigned to the record,
4. Format the data for the reseller's table based on the master inventory record
5. Create the correct API call to add the record to the correct database
6. Execute the API add call
7. If all went well, Update the master inventory record, changing "Reseller record is added" to true.

You can make a report showing which records still have "reseller record is added" = false, to see what still needs to be assigned. If you have many resellers, you can have your reseller table (you mentioned already having a drop down list) include your database ids for each reseller. The Jquery can access that table to get the correct dbid.

So it is all do-able. You just need to know jquery. I learned what I know from culling examples from this forum and knowledge base.