Skip to main content
Question

Mandatory attachments in the Steps


WilsonX
Sidekick (Employee)
Forum|alt.badge.img+5

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.

Shneor Cheshin
Superhero (Employee)
Forum|alt.badge.img+28

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!


WilsonX
Sidekick (Employee)
Forum|alt.badge.img+5
  • Sidekick (Employee)
  • March 5, 2024

½ Are there any sample scripts you can share? Gratitude

3 - 

 


Shneor Cheshin
Superhero (Employee)
Forum|alt.badge.img+28

@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!


WilsonX
Sidekick (Employee)
Forum|alt.badge.img+5
  • Sidekick (Employee)
  • March 5, 2024

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


Shneor Cheshin
Superhero (Employee)
Forum|alt.badge.img+28

@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); 
...
[Some code]

Cheers!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings