Easy to Create, Easy to Change - Easy to use!


Is there any difference in the syntax of the function MemoReplace used in a button or using MemoExecDQL?


Started by Tor Nerland
Search
You will need to Sign In to be able to add or comment on the forum!

Is there any difference in the syntax of the function MemoReplace used in a button or using MemoExecDQL?

Use this text in a button on the form order. This works as it should.

SetValue("DQL_Nr" ,"104") + Wait(0.1) + MemoExecDQL( DQL ,"2","","","","") +Wait(1) + MemoReplace(settings,"[{filename}]",GetVar("VarStiPDFfil")) + MemoWriteToFile(settings,concat(BullzipSettings ,"settings.ini"),1) +OpenProcedure( "pc_ORDREBEKREFTELSER_Kunde" ) + SetVar("VarDQL_Nr" ,DQL_Nr )

When I use the same text in DQL_Nr 104 which button I get the error checking script, stopping in front of the "settings" in MemoReplace with the message that the right side is wrong.

What is the reason? .

define temp "OrdreNr" numeric string 5 . 

define temp "KundeNr" numeric string 6 .

define temp "AgentNr" numeric string 6 .

define temp "KontaktNr" numeric string 6 .

define temp "Kontakt_AnsattNr" numeric string 5 .

define temp "Antall" number .

define temp "DokTypeNr" number .

define temp "AntallRapporter" number .

define temp "HovedstiDokumenter" text 100 .

define temp "PDFfilLagres" text 255 .

define temp "PDFfilLagres2" text 100 .

define temp "StiPDFfilSettings" text 255 .

define temp "RapportGruppe" text 10 .

define temp "retval" text .

temp OrdreNR := GetVar("VarOrdrenr") .

temp KundeNr := any ORDRE Kundenr .

temp AgentNr := any ORDRE Agentnr .

temp KontaktNr := any ORDRE Kontaktnr .

temp Kontakt_AnsattNr := any ORDRE K_Ansatt_Nr .

temp DokTypeNr := data-entry Field1 .

temp HovedstiDokumenter := any ORDRE HovedstiPDFdokumenter . .

temp StiPDFfilSettings := GetVar("VarStiPDFfilSettings") .

temp PDFfilLagres2 := concat(temp HovedstiDokumenter , GetVar("VarSkjema"),"\") .

temp Antall := 0 .

temp PDFfilLagres := blank .

temp Antall := 0 .

for DOKUMENTER with OrdreNr = temp OrdreNr and DokumenttypeID = temp DokTypeNr ; -- Avtall versjoner av dokumentet

temp Antall := temp Antall + 1 .

end

if temp DokTypeNr = 2 then temp RapportGruppe := "Kunde". else temp RapportGruppe := "Agent" . end

temp PDFfilLagres := concat( temp PDFfilLagres2 ,temp RapportGruppe , "\", if(temp KontaktNr = blank ,"000",temp KontaktNr ),"-",if(temp Kontakt_AnsattNr = blank,"000",temp Kontakt_AnsattNr),"-",GetVar("VarSkjema"),"-",temp OrdreNr ,"-", current user name, "-" , temp Antall + 1 , ".pdf") .

enter a record in DOKUMENTER

OrdreNr := temp OrdreNr ;

KundeNr := temp KundeNr ;

AgentNr := temp AgentNr ;

Komtakt ID := temp KontaktNr ;

--Merknader := temp StiPDFfilSettings ;

KontaktAnsattID := temp Kontakt_AnsattNr ;

DokumenttypeID := temp DokTypeNr ;

DokumentetKatalog := temp PDFfilLagres ;

Versjon := temp Antall + 1 .

retval := SetVar("VarStiPDFfil", temp PDFfilLagres) .

--retval := MemoReplace(settings,"[{filename}]",temp PDFfilLagres) .

--retval := MemoWriteToFile(settings,temp StiPDFfilSettings,1) .

--if temp DokTypeNr = 2 then

--run Procedure pc_ORDREBEKREFTELSER_Kunde .

--else

--run Procedure pc_ORDREBEKREFTELSER_Agent .

--end

What features should be used when the PDF file is shown from the form "DOCUMENTS", or other external programs to be opened as AutoCad, spreadsheets etc.

Please show this with examples.

Written by Tor Nerland 12/11/14 at 09:42:53 Dataease [{8}]FIVE

Re:Is there any difference in the syntax of the function MemoReplace used in a button or using MemoExecDQL?

The syntax on a button and in a DQL is different but only in how you reference the column and when/where.

In a form you will always have the PRISM column available but in a DQL it depends on where in the DQL you try to address it.

1. Do you have settings Memo in DOKUMENTER?
2. Have you tried to move the manipulation before the Enter a Record?

We have a little to little information about the underlying structure here to give a definitive answer.

What features should be used when the PDF file is shown from the form "DOCUMENTS", or other external programs to be opened as AutoCad, spreadsheets etc.

We use the IE browser object in the WebField so what you can preview etc in the field is down to how IE is configured for this. If you have installed plugins for previewing PDF, Autocad etc in your IE then it will also preview them in the WebField.

Written by DataEase 12/11/14 at 10:53:54 Dataease [{8}]FIVE