asked on January 6, 2022 Show version history

Hello, I am new to customization on webclient. I reviewed the documentation from
https://www.laserfiche.com/support/webhelp/Laserfiche/10/en-US/administration/#../Subsystems/Integrations/Content/custom-actions.htm?Highlight=getFields
and I reviewed the sample package from Empower.

I could not understand the syntax of how to extract a specific field value from a selected entry using my custom action. Use case is the following:

- I have document entries in the repository that has a field (not part of the template) called TypeID

- I want to allow user to right click on the entry, or use the tool menu to select my custom action

- my custom action is to extract this specific field and then open a new browser that opens a url which will have reference to this TypeID (e.g. https://[server]/browse.aspx?typeID=xxx where xxx is the extracted TypeID

 

How should I code under my action definition? The documentation has mentioned only this: getfields().fields.supplementalFields

I tried using this "method" (documentation said this is a method but without the ()) by doing something like below. I just want to see if this method return something. But I realized that line "var fields = webAccessApi.getFields().fields.supplementalFields;" breaks the execution. the alert('!!') never got executed.

Can someone shred some lights please?

 

 

<ActionDefinition ID="OpenMyUrl">
    <Title>Open my URL with Type ID</Title>
    <Action>
      <![CDATA[
             var fields = webAccessApi.getFields().fields.supplementalFields;

alert('!!');

             //for (var f in fields) {
             //      if (f.name == 'TypeID')
             //       { 
             //           window.open('https://[server]/browse.aspx?typeID=' + f.value);
             //           break; 
             //       }
             //}             
      ]]>
    </Action>

 

2 0