New entry in one library triggers new entry in another (entry = image field)

248 views
Skip to first unread message

Sinar Raya

unread,
Dec 25, 2019, 11:23:10 AM12/25/19
to mementodatabase
Halo Mementos & Merry Cristmast.

So this is my first Post at mementodatabase. 

i try to make Product Database for Retail Shop but face 1 Critical problem.
EXAMPLE = i make 2 Library
Library 1 name = PRODUCT. with field = Name, image, qty in, price in.
Library 2 name = SELLER (as a sell catalogue). with field = Name, image, qty sell, price sell.

is there a way to autofill / trigger / clone (image field) Picture from PRODUCT Library to SELLER Library everytime i do imput / update at PRODUCT Library.

because im failed to implement this on image field. its show error screen like this below.
New entry in one library triggers new entry in another

20191225_224109.jpg

Screenshot_20191225-224129_Gallery.jpg



please share the knowledge How to: Link image / Trigger / autofill / javascript clone
from Libraries1 to Libraries2.

ThankYou & Best Regards.


Gilles Mons

unread,
Dec 25, 2019, 1:31:54 PM12/25/19
to Sinar Raya, mementodatabase
Hello,

For me this script works 
creation of a recording
after recording

var e = entry(), 
Dsav = libByName("Devis Monaco <-> S.L.V.");

newDsav = new Object();

newDsav["I.D."] = e.id;

newDsav["Date"] = e.field("Date");

newDsav["Demande Urgente ?"] = e.field("Demande Urgente ?");

newDsav["Demande Num."] = e.field("Num.");

newDsav["Devis où Cmd."] = e.field("Devis où Cmd.");

newDsav["MONACO État de la Demande"] = e.field("S.A.V. État de la Demande");

newDsav["Num. D.I."] = e.field("Num. D.I.");

newDsav["S.A.V. Terminé le"] = e.field("S.A.V. Terminé le");

newDsav["S.G. Terminé le"] = e.field("S.G. Terminé le");

newDsav["Cde. Directe reçu le..."] = e.field("Cde. Directe reçu le...");

newDsav["Demandé par..."] = e.field("Demandé par...");

newDsav["Pour..."] = e.field("Pour...");

newDsav["Ou ?"] = e.field("Ou ?");

newDsav["Sous Contrat"] = e.field("Sous Contrat");

newDsav["Travaux"] = e.field("Travaux");

newDsav["B D Pièces"] = e.field("B D Pièces");

newDsav["Liste des Pièces"] = e.field("Liste des Pièces");

newDsav["Nombre de Tech."] = e.field("Nombre de Tech.");

newDsav["Photos"]=e.field("Photos").join();

Dsav.create(newDsav);



--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mementodatabase/f3d9efab-7952-4d7d-a2c2-106eee4987d5%40googlegroups.com.

Ryo Wj

unread,
Dec 25, 2019, 2:08:37 PM12/25/19
to mementodatabase
Thanks. I try make same library & field like your Giles Mons.

I let u know if it works

Sinar Raya

unread,
Dec 25, 2019, 2:45:36 PM12/25/19
to mementodatabase


Pada Kamis, 26 Desember 2019 02.08.37 UTC+7, Ryo Wj menulis:
Thanks. I try make same library & field like your Giles Mons.

I let u know if it works



Not work. it said cannot call methode "create"

Captur2e.JPG

script i use=

var e = entry()

Inn = libByName("Out <-> S.L.V.");


newInn = new Object();


newInn["name"] = e.name

//either not work wnen change e.name became e,field("name")


newInn["pic"]=e.field("pic").join();


Inn.create(newInn);


do i miss something?



 

Gilles Mons

unread,
Dec 25, 2019, 3:03:27 PM12/25/19
to Sinar Raya, mementodatabase
perhaps

var e = entry(),

--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.

Gilles Mons

unread,
Dec 25, 2019, 3:06:24 PM12/25/19
to Sinar Raya, mementodatabase
And

e.field("name");

Not   e,field("name");



--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.

Gilles Mons

unread,
Dec 25, 2019, 3:09:54 PM12/25/19
to Sinar Raya, mementodatabase

Inn = libByName("Seller");





--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
Screenshot_20191225-205758_Memento Database.jpg

Sinar Raya

unread,
Dec 25, 2019, 3:33:51 PM12/25/19
to mementodatabase


Pada Kamis, 26 Desember 2019 03.09.54 UTC+7, Gilles Mons menulis:

Inn = libByName("Seller");




this my example Library. = Inn & Out 
both only have 2 field = Name & Pic.

Screenshot_20191226-032203_Memento Database.jpg

the script i put on Trigger as Create an Entry - before saving the entry.

