Skip to main content

Hi,
To meet a specific scenario on mobile, I need to meet the requirements below:
1- Make an attachment mandatory in one step?
2- The step will only be completed if there is an attachment
3- Remove the import attachment icon from the gallery

It's possible? If yes, how?
grateful.

Hi @WilsonX 

You did not mention which client you want this to work with.

1 / 2 - For task steps, you can either make the attachment mandatory or create a validation script.

3 - Which icon? Which client? Please elaborate.

Cheers!


½ Are there any sample scripts you can share? Gratitude

3 - 

 


@WilsonX 

The script depends on the scenario you have. It can include many different scenarios and logic, so it is hard to say.

The basic is to count the number of attachments and decide if this is OK. For example, if it is 0, you will need to do something.

var taskStepAttachmentCount = getDBValue(stringFormat("select count(attachment_id) from TASK_STEPS_ATTACHMENT WHERE ...));
if(taskStepAttachmentCount == 0)
DO SOMETHING...

 

Why do you want to remove the icon from the gallery? Or do you want to remove the function from the screen?

Cheers!


The customer's requirement is as follows: The Technician must take the photo immediately and not load an image saved on his equipment.


@WilsonX 

For that you need to write a client script.

The following aliases, valid for Mobile clients only, can be specified instead of the name of a control:

  • ATTACHMENT_WIDGET_PHOTO—represents the Camera button on the list screen of the Attachment Widget 
  • ATTACHMENT_WIDGET_VIDEO —represents the Video button on the list screen of the Attachment Widget 
  • —represents the File button on the list screen of the Attachment Widget 
  • BUTTON_ADD—represents an Add button at the bottom of the screen
  • BUTTON_NEXT—represents a Next button at the bottom of the screen 
  • BUTTON_SAVE—represents a Save button at the bottom of the screen 
  • BUTTON_LIST—represents a List button at the bottom of the screen 
  • QUICK_ACTIONBAR_STATUS—represents an image button in the quick‐action bar of the screen for task status 
  • QUICK_ACTIONBAR_OVERVIEW—represents an image button in the quick‐action bar of the screen to navigate to the Overview screen 
  • QUICK_ACTIONBAR_ATTACHMENT—represents an image button in the quick‐action bar of the screen to navigate to the Attachments screen 
  • QUICK_ACTIONBAR_NOTES—represents an image button in the quick‐ action bar of the screen to navigate to the Notes entry screen

So for the attachment widget →

>Some code]
...
setControlEnabled("ATTACHMENT_WIDGET_FILE", false);
...
nSome code]

Cheers!


Reply