0 votes

Hi,

On the Opportunity, in the grid of the companies I want to add the CmdCreateProposal in the grid menu to create launch a template for a specific company.

In my template I call a custom function to generate table (stored in the db conf)
[$RunScript(name="GetCustomWordTable", file="CustomTemplate")]

The function GetCustomWordTable use Variables.Values('Comp'); but I'm not able to get the key.

How can I pass the key of the company ? I tried with this :

Below Comp = literally 'Arguments.Values("Comp")'

[$RunScript(name="GetCustomWordTable", file="CustomTemplate", Comp=Arguments.Values("Comp"))]

Below, In my script Comp = ''

[$RunScript(name="GetCustomWordTable", file="CustomTemplate", Arguments.Values("Comp"))]

To try I customized the consultToolsCmd.js/proposal() function and use this macro in the word template :

function proposal() {
    InstantDocument(Element, Model('bookmark'), format("Oppo={key}"+'&Comp=18'));
    if (Model('detail') != 'Docu') {
        Browser.navigate(Model('hrefDetailDocu'));
    }
}
asked in How to by (259 points)

1 Answer

0 votes

You don't have to pass it as an argument to the [$RunScript()] tag.
Instead, take the comp argument direclty from the request URL.

var k_Company = StrToFloatDef(Request.argument("comp"), 0);
answered by (7.4k points)
Thanks for your answer but I already tried it (err 'Request' est indéfini" (word\document.xml)"

Below you can see the "how to do" that I want :
Trace :
1) Click on the bouton
2) Open window "https://demo.actilan.fr/efficy.dll/dialog?page=dialog/InstantDoc.htm&count=-1&bookmark=1031&Oppo=176&Comp=14"
3) Choose the template which contains "[$RunScript(name="GetCustomWordTable", file="CustomTemplate", Comp=Arguments.Values("Comp"))]"
4) the script get the key with "var k_company = Variables.Values('Comp');"
5) problem : the value is literally  "Variables.Values('Comp')"
or "'Request' est indéfini" (word\document.xml)"
Welcome to Efficy Overflow, where you can ask questions and receive answers from other members of the community.
1,249 questions
1,519 answers
1,859 comments
328 users