result script error like this

Screenshot_20191226-031244_Memento Database.jpg

when i change to newInn["Name"] = e.Name;

also gave the same error message

Screenshot_20191226-033022_Memento Database.jpg


or maybe my script / my Field is too short?

Gilles Mons

unread,
Dec 25, 2019, 3:43:48 PM12/25/19
to Sinar Raya, mementodatabase
Ok tree this .. in Inn library...

e = entry(),
o = libByName("Out");

newo = new Object();

//newo [] = e.field("");

newo["pic"]=e.field("pic").join();

o.create(newo);



--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.

Sinar Raya

unread,
Dec 25, 2019, 3:56:01 PM12/25/19
to mementodatabase


Pada Kamis, 26 Desember 2019 03.43.48 UTC+7, Gilles Mons menulis:
Ok tree this .. in Inn library...

e = entry(),
o = libByName("Out");

newo = new Object();

//newo [] = e.field("");

newo["pic"]=e.field("pic").join();

o.create(newo);





OK. its WORKS Like a Charm.

Thanks  Gilles

Bill Crews

unread,
Dec 26, 2019, 9:57:49 AM12/26/19
to Sinar Raya, mementodatabase
I think no Autofill, no trigger, no clone, but just use a Link to Entry field from library 1 to library 2 and ensure your seller image field is set to display as Entry Description. (Or maybe set as Thumbnail?)

I think that'll display the sellers with each one's image within each product in an ideal fashion without having to do anything to accomplish it. You'll be able to add new sellers or select existing sellers directly from the product entry and manage everything from there.

Sinar Raya

unread,
Dec 26, 2019, 12:43:13 PM12/26/19
to mementodatabase


Pada Kamis, 26 Desember 2019 21.57.49 UTC+7, Bill Crews menulis:
 

its ok, thanks for the info, this case alrdy solved.
 now i have another project, lemme post it at new forum. see yaa & Merry Cristmast Bill

Bill Crews

unread,
Dec 26, 2019, 7:39:45 PM12/26/19
to Sinar Raya, mementodatabase
Hey, Sinar, glad you got it solved!

I confess that I feel it a little strange to prefer to exchange 10 forum messages regarding 44 lines of JavaScript code to get a solution right that copies field values from library to library every time an entry is added, when a trivial reference from one library to the other accomplishes the same thing with no copying/duplication of data, no development/debug time, no ongoing support or script to modify when anything changes, and no performance impact when adding an entry. But if you can check the box off and move onto the next project, that's a big value right there, especially during a possibly busy holiday season. Clearly, I'd do it the other way, though.

Merry Christmas & happy New Year to you as well. I'll see you & your other project in the forum.

Sinar Raya

unread,
Dec 27, 2019, 5:58:47 AM12/27/19
to mementodatabase


Pada Jumat, 27 Desember 2019 07.39.45 UTC+7, Bill Crews menulis:
 

Halo Bill, actually im buzy read / learning javascript from many website, but more im read, more i confuse..
i keep do wrong implement at the script, result came error when i run the script....

bytheway,.. here my 2nd forum post
pls have a look, Thanks & Happy New Year Bill.



Bill Crews

unread,
Dec 27, 2019, 3:00:14 PM12/27/19
to Sinar Raya, mementodatabase
I saw your other post. I would say nothing and let you use Memento however you want, but I'm just afraid others will see your posts and learn from them that this is the way Memento has to be used. It is so powerful that all this work is not generally necessary, though it's great that Memento can be programmed when it's really needed.

In general, when you find yourself having to try very hard to do something in Memento, it usually means you've either got an exotic requirement or that you need to learn Memento & database design better, so as to avoid having to spend extra time & trouble to meet the requirement.

As for the two of you, please feel free to use Memento however you see fit, but I'd prefer you ask questions of me in private emails, so people don't learn how to do it the hard way instead of a better way. I'm happy to provide the instruction, either privately or in the forum.

Gilles Mons

unread,
Dec 27, 2019, 3:12:05 PM12/27/19
to Bill Crews, Sinar Raya, mementodatabase
Hello Bill

all the instructions that I use accessible in the wiki of memento database 

The Support memento help me to develop my script 

I appreciate explanation but the problem is that they are not always very clear for people who learn JavaScript 

more you used a lot the relations between base personally I do not like them because not flexible 

that said would you have a description on the instructions "guid ()" & "findByKey ()"? thanks Bill


--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
Message has been deleted

Moh. Wahyu Dewanto

unread,
Jun 24, 2021, 7:37:36 AM6/24/21
to mementodatabase
Sinar raya please help me
Reply all
Reply to author
Forward
0 new messages