Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

[Newbie] Please help with database searching

Avatar

Former Community Member
I am not a programmer. Besides the difficulties of finding information that I can understand, I'm at a wall and need your help. I've downloaded all the documentation I could find from Adobe and still...



I am using Designer 8.0 and created an XML database.



I'm trying to write a script that will search my database until a match is found. If no match then a message appears.



I have done my homework and still haven't found my answer. It doesn't work. What am I doing wrong?



Thank you for your precious help.



This is my script :



var i=0

var oLast = xfa.dataWindow.currentRecordNumber + xfa.dataWindow.recordsAfter;

var oCode = Product1.CodeP.rawValue;



for (i=0;i <= oLast;i++) if (oCode == xfa.dataWindow.record(i).CodeP.value){ Product1.Subentry.Titre.rawValue = xfa.dataWindow.record(i).Titre.value; Product1.Subentry.DescF.rawValue = xfa.dataWindow.record(i).DescF.value; Product1.Subentry.DescA.rawValue = xfa.dataWindow.record(i).DescA.value; Product1.Subentry.Format.rawValue = xfa.dataWindow.record(i).Format.value; Product1.Subentry.Prix.rawValue = xfa.dataWindow.record(i).Prix.value; )



if (Product1.Subentry.Titre.rawValue == "")

app.alert("Code not found");
0 Replies